linear-react-components-ui 0.4.77-beta.25 → 0.4.77-beta.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +2 -0
- package/.vscode/settings.json +2 -2
- package/babel.config.json +11 -0
- package/lib/@types/Align.d.ts +3 -0
- package/lib/@types/ButtonTypes.d.ts +3 -0
- package/lib/@types/ColorStyles.d.ts +3 -0
- package/lib/@types/DataCombo.d.ts +3 -0
- package/lib/@types/Icon.d.ts +5 -0
- package/lib/@types/LabelStyles.d.ts +3 -0
- package/lib/@types/Period.d.ts +6 -0
- package/lib/@types/PermissionAttr.d.ts +14 -0
- package/lib/@types/PointerEvents.d.ts +3 -0
- package/lib/@types/Position.d.ts +3 -0
- package/lib/@types/PositionAlert.d.ts +3 -0
- package/lib/@types/Size.d.ts +3 -0
- package/lib/@types/SizePixels.d.ts +3 -0
- package/lib/@types/StorageMock.d.ts +5 -0
- package/lib/alerts/AlertContainer.d.ts +16 -0
- package/lib/alerts/AlertProvider.d.ts +7 -0
- package/lib/alerts/AlertProvider.js +1 -1
- package/lib/alerts/BaseAlert.d.ts +7 -0
- package/lib/alerts/Message.d.ts +7 -0
- package/lib/alerts/helpers.d.ts +7 -0
- package/lib/alerts/index.d.ts +6 -0
- package/lib/alerts/types.d.ts +48 -0
- package/lib/alerts/withAlert.d.ts +7 -0
- package/lib/alerts/withAlert.js +5 -3
- package/lib/avatar/index.d.ts +12 -0
- package/lib/avatar/types.d.ts +31 -0
- package/lib/badge/index.d.ts +6 -0
- package/lib/badge/types.d.ts +13 -0
- package/lib/buttons/ActivateButton.d.ts +9 -0
- package/lib/buttons/AddButton.d.ts +9 -0
- package/lib/buttons/Button.d.ts +12 -0
- package/lib/buttons/ButtonGroups.d.ts +8 -0
- package/lib/buttons/CancelButton.d.ts +9 -0
- package/lib/buttons/DangerButton.d.ts +9 -0
- package/lib/buttons/DefaultButton.d.ts +12 -0
- package/lib/buttons/DefaultButton.js +5 -3
- package/lib/buttons/DestroyButton.d.ts +9 -0
- package/lib/buttons/EditButton.d.ts +9 -0
- package/lib/buttons/InactivateButton.d.ts +9 -0
- package/lib/buttons/InfoButton.d.ts +9 -0
- package/lib/buttons/PrimaryButton.d.ts +9 -0
- package/lib/buttons/RestoreButton.d.ts +9 -0
- package/lib/buttons/SaveButton.d.ts +9 -0
- package/lib/buttons/SuccessButton.d.ts +9 -0
- package/lib/buttons/WarningButton.d.ts +9 -0
- package/lib/buttons/button_container/index.d.ts +12 -0
- package/lib/buttons/index.d.ts +21 -0
- package/lib/buttons/split_button/index.d.ts +9 -0
- package/lib/buttons/split_button/index.js +22 -2
- package/lib/buttons/types.d.ts +44 -0
- package/lib/calendar/DangerCalendar.d.ts +7 -0
- package/lib/calendar/InfoCalendar.d.ts +7 -0
- package/lib/calendar/PrimaryCalendar.d.ts +7 -0
- package/lib/calendar/SuccessCalendar.d.ts +7 -0
- package/lib/calendar/WarningCalendar.d.ts +7 -0
- package/lib/calendar/base/Day.d.ts +7 -0
- package/lib/calendar/base/Month.d.ts +7 -0
- package/lib/calendar/base/Week.d.ts +7 -0
- package/lib/calendar/base/helpers.d.ts +62 -0
- package/lib/calendar/base/helpers.js +1 -1
- package/lib/calendar/base/index.d.ts +7 -0
- package/lib/calendar/index.d.ts +10 -0
- package/lib/calendar/types.d.ts +25 -0
- package/lib/checkbox/Label.d.ts +11 -0
- package/lib/checkbox/index.d.ts +13 -0
- package/lib/checkbox/index.js +1 -1
- package/lib/checkbox/types.d.ts +42 -0
- package/lib/dialog/Alert.d.ts +6 -0
- package/lib/dialog/Custom.d.ts +6 -0
- package/lib/dialog/Custom.js +4 -4
- package/lib/dialog/Error.d.ts +6 -0
- package/lib/dialog/Information.d.ts +6 -0
- package/lib/dialog/Question.d.ts +6 -0
- package/lib/dialog/Warning.d.ts +6 -0
- package/lib/dialog/base/Content.d.ts +6 -0
- package/lib/dialog/base/Footer.d.ts +6 -0
- package/lib/dialog/base/Header.d.ts +6 -0
- package/lib/dialog/base/index.d.ts +6 -0
- package/lib/dialog/form/index.d.ts +6 -0
- package/lib/dialog/index.d.ts +10 -0
- package/lib/dialog/types.d.ts +68 -0
- package/lib/drawer/Content.d.ts +7 -0
- package/lib/drawer/Drawer.d.ts +7 -0
- package/lib/drawer/Drawer.js +1 -1
- package/lib/drawer/Header.d.ts +7 -0
- package/lib/drawer/helpers.d.ts +7 -0
- package/lib/drawer/index.d.ts +9 -0
- package/lib/drawer/types.d.ts +34 -0
- package/lib/dropdown/Popup.d.ts +6 -0
- package/lib/dropdown/Popup.js +4 -2
- package/lib/dropdown/helper.d.ts +4 -0
- package/lib/dropdown/types.d.ts +43 -0
- package/lib/dropdown/withDropdown.d.ts +10 -0
- package/lib/dropdown/withDropdown.js +3 -1
- package/lib/fieldset/index.d.ts +8 -0
- package/lib/fieldset/index.js +1 -1
- package/lib/fieldset/types.d.ts +28 -0
- package/lib/form/Field.d.ts +6 -0
- package/lib/form/Field.js +11 -38
- package/lib/form/FieldArray.d.ts +6 -0
- package/lib/form/FieldArray.js +18 -48
- package/lib/form/FieldNumber.d.ts +6 -0
- package/lib/form/FieldNumber.js +2 -26
- package/lib/form/FieldPeriod.d.ts +6 -0
- package/lib/form/FieldPeriod.js +18 -40
- package/lib/form/helpers.d.ts +11 -0
- package/lib/form/helpers.js +10 -16
- package/lib/form/index.d.ts +9 -0
- package/lib/form/index.js +50 -85
- package/lib/form/types.d.ts +168 -0
- package/lib/{treetable/types.d.js → form/types.js} +0 -0
- package/lib/form/withFieldHOC.d.ts +6 -0
- package/lib/form/withFieldHOC.js +38 -118
- package/lib/form/withFormSecurity.d.ts +7 -0
- package/lib/form/withFormSecurity.js +13 -34
- package/lib/gridlayout/GridCol.d.ts +6 -0
- package/lib/gridlayout/GridRow.d.ts +6 -0
- package/lib/gridlayout/index.d.ts +5 -0
- package/lib/gridlayout/types.d.ts +20 -0
- package/lib/icons/helper.d.ts +560 -0
- package/lib/icons/index.d.ts +8 -0
- package/lib/icons/types.d.ts +28 -0
- package/lib/index.d.ts +35 -0
- package/lib/inputs/base/InputTextBase.d.ts +8 -0
- package/lib/inputs/base/InputTextBase.js +2 -2
- package/lib/inputs/base/helpers.d.ts +14 -0
- package/lib/inputs/base/helpers.js +1 -1
- package/lib/inputs/base/types.d.ts +68 -0
- package/lib/inputs/color/index.d.ts +7 -0
- package/lib/inputs/color/types.d.ts +14 -0
- package/lib/inputs/date/Dialog.d.ts +10 -0
- package/lib/inputs/date/Dropdown.d.ts +10 -0
- package/lib/inputs/date/helpers.d.ts +14 -0
- package/lib/inputs/date/index.d.ts +10 -0
- package/lib/inputs/date/types.d.ts +53 -0
- package/lib/inputs/inputHOC.d.ts +11 -0
- package/lib/inputs/mask/BaseMask.d.ts +12 -0
- package/lib/inputs/mask/Cnpj.d.ts +12 -0
- package/lib/inputs/mask/Cnpj.js +3 -1
- package/lib/inputs/mask/Cpf.d.ts +12 -0
- package/lib/inputs/mask/Cpf.js +5 -2
- package/lib/inputs/mask/Phone.d.ts +9 -0
- package/lib/inputs/mask/ZipCode.d.ts +9 -0
- package/lib/inputs/mask/helpers.d.ts +14 -0
- package/lib/inputs/mask/imaskHOC.d.ts +14 -0
- package/lib/inputs/mask/imaskHOC.js +9 -10
- package/lib/inputs/mask/index.d.ts +11 -0
- package/lib/inputs/mask/types.d.ts +66 -0
- package/lib/inputs/multiSelect/ActionButtons.d.ts +10 -0
- package/lib/inputs/multiSelect/Dropdown.d.ts +10 -0
- package/lib/inputs/multiSelect/helper.d.ts +9 -0
- package/lib/inputs/multiSelect/index.d.ts +10 -0
- package/lib/inputs/multiSelect/index.js +6 -3
- package/lib/inputs/multiSelect/types.d.ts +49 -0
- package/lib/inputs/number/BaseNumber.d.ts +12 -0
- package/lib/inputs/number/BaseNumber.js +1 -1
- package/lib/inputs/number/Currency.d.ts +12 -0
- package/lib/inputs/number/Decimal.d.ts +12 -0
- package/lib/inputs/number/format_number.d.ts +4 -0
- package/lib/inputs/number/index.d.ts +14 -0
- package/lib/inputs/number/types.d.ts +30 -0
- package/lib/inputs/period/Dialog.d.ts +11 -0
- package/lib/inputs/period/Dropdown.d.ts +11 -0
- package/lib/inputs/period/PeriodList.d.ts +11 -0
- package/lib/inputs/period/helper.d.ts +19 -0
- package/lib/inputs/period/index.d.ts +11 -0
- package/lib/inputs/period/index.js +7 -5
- package/lib/inputs/period/types.d.ts +58 -0
- package/lib/inputs/search/index.d.ts +11 -0
- package/lib/inputs/search/index.js +0 -3
- package/lib/inputs/select/ActionButtons.d.ts +11 -0
- package/lib/inputs/select/Dropdown.d.ts +11 -0
- package/lib/inputs/select/helper.d.ts +25 -0
- package/lib/inputs/select/index.d.ts +10 -0
- package/lib/inputs/select/index.js +3 -1
- package/lib/inputs/select/multiple/Selecteds.d.ts +10 -0
- package/lib/inputs/select/multiple/index.d.ts +10 -0
- package/lib/inputs/select/simple/index.d.ts +10 -0
- package/lib/inputs/select/simple/index.js +19 -1
- package/lib/inputs/select/types.d.ts +98 -0
- package/lib/inputs/text/index.d.ts +11 -0
- package/lib/inputs/text/types.d.ts +25 -0
- package/lib/inputs/textarea/index.d.ts +9 -0
- package/lib/inputs/textarea/types.d.ts +13 -0
- package/lib/inputs/types.d.ts +146 -0
- package/lib/internals/colorStyles.d.ts +9 -0
- package/lib/internals/constants.d.ts +11 -0
- package/lib/internals/types.d.ts +21 -0
- package/lib/internals/withTooltip.d.ts +11 -0
- package/lib/labelMessages/index.d.ts +7 -0
- package/lib/labelMessages/types.d.ts +18 -0
- package/lib/labels/DangerLabel.d.ts +9 -0
- package/lib/labels/DefaultLabel.d.ts +12 -0
- package/lib/labels/DefaultLabel.js +1 -1
- package/lib/labels/InfoLabel.d.ts +9 -0
- package/lib/labels/PrimaryLabel.d.ts +9 -0
- package/lib/labels/SuccessLabel.d.ts +9 -0
- package/lib/labels/WarningLabel.d.ts +9 -0
- package/lib/labels/index.d.ts +13 -0
- package/lib/labels/label_container/index.d.ts +12 -0
- package/lib/labels/types.d.ts +24 -0
- package/lib/list/Header.d.ts +7 -0
- package/lib/list/Item.d.ts +7 -0
- package/lib/list/Item.js +8 -6
- package/lib/list/Separator.d.ts +3 -0
- package/lib/list/helpers.d.ts +12 -0
- package/lib/list/helpers.js +8 -3
- package/lib/list/index.d.ts +10 -0
- package/lib/list/index.js +87 -18
- package/lib/list/types.d.ts +64 -0
- package/lib/menus/float/MenuItem.d.ts +7 -0
- package/lib/menus/float/helpers.d.ts +7 -0
- package/lib/menus/float/index.d.ts +8 -0
- package/lib/menus/float/types.d.ts +27 -0
- package/lib/menus/index.d.ts +6 -0
- package/lib/menus/sidenav/ExpandMenu.d.ts +10 -0
- package/lib/menus/sidenav/MenuLink.d.ts +13 -0
- package/lib/menus/sidenav/NavMenuGroup.d.ts +10 -0
- package/lib/menus/sidenav/NavMenuItem.d.ts +13 -0
- package/lib/menus/sidenav/NavMenuItem.js +1 -1
- package/lib/menus/sidenav/NavSubMenuItem.d.ts +10 -0
- package/lib/menus/sidenav/NavSubMenuItem.js +1 -1
- package/lib/menus/sidenav/helpers.d.ts +12 -0
- package/lib/menus/sidenav/index.d.ts +14 -0
- package/lib/menus/sidenav/popup_menu_search/EmptyList.d.ts +10 -0
- package/lib/menus/sidenav/popup_menu_search/index.d.ts +10 -0
- package/lib/menus/sidenav/types.d.ts +82 -0
- package/lib/noPermission/index.d.ts +3 -0
- package/lib/panel/Content.d.ts +8 -0
- package/lib/panel/DangerPanel.d.ts +8 -0
- package/lib/panel/Default.d.ts +8 -0
- package/lib/panel/Default.js +1 -1
- package/lib/panel/Header.d.ts +8 -0
- package/lib/panel/InfoPanel.d.ts +8 -0
- package/lib/panel/PrimaryPanel.d.ts +8 -0
- package/lib/panel/SuccessPanel.d.ts +8 -0
- package/lib/panel/ToolBar.d.ts +8 -0
- package/lib/panel/WarningPanel.d.ts +8 -0
- package/lib/panel/helpers.d.ts +4 -0
- package/lib/panel/index.d.ts +13 -0
- package/lib/panel/types.d.ts +4 -0
- package/lib/permissionValidations.d.ts +14 -0
- package/lib/permissionValidations.js +14 -12
- package/lib/popover/PopoverText.d.ts +8 -0
- package/lib/popover/PopoverTitle.d.ts +8 -0
- package/lib/popover/index.d.ts +13 -0
- package/lib/popover/types.d.ts +21 -0
- package/lib/progress/Bar.d.ts +6 -0
- package/lib/progress/index.d.ts +7 -0
- package/lib/progress/types.d.ts +37 -0
- package/lib/radio/index.d.ts +12 -0
- package/lib/radio/index.js +1 -1
- package/lib/radio/types.d.ts +18 -0
- package/lib/skeleton/SkeletonContainer.d.ts +7 -0
- package/lib/skeleton/SkeletonContainer.js +0 -13
- package/lib/skeleton/index.d.ts +8 -0
- package/lib/skeleton/index.js +6 -25
- package/lib/skeleton/types.d.ts +21 -0
- package/lib/skeleton/types.js +5 -0
- package/lib/spinner/SpinnerLoading.d.ts +7 -0
- package/lib/spinner/index.d.ts +7 -0
- package/lib/spinner/types.d.ts +20 -0
- package/lib/split/Split.d.ts +6 -0
- package/lib/split/SplitSide.d.ts +6 -0
- package/lib/split/helpers.d.ts +10 -0
- package/lib/split/index.d.ts +5 -0
- package/lib/split/types.d.ts +34 -0
- package/lib/table/Body.d.ts +6 -0
- package/lib/table/Header.d.ts +6 -0
- package/lib/table/Header.js +34 -6
- package/lib/table/HeaderColumn.d.ts +6 -0
- package/lib/table/HeaderColumn.js +1 -1
- package/lib/table/Row.d.ts +6 -0
- package/lib/table/Row.js +4 -9
- package/lib/table/RowColumn.d.ts +6 -0
- package/lib/table/RowColumn.js +2 -2
- package/lib/table/helpers.d.ts +8 -0
- package/lib/table/index.d.ts +11 -0
- package/lib/table/types.d.ts +84 -0
- package/lib/tabs/DropdownItems.d.ts +9 -0
- package/lib/tabs/Menu.d.ts +9 -0
- package/lib/tabs/MenuItems.d.ts +9 -0
- package/lib/tabs/MenuItems.js +1 -1
- package/lib/tabs/Panel.d.ts +9 -0
- package/lib/tabs/Panel.js +1 -1
- package/lib/tabs/index.d.ts +10 -0
- package/lib/tabs/tabHelpers.d.ts +21 -0
- package/lib/tabs/types.d.ts +63 -0
- package/lib/toolbar/ButtonBar.d.ts +10 -0
- package/lib/toolbar/LabelBar.d.ts +10 -0
- package/lib/toolbar/LabelBar.js +1 -1
- package/lib/toolbar/Separator.d.ts +3 -0
- package/lib/toolbar/ToolBarGroup.d.ts +10 -0
- package/lib/toolbar/helpers.d.ts +10 -0
- package/lib/toolbar/index.d.ts +14 -0
- package/lib/toolbar/index.js +2 -3
- package/lib/toolbar/types.d.ts +43 -0
- package/lib/tooltip/index.d.ts +6 -0
- package/lib/tooltip/types.d.ts +16 -0
- package/lib/treeview/Header.d.ts +7 -0
- package/lib/treeview/Node.d.ts +7 -0
- package/lib/treeview/Node.js +30 -18
- package/lib/treeview/constants.d.ts +7 -0
- package/lib/treeview/constants.js +0 -1
- package/lib/treeview/index.d.ts +9 -0
- package/lib/treeview/index.js +28 -21
- package/lib/treeview/types.d.ts +104 -0
- package/lib/types-3c6f1c20.d.ts +46 -0
- package/lib/uitour/helpers.d.ts +8 -0
- package/lib/uitour/index.d.ts +6 -0
- package/lib/uitour/index.js +11 -28
- package/lib/uitour/types.d.ts +30 -0
- package/lib/uitour/types.js +5 -0
- package/package.json +15 -5
- package/tsconfig.json +24 -9
- package/tsup.config.ts +10 -0
- package/images.d.ts +0 -3
- package/lib/alerts/alert.spec.js +0 -137
- package/lib/assets/styles/treetable.scss +0 -100
- package/lib/avatar/avatar.spec.js +0 -192
- package/lib/badge/badge.spec.js +0 -127
- package/lib/buttons/buttons.spec.js +0 -504
- package/lib/calendar/calendar.spec.js +0 -173
- package/lib/checkbox/checkbox.spec.js +0 -216
- package/lib/dialog/dialog.spec.js +0 -492
- package/lib/drawer/Drawer.spec.js +0 -261
- package/lib/dropdown/dropdown.spec.js +0 -181
- package/lib/fieldset/fieldset.spec.js +0 -329
- package/lib/form/form.spec.js +0 -295
- package/lib/gridlayout/gridLayout.spec.js +0 -169
- package/lib/icons/icons.spec.js +0 -86
- package/lib/inputs/base/base.spec.js +0 -691
- package/lib/inputs/color/color_input.spec.js +0 -174
- package/lib/inputs/date/date.spec.js +0 -352
- package/lib/inputs/mask/input_mask.spec.js +0 -584
- package/lib/inputs/number/numberfield.spec.js +0 -216
- package/lib/inputs/search/search_input.spec.js +0 -215
- package/lib/inputs/select/select.spec.js +0 -408
- package/lib/inputs/text/textfield.spec.js +0 -215
- package/lib/inputs/textarea/textarea.spec.js +0 -59
- package/lib/labelMessages/labelMessages.spec.js +0 -176
- package/lib/labels/label.spec.js +0 -162
- package/lib/list/list.spec.js +0 -739
- package/lib/menus/float/float-menu.spec.js +0 -227
- package/lib/menus/sidenav/sidenav.spec.js +0 -383
- package/lib/panel/panel.spec.js +0 -216
- package/lib/popover/popover.spec.js +0 -146
- package/lib/progress/progress.spec.js +0 -94
- package/lib/radio/radio.spec.js +0 -191
- package/lib/spinner/spinner.spec.js +0 -156
- package/lib/split/split.spec.js +0 -168
- package/lib/table/table.spec.js +0 -353
- package/lib/tabs/tabs.spec.js +0 -314
- package/lib/toolbar/toolbar.spec.js +0 -394
- package/lib/tooltip/tooltip.spec.js +0 -222
- package/lib/treetable/Body.js +0 -64
- package/lib/treetable/Header.js +0 -37
- package/lib/treetable/Row.js +0 -317
- package/lib/treetable/helpers.js +0 -51
- package/lib/treetable/index.js +0 -35
- package/lib/treeview/treeview.spec.js +0 -289
- package/lib/uitour/uitour.spec.js +0 -176
package/lib/treeview/index.js
CHANGED
|
@@ -68,7 +68,8 @@ var TreeView = function TreeView(props) {
|
|
|
68
68
|
allowCheckAllChildren = props.allowCheckAllChildren,
|
|
69
69
|
onSelectedIdsChange = props.onSelectedIdsChange,
|
|
70
70
|
idsInLoading = props.idsInLoading,
|
|
71
|
-
|
|
71
|
+
_props$startNodesOpen = props.startNodesOpened,
|
|
72
|
+
startNodesOpened = _props$startNodesOpen === void 0 ? false : _props$startNodesOpen,
|
|
72
73
|
alwaysShowArrow = props.alwaysShowArrow,
|
|
73
74
|
nodeElementsValidations = props.nodeElementsValidations,
|
|
74
75
|
nodeRightElements = props.nodeRightElements,
|
|
@@ -95,8 +96,9 @@ var TreeView = function TreeView(props) {
|
|
|
95
96
|
setCurrentSelectedIds = _useState4[1];
|
|
96
97
|
|
|
97
98
|
var _useState5 = (0, _react.useState)(selectedIds),
|
|
98
|
-
_useState6 = _slicedToArray(_useState5,
|
|
99
|
-
propSelectedIds = _useState6[0]
|
|
99
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
100
|
+
propSelectedIds = _useState6[0],
|
|
101
|
+
setPropSelectedIds = _useState6[1];
|
|
100
102
|
|
|
101
103
|
var _useState7 = (0, _react.useState)(false),
|
|
102
104
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
@@ -260,7 +262,7 @@ var TreeView = function TreeView(props) {
|
|
|
260
262
|
var remainSelectedIds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
261
263
|
var newSelectedIds = remainSelectedIds.length > 0 ? remainSelectedIds : currentSelectedIds;
|
|
262
264
|
var childrenIds = returnChildrenIds(nodeId).nodeChildrenIds;
|
|
263
|
-
newSelectedIds =
|
|
265
|
+
newSelectedIds = newSelectedIds.filter(function (selectedId) {
|
|
264
266
|
return !childrenIds.includes(selectedId);
|
|
265
267
|
});
|
|
266
268
|
setIsHandlingSelectedIds(false);
|
|
@@ -288,18 +290,18 @@ var TreeView = function TreeView(props) {
|
|
|
288
290
|
setAlreadyOpenedIds(newAlreadyOpenedIds);
|
|
289
291
|
};
|
|
290
292
|
|
|
291
|
-
var handleCheck = function handleCheck(nodeId, isParent) {
|
|
293
|
+
var handleCheck = function handleCheck(nodeId, handlingSelectedIds, isParent) {
|
|
292
294
|
var codigos = _lodash.default.isArray(nodeId) ? nodeId : [nodeId];
|
|
293
295
|
var newSelectedIds = [].concat(_toConsumableArray(currentSelectedIds), _toConsumableArray(codigos));
|
|
294
296
|
|
|
295
|
-
if (isParent && isHandlingSelectedIds && allowCheckAllChildren) {
|
|
297
|
+
if (isParent && (handlingSelectedIds || isHandlingSelectedIds) && allowCheckAllChildren) {
|
|
296
298
|
if (allowCheckAllAncestry) {
|
|
297
299
|
var _checkAllAncestry = checkAllAncestry(nodeId, codigos, true),
|
|
298
300
|
updatedIdsWithAncestryIds = _checkAllAncestry.updatedIdsWithAncestryIds,
|
|
299
301
|
requiredParents = _checkAllAncestry.requiredParentsIds;
|
|
300
302
|
|
|
301
|
-
var
|
|
302
|
-
newSelectedIds = [].concat(_toConsumableArray(updatedIdsWithAncestryIds), _toConsumableArray(
|
|
303
|
+
var updatedIdsWithChildrenIds = checkAllChildren(nodeId, true, requiredParents);
|
|
304
|
+
newSelectedIds = [].concat(_toConsumableArray(updatedIdsWithAncestryIds), _toConsumableArray(updatedIdsWithChildrenIds));
|
|
303
305
|
} else newSelectedIds = checkAllChildren(nodeId);
|
|
304
306
|
} else if (allowCheckAllAncestry) {
|
|
305
307
|
newSelectedIds = checkAllAncestry(nodeId, codigos).updatedIdsWithAncestryIds;
|
|
@@ -308,13 +310,13 @@ var TreeView = function TreeView(props) {
|
|
|
308
310
|
return newSelectedIds;
|
|
309
311
|
};
|
|
310
312
|
|
|
311
|
-
var handleUncheck = function handleUncheck(nodeId, isParent, required) {
|
|
313
|
+
var handleUncheck = function handleUncheck(nodeId, handlingSelectedIds, isParent, required) {
|
|
312
314
|
var codigos = _lodash.default.isArray(nodeId) ? nodeId : [nodeId];
|
|
313
315
|
var newSelectedIds = currentSelectedIds.filter(function (id) {
|
|
314
316
|
return !codigos.includes(id);
|
|
315
317
|
});
|
|
316
318
|
|
|
317
|
-
if (isParent && isHandlingSelectedIds && allowCheckAllChildren) {
|
|
319
|
+
if (isParent && (handlingSelectedIds || isHandlingSelectedIds) && allowCheckAllChildren) {
|
|
318
320
|
if (allowCheckAllAncestry) {
|
|
319
321
|
var updatedSelectedIds = updateAncestryAndSelectedIds(nodeId, codigos, requiredParentsIds);
|
|
320
322
|
newSelectedIds = uncheckAllChildren(nodeId, updatedSelectedIds);
|
|
@@ -329,13 +331,14 @@ var TreeView = function TreeView(props) {
|
|
|
329
331
|
|
|
330
332
|
var updateSelectedIds = function updateSelectedIds(nodeId, checked, isParent) {
|
|
331
333
|
var required = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
334
|
+
var handlingSelectedIds = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : isHandlingSelectedIds;
|
|
332
335
|
|
|
333
336
|
var newSelectedIds = _toConsumableArray(currentSelectedIds);
|
|
334
337
|
|
|
335
338
|
if (checked) {
|
|
336
|
-
newSelectedIds = handleCheck(nodeId, isParent);
|
|
339
|
+
newSelectedIds = handleCheck(nodeId, handlingSelectedIds, isParent);
|
|
337
340
|
} else {
|
|
338
|
-
newSelectedIds = handleUncheck(nodeId, isParent, required);
|
|
341
|
+
newSelectedIds = handleUncheck(nodeId, handlingSelectedIds, isParent, required);
|
|
339
342
|
}
|
|
340
343
|
|
|
341
344
|
setCurrentSelectedIds(newSelectedIds);
|
|
@@ -345,7 +348,7 @@ var TreeView = function TreeView(props) {
|
|
|
345
348
|
var toggleCheckChildren = function toggleCheckChildren(nodeId, check) {
|
|
346
349
|
var required = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
347
350
|
setIsHandlingSelectedIds(true);
|
|
348
|
-
updateSelectedIds(nodeId, check, true, required);
|
|
351
|
+
updateSelectedIds(nodeId, check, true, required, true);
|
|
349
352
|
};
|
|
350
353
|
|
|
351
354
|
var buildTree = function buildTree(node, parentId, ids) {
|
|
@@ -367,7 +370,7 @@ var TreeView = function TreeView(props) {
|
|
|
367
370
|
key: "node-".concat(node.id),
|
|
368
371
|
node: node,
|
|
369
372
|
idsInLoading: idsInLoading,
|
|
370
|
-
startNodesOpened:
|
|
373
|
+
startNodesOpened: startNodesOpened,
|
|
371
374
|
alwaysShowArrow: alwaysShowArrow,
|
|
372
375
|
childrenIds: childrenIds,
|
|
373
376
|
isParent: node.itens && node.itens.length > 0,
|
|
@@ -406,21 +409,25 @@ var TreeView = function TreeView(props) {
|
|
|
406
409
|
};
|
|
407
410
|
|
|
408
411
|
(0, _react.useEffect)(function () {
|
|
409
|
-
var isSameSelectedIds = _lodash.default.isEqual(
|
|
412
|
+
var isSameSelectedIds = _lodash.default.isEqual(propSelectedIds.sort(), selectedIds.sort());
|
|
410
413
|
|
|
411
|
-
if (enableDynamicData && data !==
|
|
414
|
+
if (enableDynamicData && props.data !== data) {
|
|
412
415
|
setData(props.data);
|
|
413
416
|
} else if (!isSameSelectedIds) {
|
|
414
417
|
setCurrentSelectedIds(selectedIds);
|
|
418
|
+
setPropSelectedIds(selectedIds);
|
|
415
419
|
}
|
|
416
420
|
}, [selectedIds.length, props.data]);
|
|
417
421
|
(0, _react.useEffect)(function () {
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
+
if (allowCheckAllAncestry && !selectedIdsUpdatedOnMount) {
|
|
423
|
+
handleNewSelectedIds(currentSelectedIds);
|
|
424
|
+
}
|
|
425
|
+
}, [currentSelectedIds]);
|
|
426
|
+
(0, _react.useEffect)(function () {
|
|
427
|
+
if (allowCheckAllAncestry) {
|
|
428
|
+
handleNewSelectedIds(currentSelectedIds);
|
|
422
429
|
}
|
|
423
|
-
}, [
|
|
430
|
+
}, [propSelectedIds]);
|
|
424
431
|
(0, _react.useEffect)(function () {
|
|
425
432
|
buildTree(data, undefined, idsWithChildren);
|
|
426
433
|
}, []);
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { ReactNode, CSSProperties, ReactElement } from 'react';
|
|
2
|
+
import { Size } from '../@types/Size.js';
|
|
3
|
+
|
|
4
|
+
declare type NodeItem<T = void> = T & {
|
|
5
|
+
id: number;
|
|
6
|
+
itens?: NodeItem<T>[];
|
|
7
|
+
statusEnum?: {
|
|
8
|
+
id: number | string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
interface IValidator<T = void> {
|
|
12
|
+
validator: (node: NodeItem<T>) => boolean;
|
|
13
|
+
applyBehavior?: 'unvisible' | 'disabled';
|
|
14
|
+
}
|
|
15
|
+
interface INodeElementsValidations<T = void> {
|
|
16
|
+
[key: string]: IValidator<T>[];
|
|
17
|
+
}
|
|
18
|
+
interface INodeValidationProps {
|
|
19
|
+
validationKey: string | null;
|
|
20
|
+
onNodeElementClick: (node: any) => void;
|
|
21
|
+
visible: boolean;
|
|
22
|
+
}
|
|
23
|
+
interface ITreeviewProps {
|
|
24
|
+
data: object;
|
|
25
|
+
valuePropName: string;
|
|
26
|
+
labelPropName: string;
|
|
27
|
+
parentPropName: string;
|
|
28
|
+
customClass?: string;
|
|
29
|
+
bordered?: boolean;
|
|
30
|
+
startNodesOpened?: boolean;
|
|
31
|
+
alwaysShowArrow?: boolean;
|
|
32
|
+
selectedIds?: number[];
|
|
33
|
+
requiredIds?: number[] | string[];
|
|
34
|
+
showCheckBox?: boolean;
|
|
35
|
+
onSelectedIdsChange?: (value: any) => void;
|
|
36
|
+
children?: ReactNode;
|
|
37
|
+
styleForContainer?: CSSProperties;
|
|
38
|
+
allowCheckAllChildren?: boolean;
|
|
39
|
+
allowCheckAllAncestry?: boolean;
|
|
40
|
+
defaultDisabledTooltip?: string;
|
|
41
|
+
nodeRightElements?: ReactElement<INodeValidationProps>[];
|
|
42
|
+
nodeToolbarElements?: ReactElement<INodeValidationProps>[];
|
|
43
|
+
nodeMenuButtonSize?: Size;
|
|
44
|
+
onNodeClick?: () => void;
|
|
45
|
+
onNodeOpen?: (value: any) => void;
|
|
46
|
+
nodeElementsValidations?: INodeElementsValidations<any>;
|
|
47
|
+
enableDynamicData?: boolean;
|
|
48
|
+
idsInLoading?: number[];
|
|
49
|
+
selectedNodeId?: number;
|
|
50
|
+
}
|
|
51
|
+
interface ITreeNodeProps {
|
|
52
|
+
node: any;
|
|
53
|
+
children: ReactNode;
|
|
54
|
+
startNodesOpened: boolean;
|
|
55
|
+
childrenIds?: number[];
|
|
56
|
+
parentId?: number;
|
|
57
|
+
disabled?: boolean;
|
|
58
|
+
isParent?: boolean;
|
|
59
|
+
alwaysShowArrow?: boolean;
|
|
60
|
+
nodeRightElements?: ReactElement<INodeValidationProps>[];
|
|
61
|
+
nodeToolbarElements?: ReactElement<INodeValidationProps>[];
|
|
62
|
+
nodeMenuButtonSize?: Size;
|
|
63
|
+
onNodeClick?: (node: any) => void;
|
|
64
|
+
handlerOnNodeOpen?: (node: any) => void;
|
|
65
|
+
nodeElementsValidations?: INodeElementsValidations;
|
|
66
|
+
idsInLoading?: number[];
|
|
67
|
+
selectedNodeId?: number;
|
|
68
|
+
}
|
|
69
|
+
interface ITreeHeaderProps {
|
|
70
|
+
title?: string;
|
|
71
|
+
customClass?: string;
|
|
72
|
+
children?: ReactNode;
|
|
73
|
+
}
|
|
74
|
+
interface ITreeViewContext extends ITreeviewProps {
|
|
75
|
+
requiredIds: number[] | string[];
|
|
76
|
+
selectedIds?: number[];
|
|
77
|
+
isHandlingSelectedIds: boolean;
|
|
78
|
+
selectedIdsUpdatedOnMount: boolean;
|
|
79
|
+
requiredParentsIds: number[] | string[];
|
|
80
|
+
alreadyOpenedIds: number[];
|
|
81
|
+
handlerUpdateSelectedIds: (nodeId: number, checked: boolean, isParent: boolean, required?: boolean, handling?: boolean) => void;
|
|
82
|
+
handlerToggleCheckChildren: (nodeId: number, check: boolean, required?: boolean) => void;
|
|
83
|
+
disabled?: boolean;
|
|
84
|
+
}
|
|
85
|
+
declare type ItensMock = {
|
|
86
|
+
id?: number;
|
|
87
|
+
titulo: string;
|
|
88
|
+
codigo: string;
|
|
89
|
+
permissoes?: {
|
|
90
|
+
codigo: string;
|
|
91
|
+
}[];
|
|
92
|
+
itens: ItensMock[];
|
|
93
|
+
};
|
|
94
|
+
interface IDataMock {
|
|
95
|
+
id: number;
|
|
96
|
+
titulo: string;
|
|
97
|
+
codigo: string;
|
|
98
|
+
permissoes: {
|
|
99
|
+
codigo: string;
|
|
100
|
+
}[];
|
|
101
|
+
itens: ItensMock[];
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export { IDataMock, INodeElementsValidations, INodeValidationProps, ITreeHeaderProps, ITreeNodeProps, ITreeViewContext, ITreeviewProps, IValidator, NodeItem };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React__default, { ReactNode, ReactElement } from 'react';
|
|
2
|
+
import { PermissionAttr } from './@types/PermissionAttr.js';
|
|
3
|
+
import ColorStyles from './internals/colorStyles.js';
|
|
4
|
+
|
|
5
|
+
declare function numberAroundZeroAndOne({ props, propName, componentName }: IParameterFunction): Error | null;
|
|
6
|
+
declare const PanelContext: React__default.Context<ContextProps>;
|
|
7
|
+
|
|
8
|
+
interface IPanelProps {
|
|
9
|
+
customClass?: string;
|
|
10
|
+
startOpened?: boolean;
|
|
11
|
+
toggleable?: boolean;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
style?: object;
|
|
14
|
+
colorStyle?: typeof ColorStyles | '' | string;
|
|
15
|
+
gridCols?: string;
|
|
16
|
+
title?: string;
|
|
17
|
+
onEndReached?: () => void;
|
|
18
|
+
onEndReachedThreshold?: typeof numberAroundZeroAndOne | number;
|
|
19
|
+
permissionAttr?: PermissionAttr | PermissionAttr[];
|
|
20
|
+
}
|
|
21
|
+
interface IPanelHeaderProps {
|
|
22
|
+
title?: string;
|
|
23
|
+
children?: ReactElement;
|
|
24
|
+
icon?: ReactElement;
|
|
25
|
+
titleIcon?: string;
|
|
26
|
+
customClass?: string;
|
|
27
|
+
style?: object;
|
|
28
|
+
styleForTitle?: object;
|
|
29
|
+
customClassForTitle?: string;
|
|
30
|
+
headerColored?: boolean;
|
|
31
|
+
}
|
|
32
|
+
declare type ContextProps = {
|
|
33
|
+
toggleable: boolean;
|
|
34
|
+
handlerToggleable: () => void;
|
|
35
|
+
opened: boolean;
|
|
36
|
+
hideContent: boolean;
|
|
37
|
+
onEndReached?: () => void;
|
|
38
|
+
onEndReachedThreshold: number;
|
|
39
|
+
};
|
|
40
|
+
interface IParameterFunction {
|
|
41
|
+
props: any;
|
|
42
|
+
propName: string | number;
|
|
43
|
+
componentName: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export { ContextProps as C, IPanelProps as I, PanelContext as P, IPanelHeaderProps as a, IParameterFunction as b, numberAroundZeroAndOne as n };
|
package/lib/uitour/index.js
CHANGED
|
@@ -9,16 +9,12 @@ 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 _buttons = _interopRequireWildcard(require("../buttons"));
|
|
15
13
|
|
|
16
14
|
require("../assets/styles/uitour.scss");
|
|
17
15
|
|
|
18
16
|
var _helpers = require("./helpers");
|
|
19
17
|
|
|
20
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
18
|
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
19
|
|
|
24
20
|
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; }
|
|
@@ -42,9 +38,12 @@ var UiTour = function UiTour(props) {
|
|
|
42
38
|
nextButtonLabel = props.nextButtonLabel,
|
|
43
39
|
backButtonLabel = props.backButtonLabel,
|
|
44
40
|
finishButtonLabel = props.finishButtonLabel,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
_props$showCloseButto = props.showCloseButton,
|
|
42
|
+
showCloseButton = _props$showCloseButto === void 0 ? true : _props$showCloseButto,
|
|
43
|
+
_props$showBackButton = props.showBackButton,
|
|
44
|
+
showBackButton = _props$showBackButton === void 0 ? true : _props$showBackButton,
|
|
45
|
+
_props$visible = props.visible,
|
|
46
|
+
visible = _props$visible === void 0 ? true : _props$visible,
|
|
48
47
|
onFinish = props.onFinish;
|
|
49
48
|
|
|
50
49
|
var _useState = (0, _react.useState)(undefined),
|
|
@@ -82,13 +81,13 @@ var UiTour = function UiTour(props) {
|
|
|
82
81
|
stepPosition = _useState14[0],
|
|
83
82
|
setStepPosition = _useState14[1];
|
|
84
83
|
|
|
85
|
-
var stepRef = (0, _react.useRef)();
|
|
86
|
-
var descriptionRef = (0, _react.useRef)();
|
|
84
|
+
var stepRef = (0, _react.useRef)(null);
|
|
85
|
+
var descriptionRef = (0, _react.useRef)(null);
|
|
87
86
|
|
|
88
87
|
var handleNextStep = function handleNextStep() {
|
|
89
88
|
if (hasNextStep) {
|
|
90
89
|
var currentStepIndex = data.findIndex(function (item) {
|
|
91
|
-
return item.id === currentStep.id;
|
|
90
|
+
return item.id === (currentStep === null || currentStep === void 0 ? void 0 : currentStep.id);
|
|
92
91
|
});
|
|
93
92
|
var nextStep = data[currentStepIndex + 1];
|
|
94
93
|
var nextStepIndex = data.findIndex(function (item) {
|
|
@@ -107,7 +106,7 @@ var UiTour = function UiTour(props) {
|
|
|
107
106
|
var handleBackStep = function handleBackStep() {
|
|
108
107
|
if (hasBackStep) {
|
|
109
108
|
var currentStepIndex = data.findIndex(function (item) {
|
|
110
|
-
return item.id === currentStep.id;
|
|
109
|
+
return item.id === (currentStep === null || currentStep === void 0 ? void 0 : currentStep.id);
|
|
111
110
|
});
|
|
112
111
|
var backStep = data[currentStepIndex - 1];
|
|
113
112
|
var backStepIndex = data.findIndex(function (item) {
|
|
@@ -133,7 +132,7 @@ var UiTour = function UiTour(props) {
|
|
|
133
132
|
var stepRect = stepRef.current.getBoundingClientRect();
|
|
134
133
|
var windowWidth = window.innerWidth;
|
|
135
134
|
|
|
136
|
-
if (stepRect.right >= windowWidth || currentStep.position === _helpers.STEP_POSITIONS.right) {
|
|
135
|
+
if (stepRect.right >= windowWidth || (currentStep === null || currentStep === void 0 ? void 0 : currentStep.position) === _helpers.STEP_POSITIONS.right) {
|
|
137
136
|
setStepPosition(_helpers.STEP_POSITIONS.right);
|
|
138
137
|
setStepDimensions({
|
|
139
138
|
top: target.top - _helpers.ARROW_HEIGHT,
|
|
@@ -251,21 +250,5 @@ var UiTour = function UiTour(props) {
|
|
|
251
250
|
}))));
|
|
252
251
|
};
|
|
253
252
|
|
|
254
|
-
UiTour.propTypes = {
|
|
255
|
-
data: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
|
|
256
|
-
nextButtonLabel: _propTypes.default.string.isRequired,
|
|
257
|
-
backButtonLabel: _propTypes.default.string.isRequired,
|
|
258
|
-
finishButtonLabel: _propTypes.default.string.isRequired,
|
|
259
|
-
showCloseButton: _propTypes.default.bool,
|
|
260
|
-
showBackButton: _propTypes.default.bool,
|
|
261
|
-
visible: _propTypes.default.bool,
|
|
262
|
-
onFinish: _propTypes.default.func
|
|
263
|
-
};
|
|
264
|
-
UiTour.defaultProps = {
|
|
265
|
-
showCloseButton: true,
|
|
266
|
-
showBackButton: true,
|
|
267
|
-
visible: true,
|
|
268
|
-
onFinish: undefined
|
|
269
|
-
};
|
|
270
253
|
var _default = UiTour;
|
|
271
254
|
exports.default = _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { STEP_POSITIONS } from './helpers.js';
|
|
2
|
+
|
|
3
|
+
declare type UITourData = {
|
|
4
|
+
id: string | number;
|
|
5
|
+
targetId: string;
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
position?: keyof typeof STEP_POSITIONS;
|
|
9
|
+
};
|
|
10
|
+
interface CurrentStep extends UITourData {
|
|
11
|
+
number: number;
|
|
12
|
+
}
|
|
13
|
+
interface StepDimensions {
|
|
14
|
+
top?: number;
|
|
15
|
+
left?: number;
|
|
16
|
+
right?: number;
|
|
17
|
+
bottom?: number;
|
|
18
|
+
}
|
|
19
|
+
interface IUITourProps {
|
|
20
|
+
data: UITourData[];
|
|
21
|
+
nextButtonLabel: string;
|
|
22
|
+
backButtonLabel: string;
|
|
23
|
+
finishButtonLabel: string;
|
|
24
|
+
showCloseButton?: boolean;
|
|
25
|
+
showBackButton?: boolean;
|
|
26
|
+
visible?: boolean;
|
|
27
|
+
onFinish: (value: boolean) => void;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { CurrentStep, IUITourProps, StepDimensions, UITourData };
|
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "linear-react-components-ui",
|
|
3
|
-
"version": "0.4.77-beta.
|
|
3
|
+
"version": "0.4.77-beta.27",
|
|
4
4
|
"description": "Linear Sistemas ReactJs Components",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
|
+
"module": "lib/index.cjs",
|
|
6
7
|
"scripts": {
|
|
7
|
-
"lib": "babel src/lib/ -d lib/ --extensions \".js,.jsx,.ts,.tsx\" && babel src/lib/assets -d lib/assets --copy-files",
|
|
8
|
+
"lib": "babel src/lib/ -d lib/ --extensions \".js,.jsx,.ts,.tsx\" --ignore **/*.spec.tsx && babel src/lib/assets -d lib/assets --copy-files && npm run lib:types",
|
|
9
|
+
"lib:types": "tsup --dts-only --dts --external react",
|
|
8
10
|
"lib:watch": "babel src/lib -w -d lib/ ",
|
|
9
11
|
"demo": "node scripts/start.js",
|
|
10
12
|
"demo:prod": "webpack -p",
|
|
@@ -33,6 +35,8 @@
|
|
|
33
35
|
"@babel/preset-env": "^7.0.0-beta.36",
|
|
34
36
|
"@babel/preset-react": "^7.0.0-beta.36",
|
|
35
37
|
"@babel/preset-typescript": "^7.16.7",
|
|
38
|
+
"@es-pack/esbuild-sass-plugin": "^2.0.1",
|
|
39
|
+
"@swc/core": "^1.3.14",
|
|
36
40
|
"@testing-library/jest-dom": "^5.14.1",
|
|
37
41
|
"@testing-library/react": "^12.0.0",
|
|
38
42
|
"@types/lodash": "^4.14.182",
|
|
@@ -41,14 +45,19 @@
|
|
|
41
45
|
"@types/react-dev-utils": "^9.0.10",
|
|
42
46
|
"@types/react-dom": "^18.0.5",
|
|
43
47
|
"@types/react-router-dom": "^5.3.3",
|
|
48
|
+
"@types/react-syntax-highlighter": "^15.5.5",
|
|
49
|
+
"@types/react-transition-group": "^4.4.5",
|
|
44
50
|
"@types/uuid": "^8.3.4",
|
|
45
51
|
"@typescript-eslint/eslint-plugin": "^5.23.0",
|
|
46
52
|
"@typescript-eslint/parser": "^5.23.0",
|
|
47
53
|
"babel-eslint": "^7.2.3",
|
|
48
54
|
"babel-jest": "^27.0.5",
|
|
49
|
-
"babel-loader": "^
|
|
55
|
+
"babel-loader": "^9.1.0",
|
|
50
56
|
"babel-polyfill": "^6.26.0",
|
|
51
57
|
"css-loader": "^0.28.8",
|
|
58
|
+
"esbuild": "^0.15.13",
|
|
59
|
+
"esbuild-plugin-babel": "^0.2.3",
|
|
60
|
+
"esbuild-plugin-sass": "^1.0.1",
|
|
52
61
|
"eslint": "^8.15.0",
|
|
53
62
|
"eslint-config-airbnb": "16.1.0",
|
|
54
63
|
"eslint-config-airbnb-typescript": "^17.0.0",
|
|
@@ -66,6 +75,7 @@
|
|
|
66
75
|
"react-dom": "^16.14.0",
|
|
67
76
|
"react-transition-group": "^4.3.0",
|
|
68
77
|
"style-loader": "^0.23.1",
|
|
78
|
+
"tsup": "^6.4.0",
|
|
69
79
|
"typescript": "^4.6.4"
|
|
70
80
|
},
|
|
71
81
|
"author": "Deivisson Bruno <deivisson.bruno@linearsistemas.com.br>",
|
|
@@ -83,11 +93,11 @@
|
|
|
83
93
|
"init": "^0.1.2",
|
|
84
94
|
"lodash": "^4.17.21",
|
|
85
95
|
"moment": "^2.29.1",
|
|
86
|
-
"node-sass": "^4.13.0",
|
|
87
96
|
"prop-types": "^15.7.2",
|
|
88
97
|
"react-dev-utils": "^12.0.0",
|
|
89
98
|
"react-router-dom": "^5.1.2",
|
|
90
|
-
"react-syntax-highlighter": "^
|
|
99
|
+
"react-syntax-highlighter": "^15.5.0",
|
|
100
|
+
"sass": "^1.56.0",
|
|
91
101
|
"sass-loader": "^7.3.1",
|
|
92
102
|
"semver": "^7.3.5",
|
|
93
103
|
"uuid": "^3.3.3",
|
package/tsconfig.json
CHANGED
|
@@ -1,17 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"lib": ["dom", "dom.iterable", "esnext"],
|
|
4
3
|
"allowJs": true,
|
|
5
|
-
"jsx": "react-jsx",
|
|
6
|
-
"noEmit": true,
|
|
7
|
-
"isolatedModules": true,
|
|
8
|
-
"resolveJsonModule": true,
|
|
9
|
-
"moduleResolution": "node",
|
|
10
4
|
"allowSyntheticDefaultImports": true,
|
|
5
|
+
"baseUrl": ".",
|
|
6
|
+
"declaration": true,
|
|
11
7
|
"esModuleInterop": true,
|
|
12
|
-
"strict": true,
|
|
13
|
-
"skipLibCheck": true,
|
|
14
8
|
"forceConsistentCasingInFileNames": true,
|
|
9
|
+
"isolatedModules": true,
|
|
10
|
+
"jsx": "react",
|
|
11
|
+
"lib": [
|
|
12
|
+
"dom",
|
|
13
|
+
"dom.iterable",
|
|
14
|
+
"esnext"
|
|
15
|
+
],
|
|
16
|
+
"moduleResolution": "node",
|
|
17
|
+
"resolveJsonModule": true,
|
|
18
|
+
"skipLibCheck": true,
|
|
19
|
+
"sourceMap": true,
|
|
20
|
+
"strict": true,
|
|
21
|
+
"target": "es2018"
|
|
15
22
|
},
|
|
16
|
-
"
|
|
23
|
+
"exclude": [
|
|
24
|
+
"!node_modules/@types",
|
|
25
|
+
"node_modules",
|
|
26
|
+
"src/**/*.spec.ts",
|
|
27
|
+
"src/**/*.test.ts"
|
|
28
|
+
],
|
|
29
|
+
"include": ["src/**/*"],
|
|
30
|
+
"typeRoots": ["./node_modules/@types"],
|
|
31
|
+
"types": ["node"]
|
|
17
32
|
}
|
package/tsup.config.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/* eslint-disable no-param-reassign */
|
|
2
|
+
/* eslint-disable import/no-extraneous-dependencies */
|
|
3
|
+
import { defineConfig } from 'tsup';
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
entry: ['src/lib/**/!(*.d|*.spec).ts*'],
|
|
7
|
+
external: ['react', 'sass'],
|
|
8
|
+
clean: true,
|
|
9
|
+
outDir: 'lib',
|
|
10
|
+
});
|
package/images.d.ts
DELETED