linear-react-components-ui 1.1.14-beta.0 → 1.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintcache +1 -0
- package/.eslintrc.json +45 -77
- package/.gitlab-ci.yml +13 -5
- package/.nvmrc +1 -0
- package/.vscode/settings.json +12 -3
- package/babel.config.json +4 -4
- package/lib/@types/SizePixels.d.ts +1 -1
- package/lib/alerts/AlertContainer.js +48 -57
- package/lib/alerts/AlertProvider.js +36 -54
- package/lib/alerts/BaseAlert.js +12 -19
- package/lib/alerts/Message.d.ts +1 -1
- package/lib/alerts/Message.js +78 -45
- package/lib/alerts/helpers.js +2 -3
- package/lib/alerts/index.js +3 -4
- package/lib/alerts/types.d.ts +1 -0
- package/lib/alerts/withAlert.js +10 -11
- package/lib/assets/styles/alerts.scss +4 -7
- package/lib/assets/styles/button.scss +11 -9
- package/lib/assets/styles/checkbox.scss +45 -38
- package/lib/assets/styles/colors.scss +3 -1
- package/lib/assets/styles/commons.scss +1 -0
- package/lib/assets/styles/dialog.scss +37 -20
- package/lib/assets/styles/drawers.scss +9 -6
- package/lib/assets/styles/error.scss +9 -0
- package/lib/assets/styles/fieldset.scss +3 -0
- package/lib/assets/styles/gridlayout.scss +0 -2
- package/lib/assets/styles/hint.scss +21 -0
- package/lib/assets/styles/icon.scss +31 -4
- package/lib/assets/styles/input.scss +7 -7
- package/lib/assets/styles/multiSelect.scss +6 -1
- package/lib/assets/styles/radio.scss +37 -35
- package/lib/assets/styles/select.scss +13 -7
- package/lib/assets/styles/table.scss +9 -1
- package/lib/assets/styles/tabs.scss +28 -18
- package/lib/assets/styles/textContent.scss +9 -0
- package/lib/avatar/index.js +41 -41
- package/lib/badge/index.js +12 -14
- package/lib/buttons/ActivateButton.js +6 -9
- package/lib/buttons/AddButton.js +9 -12
- package/lib/buttons/Button.js +11 -12
- package/lib/buttons/ButtonGroups.js +6 -5
- package/lib/buttons/CancelButton.js +10 -9
- package/lib/buttons/DangerButton.js +10 -9
- package/lib/buttons/DefaultButton.js +90 -90
- package/lib/buttons/DestroyButton.js +10 -9
- package/lib/buttons/EditButton.js +6 -9
- package/lib/buttons/InactivateButton.js +6 -9
- package/lib/buttons/InfoButton.js +10 -9
- package/lib/buttons/PrimaryButton.js +10 -9
- package/lib/buttons/RestoreButton.js +6 -9
- package/lib/buttons/SaveButton.js +10 -9
- package/lib/buttons/SuccessButton.js +10 -9
- package/lib/buttons/WarningButton.js +10 -9
- package/lib/buttons/button_container/index.js +17 -21
- package/lib/buttons/index.js +16 -17
- package/lib/buttons/split_button/index.js +22 -25
- package/lib/buttons/types.d.ts +1 -0
- package/lib/calendar/DangerCalendar.js +10 -9
- package/lib/calendar/InfoCalendar.js +10 -9
- package/lib/calendar/PrimaryCalendar.js +10 -9
- package/lib/calendar/SuccessCalendar.js +10 -9
- package/lib/calendar/WarningCalendar.js +10 -9
- package/lib/calendar/base/Day.js +13 -12
- package/lib/calendar/base/Month.js +13 -18
- package/lib/calendar/base/Week.js +13 -18
- package/lib/calendar/base/helpers.js +12 -12
- package/lib/calendar/base/index.js +30 -44
- package/lib/calendar/index.js +7 -8
- package/lib/checkbox/Label.js +20 -10
- package/lib/checkbox/index.d.ts +2 -2
- package/lib/checkbox/index.js +83 -97
- package/lib/checkbox/types.d.ts +2 -1
- package/lib/dialog/Alert.js +5 -6
- package/lib/dialog/Custom.js +16 -18
- package/lib/dialog/Error.js +5 -6
- package/lib/dialog/Information.js +5 -6
- package/lib/dialog/Question.js +13 -14
- package/lib/dialog/Warning.js +7 -7
- package/lib/dialog/base/Content.js +8 -6
- package/lib/dialog/base/Footer.js +5 -8
- package/lib/dialog/base/Header.js +29 -29
- package/lib/dialog/base/index.d.ts +8 -2
- package/lib/dialog/base/index.js +109 -105
- package/lib/dialog/base/style.js +7 -10
- package/lib/dialog/form/index.js +31 -34
- package/lib/dialog/index.js +8 -9
- package/lib/dialog/types.d.ts +8 -13
- package/lib/drawer/Content.js +12 -11
- package/lib/drawer/Drawer.js +74 -88
- package/lib/drawer/Header.js +34 -37
- package/lib/drawer/helpers.js +3 -4
- package/lib/drawer/index.js +4 -5
- package/lib/dropdown/Popup.d.ts +1 -1
- package/lib/dropdown/Popup.js +41 -42
- package/lib/dropdown/helper.js +3 -5
- package/lib/dropdown/types.d.ts +1 -0
- package/lib/dropdown/withDropdown.js +39 -60
- package/lib/fieldset/index.js +52 -58
- package/lib/fieldset/types.d.ts +2 -0
- package/lib/form/Field.d.ts +2 -0
- package/lib/form/Field.js +73 -79
- package/lib/form/FieldArray.d.ts +2 -0
- package/lib/form/FieldArray.js +70 -94
- package/lib/form/FieldNumber.d.ts +2 -0
- package/lib/form/FieldNumber.js +39 -48
- package/lib/form/FieldPeriod.d.ts +2 -0
- package/lib/form/FieldPeriod.js +48 -54
- package/lib/form/helpers.d.ts +2 -0
- package/lib/form/helpers.js +22 -27
- package/lib/form/index.d.ts +2 -0
- package/lib/form/index.js +114 -146
- package/lib/form/types.d.ts +6 -2
- package/lib/form/withFieldHOC.d.ts +2 -0
- package/lib/form/withFieldHOC.js +32 -39
- package/lib/form/withFormSecurity.d.ts +2 -0
- package/lib/form/withFormSecurity.js +27 -35
- package/lib/gridlayout/GridCol.js +14 -14
- package/lib/gridlayout/GridRow.js +18 -12
- package/lib/gridlayout/index.js +3 -4
- package/lib/gridlayout/types.d.ts +1 -1
- package/lib/hint/helpers.d.ts +3 -0
- package/lib/hint/helpers.js +21 -0
- package/lib/hint/index.d.ts +2 -1
- package/lib/hint/index.js +18 -29
- package/lib/hint/types.d.ts +3 -0
- package/lib/icons/helper.d.ts +4 -0
- package/lib/icons/helper.js +7 -4
- package/lib/icons/index.d.ts +3 -2
- package/lib/icons/index.js +43 -48
- package/lib/icons/types.d.ts +22 -9
- package/lib/index.d.ts +2 -1
- package/lib/index.js +10 -10
- package/lib/inputs/base/InputTextBase.d.ts +2 -0
- package/lib/inputs/base/InputTextBase.js +149 -113
- package/lib/inputs/base/Label.d.ts +14 -0
- package/lib/inputs/base/Label.js +35 -0
- package/lib/inputs/base/helpers.d.ts +3 -2
- package/lib/inputs/base/helpers.js +21 -26
- package/lib/inputs/base/types.d.ts +17 -2
- package/lib/inputs/color/index.js +29 -40
- package/lib/inputs/date/Dialog.d.ts +2 -0
- package/lib/inputs/date/Dialog.js +9 -10
- package/lib/inputs/date/Dropdown.d.ts +2 -0
- package/lib/inputs/date/Dropdown.js +12 -11
- package/lib/inputs/date/helpers.d.ts +2 -0
- package/lib/inputs/date/helpers.js +14 -14
- package/lib/inputs/date/index.d.ts +2 -0
- package/lib/inputs/date/index.js +127 -152
- package/lib/inputs/date/types.d.ts +4 -1
- package/lib/inputs/{mask/imaskHOC.d.ts → errorMessage/index.d.ts} +5 -7
- package/lib/inputs/errorMessage/index.js +26 -0
- package/lib/inputs/file/DefaultFile.d.ts +2 -0
- package/lib/inputs/file/DefaultFile.js +47 -74
- package/lib/inputs/file/DragDropFile.d.ts +2 -0
- package/lib/inputs/file/DragDropFile.js +97 -149
- package/lib/inputs/file/File.d.ts +3 -1
- package/lib/inputs/file/File.js +26 -32
- package/lib/inputs/file/FileButtonSettings.d.ts +2 -0
- package/lib/inputs/file/FileButtonSettings.js +13 -13
- package/lib/inputs/file/helpers.d.ts +2 -0
- package/lib/inputs/file/helpers.js +4 -6
- package/lib/inputs/file/index.d.ts +2 -0
- package/lib/inputs/file/index.js +4 -5
- package/lib/inputs/file/types.d.ts +2 -0
- package/lib/inputs/inputHOC.d.ts +2 -1
- package/lib/inputs/inputHOC.js +21 -34
- package/lib/inputs/mask/BaseMask.d.ts +4 -5
- package/lib/inputs/mask/BaseMask.js +125 -37
- package/lib/inputs/mask/Cnpj.d.ts +2 -0
- package/lib/inputs/mask/Cnpj.js +18 -31
- package/lib/inputs/mask/Cpf.d.ts +2 -0
- package/lib/inputs/mask/Cpf.js +20 -37
- package/lib/inputs/mask/Phone.d.ts +2 -0
- package/lib/inputs/mask/Phone.js +7 -6
- package/lib/inputs/mask/ZipCode.d.ts +2 -0
- package/lib/inputs/mask/ZipCode.js +6 -9
- package/lib/inputs/mask/helpers.d.ts +50 -12
- package/lib/inputs/mask/helpers.js +77 -37
- package/lib/inputs/mask/index.d.ts +4 -2
- package/lib/inputs/mask/index.js +6 -7
- package/lib/inputs/mask/types.d.ts +18 -17
- package/lib/inputs/multiSelect/ActionButtons.d.ts +2 -0
- package/lib/inputs/multiSelect/ActionButtons.js +23 -22
- package/lib/inputs/multiSelect/Dropdown.d.ts +2 -0
- package/lib/inputs/multiSelect/Dropdown.js +50 -67
- package/lib/inputs/multiSelect/helper.d.ts +2 -0
- package/lib/inputs/multiSelect/helper.js +8 -7
- package/lib/inputs/multiSelect/index.d.ts +2 -0
- package/lib/inputs/multiSelect/index.js +83 -135
- package/lib/inputs/multiSelect/types.d.ts +2 -0
- package/lib/inputs/number/BaseNumber.d.ts +2 -1
- package/lib/inputs/number/BaseNumber.js +25 -24
- package/lib/inputs/number/Currency.d.ts +2 -1
- package/lib/inputs/number/Currency.js +8 -8
- package/lib/inputs/number/Decimal.d.ts +2 -1
- package/lib/inputs/number/Decimal.js +3 -6
- package/lib/inputs/number/format_number.js +5 -5
- package/lib/inputs/number/index.d.ts +2 -1
- package/lib/inputs/number/index.js +20 -32
- package/lib/inputs/number/types.d.ts +2 -9
- package/lib/inputs/period/Dialog.d.ts +3 -1
- package/lib/inputs/period/Dialog.js +9 -10
- package/lib/inputs/period/Dropdown.d.ts +2 -0
- package/lib/inputs/period/Dropdown.js +8 -9
- package/lib/inputs/period/PeriodList.d.ts +2 -0
- package/lib/inputs/period/PeriodList.js +14 -13
- package/lib/inputs/period/helper.d.ts +2 -0
- package/lib/inputs/period/helper.js +34 -37
- package/lib/inputs/period/index.d.ts +2 -0
- package/lib/inputs/period/index.js +162 -196
- package/lib/inputs/period/types.d.ts +3 -1
- package/lib/inputs/search/index.d.ts +2 -1
- package/lib/inputs/search/index.js +45 -68
- package/lib/inputs/select/ActionButtons.d.ts +2 -1
- package/lib/inputs/select/ActionButtons.js +25 -35
- package/lib/inputs/select/Dropdown.d.ts +2 -1
- package/lib/inputs/select/Dropdown.js +41 -60
- package/lib/inputs/select/helper.d.ts +2 -1
- package/lib/inputs/select/helper.js +49 -43
- package/lib/inputs/select/index.d.ts +2 -0
- package/lib/inputs/select/index.js +13 -12
- package/lib/inputs/select/multiple/Selecteds.d.ts +3 -1
- package/lib/inputs/select/multiple/Selecteds.js +17 -22
- package/lib/inputs/select/multiple/index.d.ts +2 -0
- package/lib/inputs/select/multiple/index.js +125 -162
- package/lib/inputs/select/simple/index.d.ts +2 -0
- package/lib/inputs/select/simple/index.js +154 -179
- package/lib/inputs/select/types.d.ts +5 -2
- package/lib/inputs/text/index.js +3 -6
- package/lib/inputs/textarea/index.d.ts +2 -0
- package/lib/inputs/textarea/index.js +10 -10
- package/lib/inputs/textarea/types.d.ts +2 -0
- package/lib/inputs/types.d.ts +12 -9
- package/lib/internals/colorStyles.js +2 -3
- package/lib/internals/constants.js +2 -4
- package/lib/internals/types.d.ts +5 -2
- package/lib/internals/withTooltip.d.ts +3 -2
- package/lib/internals/withTooltip.js +76 -76
- package/lib/labelMessages/index.js +22 -42
- package/lib/labels/DangerLabel.js +10 -9
- package/lib/labels/DefaultLabel.js +26 -40
- package/lib/labels/InfoLabel.js +10 -9
- package/lib/labels/PrimaryLabel.js +10 -9
- package/lib/labels/SuccessLabel.js +10 -9
- package/lib/labels/WarningLabel.js +10 -9
- package/lib/labels/index.js +8 -9
- package/lib/labels/label_container/index.js +8 -8
- package/lib/list/Header.js +9 -8
- package/lib/list/Item.js +74 -70
- package/lib/list/Separator.js +5 -8
- package/lib/list/helpers.js +4 -6
- package/lib/list/index.js +74 -101
- package/lib/menus/float/MenuItem.js +19 -20
- package/lib/menus/float/SubMenuContainer.js +27 -33
- package/lib/menus/float/helpers.js +3 -4
- package/lib/menus/float/index.js +17 -18
- package/lib/menus/float/types.d.ts +1 -1
- package/lib/menus/index.js +2 -3
- package/lib/menus/sidenav/ExpandMenu.js +9 -8
- package/lib/menus/sidenav/MenuLink.js +10 -9
- package/lib/menus/sidenav/NavMenuGroup.js +12 -11
- package/lib/menus/sidenav/NavMenuItem.js +48 -62
- package/lib/menus/sidenav/NavSubMenuItem.js +20 -25
- package/lib/menus/sidenav/helpers.js +6 -9
- package/lib/menus/sidenav/index.js +85 -113
- package/lib/menus/sidenav/popup_menu_search/EmptyList.js +7 -7
- package/lib/menus/sidenav/popup_menu_search/index.js +64 -84
- package/lib/menus/sidenav/types.d.ts +1 -1
- package/lib/noPermission/index.js +14 -17
- package/lib/panel/Content.d.ts +1 -1
- package/lib/panel/Content.js +47 -60
- package/lib/panel/DangerPanel.d.ts +1 -1
- package/lib/panel/DangerPanel.js +6 -9
- package/lib/panel/Default.d.ts +1 -1
- package/lib/panel/Default.js +45 -60
- package/lib/panel/Header.d.ts +1 -1
- package/lib/panel/Header.js +32 -30
- package/lib/panel/InfoPanel.d.ts +1 -1
- package/lib/panel/InfoPanel.js +6 -9
- package/lib/panel/PrimaryPanel.d.ts +1 -1
- package/lib/panel/PrimaryPanel.js +6 -9
- package/lib/panel/SuccessPanel.d.ts +1 -1
- package/lib/panel/SuccessPanel.js +6 -9
- package/lib/panel/ToolBar.d.ts +1 -1
- package/lib/panel/ToolBar.js +6 -5
- package/lib/panel/WarningPanel.d.ts +1 -1
- package/lib/panel/WarningPanel.js +6 -9
- package/lib/panel/helpers.d.ts +7 -2
- package/lib/panel/helpers.js +12 -24
- package/lib/panel/index.d.ts +1 -1
- package/lib/panel/index.js +9 -10
- package/lib/panel/types.d.ts +46 -5
- package/lib/permissionValidations.js +24 -29
- package/lib/popover/PopoverText.js +6 -5
- package/lib/popover/PopoverTitle.js +6 -5
- package/lib/popover/index.js +15 -19
- package/lib/progress/Bar.js +31 -37
- package/lib/progress/index.js +18 -20
- package/lib/radio/index.js +36 -57
- package/lib/shortcuts/index.js +10 -9
- package/lib/skeleton/SkeletonContainer.js +10 -11
- package/lib/skeleton/index.js +27 -34
- package/lib/spinner/SpinnerLoading.js +7 -8
- package/lib/spinner/index.js +23 -37
- package/lib/split/Split.js +95 -112
- package/lib/split/SplitSide.js +20 -19
- package/lib/split/helpers.js +3 -4
- package/lib/split/index.js +3 -4
- package/lib/table/Body.js +42 -45
- package/lib/table/Header.js +29 -32
- package/lib/table/HeaderColumn.d.ts +1 -1
- package/lib/table/HeaderColumn.js +35 -22
- package/lib/table/Row.js +45 -48
- package/lib/table/RowColumn.js +38 -39
- package/lib/table/helpers.js +7 -13
- package/lib/table/index.js +82 -102
- package/lib/table/types.d.ts +3 -0
- package/lib/tabs/DropdownTabs.d.ts +11 -0
- package/lib/tabs/DropdownTabs.js +71 -0
- package/lib/tabs/Menu.d.ts +1 -1
- package/lib/tabs/Menu.js +35 -23
- package/lib/tabs/{DropdownItems.d.ts → MenuTabs.d.ts} +3 -3
- package/lib/tabs/MenuTabs.js +82 -0
- package/lib/tabs/Panel.d.ts +1 -1
- package/lib/tabs/Panel.js +70 -66
- package/lib/tabs/context.d.ts +12 -0
- package/lib/tabs/context.js +130 -0
- package/lib/tabs/index.d.ts +1 -1
- package/lib/tabs/index.js +46 -225
- package/lib/tabs/tabHelpers.d.ts +4 -15
- package/lib/tabs/tabHelpers.js +37 -42
- package/lib/tabs/types.d.ts +48 -15
- package/lib/tabs/useTabs.d.ts +11 -0
- package/lib/tabs/useTabs.js +11 -0
- package/lib/textContent/index.d.ts +8 -0
- package/lib/textContent/index.js +30 -0
- package/lib/toolbar/ButtonBar.js +39 -43
- package/lib/toolbar/LabelBar.js +36 -40
- package/lib/toolbar/Separator.js +5 -8
- package/lib/toolbar/ToolBarGroup.js +7 -7
- package/lib/toolbar/helpers.js +2 -3
- package/lib/toolbar/index.js +23 -25
- package/lib/toolbar/types.d.ts +1 -0
- package/lib/tooltip/index.js +28 -33
- package/lib/treetable/Body.js +21 -33
- package/lib/treetable/Header.js +11 -14
- package/lib/treetable/Row.js +90 -142
- package/lib/treetable/helpers.js +15 -24
- package/lib/treetable/index.js +11 -13
- package/lib/treeview/Header.js +8 -7
- package/lib/treeview/Node.js +96 -136
- package/lib/treeview/constants.js +2 -3
- package/lib/treeview/index.js +150 -216
- package/lib/uitour/helpers.js +4 -7
- package/lib/uitour/index.d.ts +2 -1
- package/lib/uitour/index.js +113 -100
- package/lib/uitour/types.d.ts +9 -1
- package/package.json +77 -82
- package/tsconfig.json +1 -0
- package/.tool-versions +0 -1
- package/lib/inputs/mask/imaskHOC.js +0 -224
- package/lib/tabs/DropdownItems.js +0 -65
- package/lib/tabs/MenuItems.d.ts +0 -11
- package/lib/tabs/MenuItems.js +0 -76
- package/lib/treeview_old/Header.js +0 -28
- package/lib/treeview_old/Node.js +0 -88
- package/lib/treeview_old/index.js +0 -42
- package/lib/types-c2a0f035.d.ts +0 -50
package/lib/treetable/Row.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
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
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -13,105 +12,63 @@ var _SpinnerLoading = _interopRequireDefault(require("../spinner/SpinnerLoading"
|
|
|
13
12
|
var _table = require("../table");
|
|
14
13
|
var _toolbar = _interopRequireWildcard(require("../toolbar"));
|
|
15
14
|
var _helpers = require("./helpers");
|
|
16
|
-
|
|
17
|
-
function _interopRequireDefault(
|
|
18
|
-
function _getRequireWildcardCache(
|
|
19
|
-
function _interopRequireWildcard(
|
|
20
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
21
|
-
function ownKeys(
|
|
22
|
-
function _objectSpread(
|
|
23
|
-
function _defineProperty(
|
|
24
|
-
function _toPropertyKey(
|
|
25
|
-
function _toPrimitive(
|
|
26
|
-
function _objectWithoutProperties(
|
|
27
|
-
function _objectWithoutPropertiesLoose(
|
|
28
|
-
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, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $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 defineProperty(generator, "_invoke", { value: makeInvokeMethod(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; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(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); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), 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, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), 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 (val) { var object = Object(val), 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; }
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
56
|
-
open = _useState2[0],
|
|
57
|
-
setOpen = _useState2[1];
|
|
58
|
-
var _useState3 = (0, _react.useState)(),
|
|
59
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
60
|
-
childrens = _useState4[0],
|
|
61
|
-
setChildrens = _useState4[1];
|
|
62
|
-
var _useState5 = (0, _react.useState)(false),
|
|
63
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
64
|
-
isLoadingChildrens = _useState6[0],
|
|
65
|
-
setIsLoadingChildrens = _useState6[1];
|
|
66
|
-
var _useState7 = (0, _react.useState)(false),
|
|
67
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
68
|
-
showToolbarElements = _useState8[0],
|
|
69
|
-
setShowToolbarElements = _useState8[1];
|
|
70
|
-
var _useState9 = (0, _react.useState)(false),
|
|
71
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
72
|
-
firstRenderingOfChildrens = _useState10[0],
|
|
73
|
-
setFirstRenderingOfChildrens = _useState10[1];
|
|
74
|
-
var searchChildrensAndInsertState = function searchChildrensAndInsertState() {
|
|
75
|
-
var dataChildrens = (0, _helpers.searchChildrensPerRow)(data, parentPropName, rowId, rowLevel);
|
|
15
|
+
const _excluded = ["validationKey", "onNodeElementClick"];
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
20
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
21
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
22
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
23
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
24
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
25
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
26
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
27
|
+
const TreeRow = props => {
|
|
28
|
+
const {
|
|
29
|
+
data,
|
|
30
|
+
dataColumns,
|
|
31
|
+
rootPropName,
|
|
32
|
+
stylesForRow,
|
|
33
|
+
parentPropName,
|
|
34
|
+
styleForLeftToolbar,
|
|
35
|
+
onClickFirstColumn,
|
|
36
|
+
onClickGetChildrens,
|
|
37
|
+
leftToolbarElements,
|
|
38
|
+
rightToolbarElements,
|
|
39
|
+
styleForRightToolbar,
|
|
40
|
+
toolbarElementsValidations
|
|
41
|
+
} = (0, _react.useContext)(_helpers.TreeTableContext);
|
|
42
|
+
const {
|
|
43
|
+
rowId,
|
|
44
|
+
dataRow,
|
|
45
|
+
rowLevel
|
|
46
|
+
} = props;
|
|
47
|
+
const [open, setOpen] = (0, _react.useState)(false);
|
|
48
|
+
const [childrens, setChildrens] = (0, _react.useState)();
|
|
49
|
+
const [isLoadingChildrens, setIsLoadingChildrens] = (0, _react.useState)(false);
|
|
50
|
+
const [showToolbarElements, setShowToolbarElements] = (0, _react.useState)(false);
|
|
51
|
+
const [firstRenderingOfChildrens, setFirstRenderingOfChildrens] = (0, _react.useState)(false);
|
|
52
|
+
const searchChildrensAndInsertState = () => {
|
|
53
|
+
const dataChildrens = (0, _helpers.searchChildrensPerRow)(data, parentPropName, rowId, rowLevel);
|
|
76
54
|
setChildrens(dataChildrens);
|
|
77
55
|
setIsLoadingChildrens(false);
|
|
78
56
|
};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
case 5:
|
|
95
|
-
setFirstRenderingOfChildrens(true);
|
|
96
|
-
_context.next = 9;
|
|
97
|
-
break;
|
|
98
|
-
case 8:
|
|
99
|
-
setOpen(function (prevState) {
|
|
100
|
-
return !prevState;
|
|
101
|
-
});
|
|
102
|
-
case 9:
|
|
103
|
-
case "end":
|
|
104
|
-
return _context.stop();
|
|
105
|
-
}
|
|
106
|
-
}, _callee);
|
|
107
|
-
}));
|
|
108
|
-
return function handlerShowChildrens() {
|
|
109
|
-
return _ref.apply(this, arguments);
|
|
110
|
-
};
|
|
111
|
-
}();
|
|
112
|
-
var validateRowElement = function validateRowElement(validationKey) {
|
|
113
|
-
var validations = toolbarElementsValidations && toolbarElementsValidations[validationKey];
|
|
114
|
-
var options = {
|
|
57
|
+
const handlerShowChildrens = async () => {
|
|
58
|
+
if (!firstRenderingOfChildrens && !open && onClickGetChildrens) {
|
|
59
|
+
setOpen(true);
|
|
60
|
+
setIsLoadingChildrens(true);
|
|
61
|
+
await onClickGetChildrens(rowId).then(() => {}).catch(() => {}).finally(() => {
|
|
62
|
+
searchChildrensAndInsertState();
|
|
63
|
+
});
|
|
64
|
+
setFirstRenderingOfChildrens(true);
|
|
65
|
+
} else {
|
|
66
|
+
setOpen(prevState => !prevState);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const validateRowElement = validationKey => {
|
|
70
|
+
const validations = toolbarElementsValidations && toolbarElementsValidations[validationKey];
|
|
71
|
+
const options = {
|
|
115
72
|
disabled: {
|
|
116
73
|
disabled: true
|
|
117
74
|
},
|
|
@@ -119,11 +76,13 @@ var TreeRow = function TreeRow(props) {
|
|
|
119
76
|
visible: false
|
|
120
77
|
}
|
|
121
78
|
};
|
|
122
|
-
|
|
79
|
+
let elementBehavior = {};
|
|
123
80
|
if (validations) {
|
|
124
|
-
validations.forEach(
|
|
125
|
-
|
|
126
|
-
|
|
81
|
+
validations.forEach(validation => {
|
|
82
|
+
const {
|
|
83
|
+
validator,
|
|
84
|
+
onDenied
|
|
85
|
+
} = validation;
|
|
127
86
|
if (_lodash.default.isEmpty(elementBehavior) && validator && validator(dataRow) && onDenied) {
|
|
128
87
|
elementBehavior = options[onDenied] || options.unvisible;
|
|
129
88
|
}
|
|
@@ -131,23 +90,25 @@ var TreeRow = function TreeRow(props) {
|
|
|
131
90
|
}
|
|
132
91
|
return elementBehavior;
|
|
133
92
|
};
|
|
134
|
-
|
|
135
|
-
|
|
93
|
+
const buildToolbarElements = elements => {
|
|
94
|
+
let newElementsWithNewProps = [];
|
|
136
95
|
if (elements) {
|
|
137
|
-
newElementsWithNewProps = _react.default.Children.map(elements,
|
|
96
|
+
newElementsWithNewProps = _react.default.Children.map(elements, element => {
|
|
138
97
|
if ( /*#__PURE__*/_react.default.isValidElement(element) && element.props) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
98
|
+
const _element$props = element.props,
|
|
99
|
+
{
|
|
100
|
+
validationKey,
|
|
101
|
+
onNodeElementClick
|
|
102
|
+
} = _element$props,
|
|
142
103
|
restProps = _objectWithoutProperties(_element$props, _excluded);
|
|
143
|
-
|
|
144
|
-
|
|
104
|
+
let elementBehavior;
|
|
105
|
+
let newProps = {};
|
|
145
106
|
if (toolbarElementsValidations && validationKey) {
|
|
146
107
|
elementBehavior = validateRowElement(validationKey);
|
|
147
108
|
}
|
|
148
109
|
if (onNodeElementClick) {
|
|
149
110
|
newProps = _objectSpread(_objectSpread({}, newProps), {}, {
|
|
150
|
-
onClick:
|
|
111
|
+
onClick: e => {
|
|
151
112
|
onNodeElementClick(dataRow);
|
|
152
113
|
if (e.stopPropagation) e.stopPropagation();
|
|
153
114
|
}
|
|
@@ -160,21 +121,17 @@ var TreeRow = function TreeRow(props) {
|
|
|
160
121
|
}
|
|
161
122
|
return newElementsWithNewProps;
|
|
162
123
|
};
|
|
163
|
-
(0, _react.useEffect)(
|
|
124
|
+
(0, _react.useEffect)(() => {
|
|
164
125
|
searchChildrensAndInsertState();
|
|
165
126
|
}, [data]);
|
|
166
|
-
(0, _react.useEffect)(
|
|
127
|
+
(0, _react.useEffect)(() => {
|
|
167
128
|
setIsLoadingChildrens(false);
|
|
168
129
|
}, [childrens]);
|
|
169
130
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_table.TRow, _extends({}, props, {
|
|
170
131
|
dataId: rowId,
|
|
171
132
|
customClass: "tree-row-element",
|
|
172
|
-
onMouseEnter:
|
|
173
|
-
|
|
174
|
-
},
|
|
175
|
-
onMouseLeave: function onMouseLeave() {
|
|
176
|
-
return setShowToolbarElements(false);
|
|
177
|
-
}
|
|
133
|
+
onMouseEnter: () => leftToolbarElements ? setShowToolbarElements(true) : null,
|
|
134
|
+
onMouseLeave: () => setShowToolbarElements(false)
|
|
178
135
|
}), /*#__PURE__*/_react.default.createElement(_table.Td, {
|
|
179
136
|
ignoreTableColClick: true,
|
|
180
137
|
key: "td-".concat(dataColumns[0].name, "-").concat((0, _uuid.v1)()),
|
|
@@ -189,9 +146,7 @@ var TreeRow = function TreeRow(props) {
|
|
|
189
146
|
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
190
147
|
tabIndex: -1,
|
|
191
148
|
className: "open-close-children",
|
|
192
|
-
onClick:
|
|
193
|
-
return handlerShowChildrens();
|
|
194
|
-
}
|
|
149
|
+
onClick: () => handlerShowChildrens()
|
|
195
150
|
}, open ? /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
196
151
|
name: "up",
|
|
197
152
|
size: 10
|
|
@@ -203,9 +158,7 @@ var TreeRow = function TreeRow(props) {
|
|
|
203
158
|
role: "button",
|
|
204
159
|
onKeyPress: undefined,
|
|
205
160
|
className: "value-button",
|
|
206
|
-
onClick:
|
|
207
|
-
return onClickFirstColumn ? onClickFirstColumn(rowId) : {};
|
|
208
|
-
}
|
|
161
|
+
onClick: () => onClickFirstColumn ? onClickFirstColumn(rowId) : {}
|
|
209
162
|
}, dataRow[dataColumns[0].name])), /*#__PURE__*/_react.default.createElement("span", {
|
|
210
163
|
className: "container-toolbar-buttons"
|
|
211
164
|
}, /*#__PURE__*/_react.default.createElement(_toolbar.default, {
|
|
@@ -224,13 +177,11 @@ var TreeRow = function TreeRow(props) {
|
|
|
224
177
|
height: 'fit-content',
|
|
225
178
|
gap: '4px'
|
|
226
179
|
}, styleForRightToolbar)
|
|
227
|
-
}, rightToolbarElements && buildToolbarElements(rightToolbarElements)))))), dataColumns.slice(1).map(
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
}, dataRow[column.name]);
|
|
233
|
-
})), open && /*#__PURE__*/_react.default.createElement(_react.Fragment, null, childrens && childrens.length === 0 && isLoadingChildrens ? /*#__PURE__*/_react.default.createElement(_table.TRow, {
|
|
180
|
+
}, rightToolbarElements && buildToolbarElements(rightToolbarElements)))))), dataColumns.slice(1).map(column => /*#__PURE__*/_react.default.createElement(_table.Td, {
|
|
181
|
+
key: "key-".concat(column.name, "-").concat((0, _uuid.v1)()),
|
|
182
|
+
style: _objectSpread({}, column.style),
|
|
183
|
+
ignoreTableColClick: true
|
|
184
|
+
}, dataRow[column.name]))), open && /*#__PURE__*/_react.default.createElement(_react.Fragment, null, childrens && childrens.length === 0 && isLoadingChildrens ? /*#__PURE__*/_react.default.createElement(_table.TRow, {
|
|
234
185
|
key: "tr-loading-childrens"
|
|
235
186
|
}, /*#__PURE__*/_react.default.createElement("td", {
|
|
236
187
|
colSpan: dataColumns.length,
|
|
@@ -240,15 +191,13 @@ var TreeRow = function TreeRow(props) {
|
|
|
240
191
|
}, /*#__PURE__*/_react.default.createElement(_SpinnerLoading.default, {
|
|
241
192
|
size: "48px",
|
|
242
193
|
key: "loading-childrens"
|
|
243
|
-
})))) : /*#__PURE__*/_react.default.createElement(_react.Fragment, null, childrens && childrens.map(
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
});
|
|
251
|
-
}), childrens && childrens.length !== 0 && isLoadingChildrens && /*#__PURE__*/_react.default.createElement(_table.TRow, {
|
|
194
|
+
})))) : /*#__PURE__*/_react.default.createElement(_react.Fragment, null, childrens && childrens.map(item => /*#__PURE__*/_react.default.createElement(TreeRow, {
|
|
195
|
+
dataRow: item,
|
|
196
|
+
rowLevel: item.rowLevel ? item.rowLevel + 1 : 1,
|
|
197
|
+
key: item[rootPropName],
|
|
198
|
+
rowId: "".concat(item[rootPropName]),
|
|
199
|
+
style: stylesForRow
|
|
200
|
+
})), childrens && childrens.length !== 0 && isLoadingChildrens && /*#__PURE__*/_react.default.createElement(_table.TRow, {
|
|
252
201
|
key: "tr-loading-childrens"
|
|
253
202
|
}, /*#__PURE__*/_react.default.createElement("td", {
|
|
254
203
|
colSpan: dataColumns.length,
|
|
@@ -260,5 +209,4 @@ var TreeRow = function TreeRow(props) {
|
|
|
260
209
|
key: "loading-childrens"
|
|
261
210
|
})))))));
|
|
262
211
|
};
|
|
263
|
-
var _default = TreeRow;
|
|
264
|
-
exports.default = _default;
|
|
212
|
+
var _default = exports.default = TreeRow;
|
package/lib/treetable/helpers.js
CHANGED
|
@@ -5,36 +5,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.searchRootElements = exports.searchChildrensPerRow = exports.TreeTableContext = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var dataFiltered;
|
|
8
|
+
const TreeTableContext = exports.TreeTableContext = /*#__PURE__*/(0, _react.createContext)({});
|
|
9
|
+
const searchRootElements = function (data, parentPropName) {
|
|
10
|
+
let rowLevel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
11
|
+
let dataFiltered;
|
|
13
12
|
if (data) {
|
|
14
|
-
dataFiltered = data.filter(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return Object.assign(item, {}, {
|
|
19
|
-
rowLevel: rowLevel
|
|
20
|
-
});
|
|
21
|
-
});
|
|
13
|
+
dataFiltered = data.filter(item => !item[parentPropName]);
|
|
14
|
+
return dataFiltered.map(item => Object.assign(item, {}, {
|
|
15
|
+
rowLevel
|
|
16
|
+
}));
|
|
22
17
|
}
|
|
23
18
|
return data;
|
|
24
19
|
};
|
|
25
20
|
exports.searchRootElements = searchRootElements;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
const searchChildrensPerRow = function (data, parentPropName, rowId) {
|
|
22
|
+
let rowLevel = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
23
|
+
let dataFiltered;
|
|
29
24
|
if (data && rowId) {
|
|
30
|
-
dataFiltered = data.filter(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return Object.assign(item, {}, {
|
|
35
|
-
rowLevel: rowLevel
|
|
36
|
-
});
|
|
37
|
-
});
|
|
25
|
+
dataFiltered = data.filter(item => item[parentPropName] === Number(rowId));
|
|
26
|
+
return dataFiltered.map(item => Object.assign(item, {}, {
|
|
27
|
+
rowLevel
|
|
28
|
+
}));
|
|
38
29
|
}
|
|
39
30
|
return data;
|
|
40
31
|
};
|
package/lib/treetable/index.js
CHANGED
|
@@ -10,21 +10,19 @@ var _table = _interopRequireDefault(require("../table"));
|
|
|
10
10
|
var _Body = _interopRequireDefault(require("./Body"));
|
|
11
11
|
var _Header = _interopRequireDefault(require("./Header"));
|
|
12
12
|
var _helpers = require("./helpers");
|
|
13
|
-
function _interopRequireDefault(
|
|
14
|
-
function
|
|
15
|
-
function
|
|
16
|
-
function
|
|
17
|
-
function
|
|
18
|
-
function
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var contextValues = _objectSpread({}, props);
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
15
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
19
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
20
|
+
const TreeTable = props => {
|
|
21
|
+
const contextValues = _objectSpread({}, props);
|
|
23
22
|
return /*#__PURE__*/_react.default.createElement(_helpers.TreeTableContext.Provider, {
|
|
24
23
|
value: contextValues
|
|
25
24
|
}, /*#__PURE__*/_react.default.createElement(_table.default, _extends({}, props, {
|
|
26
|
-
onColClick:
|
|
25
|
+
onColClick: () => {}
|
|
27
26
|
}), /*#__PURE__*/_react.default.createElement(_Header.default, null), /*#__PURE__*/_react.default.createElement(_Body.default, null)));
|
|
28
27
|
};
|
|
29
|
-
var _default = TreeTable;
|
|
30
|
-
exports.default = _default;
|
|
28
|
+
var _default = exports.default = TreeTable;
|
package/lib/treeview/Header.js
CHANGED
|
@@ -5,16 +5,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
function _interopRequireDefault(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
const Header = props => {
|
|
10
|
+
const {
|
|
11
|
+
title,
|
|
12
|
+
customClass,
|
|
13
|
+
children
|
|
14
|
+
} = props;
|
|
13
15
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
14
16
|
className: "treeviewheader ".concat(customClass)
|
|
15
17
|
}, title ? /*#__PURE__*/_react.default.createElement("div", {
|
|
16
18
|
className: "title"
|
|
17
19
|
}, title) : children);
|
|
18
20
|
};
|
|
19
|
-
var _default = Header;
|
|
20
|
-
exports.default = _default;
|
|
21
|
+
var _default = exports.default = Header;
|