@boomerang-io/carbon-addons-boomerang-react 4.6.14-beta.12 → 4.6.14-beta.13
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/dist/cjs/{src/components → components}/Creatable/Creatable.js +6 -6
- package/dist/esm/{src/components → components}/Creatable/Creatable.js +2 -2
- package/package.json +3 -1
- package/dist/cjs/node_modules/.pnpm/@dnd-kit_sortable@8.0.0_@dnd-kit_core@6.3.1_react-dom@16.14.0_react@16.14.0__react@16.14.0__react@16.14.0/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +0 -538
- package/dist/cjs/node_modules/.pnpm/@dnd-kit_utilities@3.2.2_react@16.14.0/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +0 -138
- package/dist/esm/node_modules/.pnpm/@dnd-kit_sortable@8.0.0_@dnd-kit_core@6.3.1_react-dom@16.14.0_react@16.14.0__react@16.14.0__react@16.14.0/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +0 -526
- package/dist/esm/node_modules/.pnpm/@dnd-kit_utilities@3.2.2_react@16.14.0/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +0 -128
- /package/dist/cjs/{src/components → components}/AboutPlatform/AboutPlatform.js +0 -0
- /package/dist/cjs/{src/components → components}/AdvantageSideNav/AdvantageSideNav.js +0 -0
- /package/dist/cjs/{src/components → components}/AutoSuggest/AutoSuggest.js +0 -0
- /package/dist/cjs/{src/components → components}/Avatar/Avatar.js +0 -0
- /package/dist/cjs/{src/components → components}/CheckboxList/CheckboxList.js +0 -0
- /package/dist/cjs/{src/components → components}/ComboBox/ComboBox.js +0 -0
- /package/dist/cjs/{src/components → components}/ComboBoxMultiSelect/ComboBoxMultiSelect.js +0 -0
- /package/dist/cjs/{src/components → components}/ComboBoxMultiSelect/MultiSelect.js +0 -0
- /package/dist/cjs/{src/components → components}/ComposedModal/ComposedModal.js +0 -0
- /package/dist/cjs/{src/components → components}/ConfirmModal/ConfirmModal.js +0 -0
- /package/dist/cjs/{src/components → components}/DataDrivenInput/DataDrivenInput.js +0 -0
- /package/dist/cjs/{src/components → components}/DateInput/DateInput.js +0 -0
- /package/dist/cjs/{src/components → components}/DecisionButtons/DecisionButtons.js +0 -0
- /package/dist/cjs/{src/components → components}/DelayedRender/DelayedRender.js +0 -0
- /package/dist/cjs/{src/components → components}/DynamicFormik/DynamicFormik.js +0 -0
- /package/dist/cjs/{src/components → components}/Error403/Error403.js +0 -0
- /package/dist/cjs/{src/components → components}/Error403/ForbiddenErrorBackground.js +0 -0
- /package/dist/cjs/{src/components → components}/Error403/GraphicWrangler/GraphicWrangler.js +0 -0
- /package/dist/cjs/{src/components → components}/Error404/Error404.js +0 -0
- /package/dist/cjs/{src/components → components}/Error404/GraphicLoch/GraphicLoch.js +0 -0
- /package/dist/cjs/{src/components → components}/Error404/NotFoundErrorBackground.js +0 -0
- /package/dist/cjs/{src/components → components}/ErrorBoundary/ErrorBoundary.js +0 -0
- /package/dist/cjs/{src/components → components}/ErrorDragon/ErrorDragon.js +0 -0
- /package/dist/cjs/{src/components → components}/ErrorDragon/assets/ErrorGraphic.js +0 -0
- /package/dist/cjs/{src/components → components}/ErrorFullPage/ErrorFullPage.js +0 -0
- /package/dist/cjs/{src/components → components}/ErrorMessage/ErrorMessage.js +0 -0
- /package/dist/cjs/{src/components → components}/ErrorPage/ErrorPage.js +0 -0
- /package/dist/cjs/{src/components → components}/ErrorPageCore/ErrorPageCore.js +0 -0
- /package/dist/cjs/{src/components → components}/ErrorPageCore/GenericErrorBackground.js +0 -0
- /package/dist/cjs/{src/components → components}/FeatureHeader/FeatureHeader.js +0 -0
- /package/dist/cjs/{src/components → components}/FeatureNavTab/FeatureNavTab.js +0 -0
- /package/dist/cjs/{src/components → components}/FeatureNavTabs/FeatureNavTabs.js +0 -0
- /package/dist/cjs/{src/components → components}/FeatureSideNav/FeatureSideNav.js +0 -0
- /package/dist/cjs/{src/components → components}/FeatureSideNav/FeatureSideNavFooter.js +0 -0
- /package/dist/cjs/{src/components → components}/FeatureSideNav/FeatureSideNavHeader.js +0 -0
- /package/dist/cjs/{src/components → components}/FeatureSideNav/FeatureSideNavLinks.js +0 -0
- /package/dist/cjs/{src/components → components}/FeatureSideNavLink/FeatureSideNavLink.js +0 -0
- /package/dist/cjs/{src/components → components}/Feedback/Feedback.js +0 -0
- /package/dist/cjs/{src/components → components}/FlowModal/FlowModal.js +0 -0
- /package/dist/cjs/{src/components → components}/FlowModal/FlowModalForm.js +0 -0
- /package/dist/cjs/{src/components → components}/Header/Header.js +0 -0
- /package/dist/cjs/{src/components → components}/Header/HeaderAppSwitcher.js +0 -0
- /package/dist/cjs/{src/components → components}/Header/HeaderMenu.js +0 -0
- /package/dist/cjs/{src/components → components}/Header/HeaderMenuItem.js +0 -0
- /package/dist/cjs/{src/components → components}/Header/HeaderTeamSwitcher.js +0 -0
- /package/dist/cjs/{src/components → components}/Header/UserRequests.js +0 -0
- /package/dist/cjs/{src/components → components}/ImageModal/ImageModal.js +0 -0
- /package/dist/cjs/{src/components → components}/Loading/Loading.js +0 -0
- /package/dist/cjs/{src/components → components}/MemberBar/MemberBar.js +0 -0
- /package/dist/cjs/{src/components → components}/Modal/Modal.js +0 -0
- /package/dist/cjs/{src/components → components}/ModalConfirmEdit/ModalConfirmArray.js +0 -0
- /package/dist/cjs/{src/components → components}/ModalConfirmEdit/ModalConfirmDetails.js +0 -0
- /package/dist/cjs/{src/components → components}/ModalConfirmEdit/ModalConfirmEdit.js +0 -0
- /package/dist/cjs/{src/components → components}/ModalForm/ModalForm.js +0 -0
- /package/dist/cjs/{src/components → components}/Notifications/NotificationsContainer.js +0 -0
- /package/dist/cjs/{src/components → components}/Notifications/ToastNotification.js +0 -0
- /package/dist/cjs/{src/components → components}/Notifications/notify.js +0 -0
- /package/dist/cjs/{src/components → components}/PlatformBanner/PlatformBanner.js +0 -0
- /package/dist/cjs/{src/components → components}/PlatformNotifications/PlatformNotification.js +0 -0
- /package/dist/cjs/{src/components → components}/PlatformNotifications/PlatformNotificationsContainer.js +0 -0
- /package/dist/cjs/{src/components → components}/Portal/Portal.js +0 -0
- /package/dist/cjs/{src/components → components}/PrivacyRedirect/PrivacyRedirect.js +0 -0
- /package/dist/cjs/{src/components → components}/PrivacyStatement/PrivacyStatement.js +0 -0
- /package/dist/cjs/{src/components → components}/ProfileSettings/ProfileSettings.js +0 -0
- /package/dist/cjs/{src/components → components}/ProtectedRoute/ProtectedRoute.js +0 -0
- /package/dist/cjs/{src/components → components}/RadioGroup/RadioGroup.js +0 -0
- /package/dist/cjs/{src/components → components}/RichTextArea/RichTextArea.js +0 -0
- /package/dist/cjs/{src/components → components}/SignOut/SignOut.js +0 -0
- /package/dist/cjs/{src/components → components}/SupportCenter/SupportCenter.js +0 -0
- /package/dist/cjs/{src/components → components}/TextArea/TextArea.js +0 -0
- /package/dist/cjs/{src/components → components}/TextInput/TextInput.js +0 -0
- /package/dist/cjs/{src/components → components}/Toggle/Toggle.js +0 -0
- /package/dist/cjs/{src/components → components}/TooltipHover/TooltipHover.js +0 -0
- /package/dist/cjs/{src/components → components}/UIShell/UIShell.js +0 -0
- /package/dist/cjs/{src/config → config}/servicesConfig.js +0 -0
- /package/dist/cjs/{src/constants → constants}/DataDrivenInputTypes.js +0 -0
- /package/dist/cjs/{src/constants → constants}/TeamTypes.js +0 -0
- /package/dist/cjs/{src/constants → constants}/UserType.js +0 -0
- /package/dist/cjs/{src/hooks → hooks}/useHeaderMenu.js +0 -0
- /package/dist/cjs/{src/hooks → hooks}/usePortal.js +0 -0
- /package/dist/cjs/{src/hooks → hooks}/useWindowSize.js +0 -0
- /package/dist/cjs/{src/index.js → index.js} +0 -0
- /package/dist/cjs/{src/internal → internal}/ListBox/ListBox.js +0 -0
- /package/dist/cjs/{src/internal → internal}/ListBox/ListBoxField.js +0 -0
- /package/dist/cjs/{src/internal → internal}/ListBox/ListBoxMenu.js +0 -0
- /package/dist/cjs/{src/internal → internal}/ListBox/ListBoxMenuIcon.js +0 -0
- /package/dist/cjs/{src/internal → internal}/ListBox/ListBoxMenuItem.js +0 -0
- /package/dist/cjs/{src/internal → internal}/ListBox/ListBoxSelection.js +0 -0
- /package/dist/cjs/{src/internal → internal}/ListBox/index.js +0 -0
- /package/dist/cjs/{src/internal → internal}/keyboard/keys.js +0 -0
- /package/dist/cjs/{src/internal → internal}/keyboard/match.js +0 -0
- /package/dist/cjs/{src/internal → internal}/settings.js +0 -0
- /package/dist/cjs/{src/tools → tools}/accessibility.js +0 -0
- /package/dist/cjs/{src/tools → tools}/createPropAdapter.js +0 -0
- /package/dist/cjs/{src/tools → tools}/isUrl.js +0 -0
- /package/dist/cjs/{src/tools → tools}/setupGetInstanceId.js +0 -0
- /package/dist/cjs/{src/tools → tools}/useSetState.js +0 -0
- /package/dist/cjs/{src/tools → tools}/yupAst/astGenerator.js +0 -0
- /package/dist/cjs/{src/tools → tools}/yupAst/customValidators.js +0 -0
- /package/dist/esm/{src/components → components}/AboutPlatform/AboutPlatform.js +0 -0
- /package/dist/esm/{src/components → components}/AdvantageSideNav/AdvantageSideNav.js +0 -0
- /package/dist/esm/{src/components → components}/AutoSuggest/AutoSuggest.js +0 -0
- /package/dist/esm/{src/components → components}/Avatar/Avatar.js +0 -0
- /package/dist/esm/{src/components → components}/CheckboxList/CheckboxList.js +0 -0
- /package/dist/esm/{src/components → components}/ComboBox/ComboBox.js +0 -0
- /package/dist/esm/{src/components → components}/ComboBoxMultiSelect/ComboBoxMultiSelect.js +0 -0
- /package/dist/esm/{src/components → components}/ComboBoxMultiSelect/MultiSelect.js +0 -0
- /package/dist/esm/{src/components → components}/ComposedModal/ComposedModal.js +0 -0
- /package/dist/esm/{src/components → components}/ConfirmModal/ConfirmModal.js +0 -0
- /package/dist/esm/{src/components → components}/DataDrivenInput/DataDrivenInput.js +0 -0
- /package/dist/esm/{src/components → components}/DateInput/DateInput.js +0 -0
- /package/dist/esm/{src/components → components}/DecisionButtons/DecisionButtons.js +0 -0
- /package/dist/esm/{src/components → components}/DelayedRender/DelayedRender.js +0 -0
- /package/dist/esm/{src/components → components}/DynamicFormik/DynamicFormik.js +0 -0
- /package/dist/esm/{src/components → components}/Error403/Error403.js +0 -0
- /package/dist/esm/{src/components → components}/Error403/ForbiddenErrorBackground.js +0 -0
- /package/dist/esm/{src/components → components}/Error403/GraphicWrangler/GraphicWrangler.js +0 -0
- /package/dist/esm/{src/components → components}/Error404/Error404.js +0 -0
- /package/dist/esm/{src/components → components}/Error404/GraphicLoch/GraphicLoch.js +0 -0
- /package/dist/esm/{src/components → components}/Error404/NotFoundErrorBackground.js +0 -0
- /package/dist/esm/{src/components → components}/ErrorBoundary/ErrorBoundary.js +0 -0
- /package/dist/esm/{src/components → components}/ErrorDragon/ErrorDragon.js +0 -0
- /package/dist/esm/{src/components → components}/ErrorDragon/assets/ErrorGraphic.js +0 -0
- /package/dist/esm/{src/components → components}/ErrorFullPage/ErrorFullPage.js +0 -0
- /package/dist/esm/{src/components → components}/ErrorMessage/ErrorMessage.js +0 -0
- /package/dist/esm/{src/components → components}/ErrorPage/ErrorPage.js +0 -0
- /package/dist/esm/{src/components → components}/ErrorPageCore/ErrorPageCore.js +0 -0
- /package/dist/esm/{src/components → components}/ErrorPageCore/GenericErrorBackground.js +0 -0
- /package/dist/esm/{src/components → components}/FeatureHeader/FeatureHeader.js +0 -0
- /package/dist/esm/{src/components → components}/FeatureNavTab/FeatureNavTab.js +0 -0
- /package/dist/esm/{src/components → components}/FeatureNavTabs/FeatureNavTabs.js +0 -0
- /package/dist/esm/{src/components → components}/FeatureSideNav/FeatureSideNav.js +0 -0
- /package/dist/esm/{src/components → components}/FeatureSideNav/FeatureSideNavFooter.js +0 -0
- /package/dist/esm/{src/components → components}/FeatureSideNav/FeatureSideNavHeader.js +0 -0
- /package/dist/esm/{src/components → components}/FeatureSideNav/FeatureSideNavLinks.js +0 -0
- /package/dist/esm/{src/components → components}/FeatureSideNavLink/FeatureSideNavLink.js +0 -0
- /package/dist/esm/{src/components → components}/Feedback/Feedback.js +0 -0
- /package/dist/esm/{src/components → components}/FlowModal/FlowModal.js +0 -0
- /package/dist/esm/{src/components → components}/FlowModal/FlowModalForm.js +0 -0
- /package/dist/esm/{src/components → components}/Header/Header.js +0 -0
- /package/dist/esm/{src/components → components}/Header/HeaderAppSwitcher.js +0 -0
- /package/dist/esm/{src/components → components}/Header/HeaderMenu.js +0 -0
- /package/dist/esm/{src/components → components}/Header/HeaderMenuItem.js +0 -0
- /package/dist/esm/{src/components → components}/Header/HeaderTeamSwitcher.js +0 -0
- /package/dist/esm/{src/components → components}/Header/UserRequests.js +0 -0
- /package/dist/esm/{src/components → components}/ImageModal/ImageModal.js +0 -0
- /package/dist/esm/{src/components → components}/Loading/Loading.js +0 -0
- /package/dist/esm/{src/components → components}/MemberBar/MemberBar.js +0 -0
- /package/dist/esm/{src/components → components}/Modal/Modal.js +0 -0
- /package/dist/esm/{src/components → components}/ModalConfirmEdit/ModalConfirmArray.js +0 -0
- /package/dist/esm/{src/components → components}/ModalConfirmEdit/ModalConfirmDetails.js +0 -0
- /package/dist/esm/{src/components → components}/ModalConfirmEdit/ModalConfirmEdit.js +0 -0
- /package/dist/esm/{src/components → components}/ModalForm/ModalForm.js +0 -0
- /package/dist/esm/{src/components → components}/Notifications/NotificationsContainer.js +0 -0
- /package/dist/esm/{src/components → components}/Notifications/ToastNotification.js +0 -0
- /package/dist/esm/{src/components → components}/Notifications/notify.js +0 -0
- /package/dist/esm/{src/components → components}/PlatformBanner/PlatformBanner.js +0 -0
- /package/dist/esm/{src/components → components}/PlatformNotifications/PlatformNotification.js +0 -0
- /package/dist/esm/{src/components → components}/PlatformNotifications/PlatformNotificationsContainer.js +0 -0
- /package/dist/esm/{src/components → components}/Portal/Portal.js +0 -0
- /package/dist/esm/{src/components → components}/PrivacyRedirect/PrivacyRedirect.js +0 -0
- /package/dist/esm/{src/components → components}/PrivacyStatement/PrivacyStatement.js +0 -0
- /package/dist/esm/{src/components → components}/ProfileSettings/ProfileSettings.js +0 -0
- /package/dist/esm/{src/components → components}/ProtectedRoute/ProtectedRoute.js +0 -0
- /package/dist/esm/{src/components → components}/RadioGroup/RadioGroup.js +0 -0
- /package/dist/esm/{src/components → components}/RichTextArea/RichTextArea.js +0 -0
- /package/dist/esm/{src/components → components}/SignOut/SignOut.js +0 -0
- /package/dist/esm/{src/components → components}/SupportCenter/SupportCenter.js +0 -0
- /package/dist/esm/{src/components → components}/TextArea/TextArea.js +0 -0
- /package/dist/esm/{src/components → components}/TextInput/TextInput.js +0 -0
- /package/dist/esm/{src/components → components}/Toggle/Toggle.js +0 -0
- /package/dist/esm/{src/components → components}/TooltipHover/TooltipHover.js +0 -0
- /package/dist/esm/{src/components → components}/UIShell/UIShell.js +0 -0
- /package/dist/esm/{src/config → config}/servicesConfig.js +0 -0
- /package/dist/esm/{src/constants → constants}/DataDrivenInputTypes.js +0 -0
- /package/dist/esm/{src/constants → constants}/TeamTypes.js +0 -0
- /package/dist/esm/{src/constants → constants}/UserType.js +0 -0
- /package/dist/esm/{src/hooks → hooks}/useHeaderMenu.js +0 -0
- /package/dist/esm/{src/hooks → hooks}/usePortal.js +0 -0
- /package/dist/esm/{src/hooks → hooks}/useWindowSize.js +0 -0
- /package/dist/esm/{src/index.js → index.js} +0 -0
- /package/dist/esm/{src/internal → internal}/ListBox/ListBox.js +0 -0
- /package/dist/esm/{src/internal → internal}/ListBox/ListBoxField.js +0 -0
- /package/dist/esm/{src/internal → internal}/ListBox/ListBoxMenu.js +0 -0
- /package/dist/esm/{src/internal → internal}/ListBox/ListBoxMenuIcon.js +0 -0
- /package/dist/esm/{src/internal → internal}/ListBox/ListBoxMenuItem.js +0 -0
- /package/dist/esm/{src/internal → internal}/ListBox/ListBoxSelection.js +0 -0
- /package/dist/esm/{src/internal → internal}/ListBox/index.js +0 -0
- /package/dist/esm/{src/internal → internal}/keyboard/keys.js +0 -0
- /package/dist/esm/{src/internal → internal}/keyboard/match.js +0 -0
- /package/dist/esm/{src/internal → internal}/settings.js +0 -0
- /package/dist/esm/{src/tools → tools}/accessibility.js +0 -0
- /package/dist/esm/{src/tools → tools}/createPropAdapter.js +0 -0
- /package/dist/esm/{src/tools → tools}/isUrl.js +0 -0
- /package/dist/esm/{src/tools → tools}/setupGetInstanceId.js +0 -0
- /package/dist/esm/{src/tools → tools}/useSetState.js +0 -0
- /package/dist/esm/{src/tools → tools}/yupAst/astGenerator.js +0 -0
- /package/dist/esm/{src/tools → tools}/yupAst/customValidators.js +0 -0
|
@@ -6,8 +6,8 @@ var React = require('react');
|
|
|
6
6
|
var react = require('@carbon/react');
|
|
7
7
|
var icons = require('@carbon/react/icons');
|
|
8
8
|
var core = require('@dnd-kit/core');
|
|
9
|
-
var
|
|
10
|
-
var
|
|
9
|
+
var sortable = require('@dnd-kit/sortable');
|
|
10
|
+
var utilities = require('@dnd-kit/utilities');
|
|
11
11
|
var cx = require('classnames');
|
|
12
12
|
var TooltipHover = require('../TooltipHover/TooltipHover.js');
|
|
13
13
|
var accessibility = require('../../tools/accessibility.js');
|
|
@@ -139,7 +139,7 @@ function CreatableComponent({ buttonClassName = `${settings.prefix}--bmrg-creata
|
|
|
139
139
|
if (over && active.id !== over.id) {
|
|
140
140
|
const oldIndex = tagItems.indexOf(active.id);
|
|
141
141
|
const newIndex = tagItems.indexOf(over.id);
|
|
142
|
-
const reorderedItems =
|
|
142
|
+
const reorderedItems = sortable.arrayMove(tagItems, oldIndex, newIndex);
|
|
143
143
|
setCreatedItems(reorderedItems);
|
|
144
144
|
if (onChange) {
|
|
145
145
|
onChange(reorderedItems);
|
|
@@ -168,15 +168,15 @@ function CreatableComponent({ buttonClassName = `${settings.prefix}--bmrg-creata
|
|
|
168
168
|
React__default.default.createElement(icons.Information, { size: 16, fill: "currentColor" }))))), onBlur: onInputBlur, onChange: onInputChange, placeholder: placeholder, ref: inputRef, type: type, value: input, ...textInputProps })),
|
|
169
169
|
React__default.default.createElement(react.Button, { className: createButtonClassName, disabled: isAddButtonDisabled, onClick: addValue, iconDescription: "Add", renderIcon: icons.Add, size: "md", type: "button", ...buttonProps }, buttonContent)),
|
|
170
170
|
reorderable ? (React__default.default.createElement(core.DndContext, { sensors: disabled ? [] : sensors, collisionDetection: core.closestCenter, onDragEnd: handleDragEnd },
|
|
171
|
-
React__default.default.createElement(
|
|
171
|
+
React__default.default.createElement(sortable.SortableContext, { items: tagsToShow, strategy: sortable.verticalListSortingStrategy },
|
|
172
172
|
React__default.default.createElement("div", { className: `${settings.prefix}--bmrg-creatable__tags--reorderable` }, tagsToShow.map((item, index) => (React__default.default.createElement(ReorderableTag, { key: `${item}-${index}`, disabled: disabled, initialTagItems: initialTagItems, item: item, nonDeletable: nonDeletable, removeValue: removeValue, tagProps: tagProps, tagType: tagType }))))))) : (React__default.default.createElement("div", { className: `${settings.prefix}--bmrg-creatable__tags` }, tagsToShow.map((item, index) => (React__default.default.createElement(react.Tag, { key: `${item}-${index}`, disabled: disabled, type: tagType, onClick: nonDeletable && initialTagItems.includes(item) ? undefined : () => removeValue(item), onKeyDown: nonDeletable && initialTagItems.includes(item)
|
|
173
173
|
? undefined
|
|
174
174
|
: (e) => accessibility.isAccessibleKeyDownEvent(e) && removeValue(item), filter: !nonDeletable || (nonDeletable && !initialTagItems.includes(item)), ...tagProps }, item)))))));
|
|
175
175
|
}
|
|
176
176
|
function ReorderableTag({ disabled, initialTagItems, item, nonDeletable, removeValue, tagProps, tagType, }) {
|
|
177
|
-
const { attributes, listeners, setNodeRef, transform, transition } =
|
|
177
|
+
const { attributes, listeners, setNodeRef, transform, transition } = sortable.useSortable({ id: item });
|
|
178
178
|
const style = {
|
|
179
|
-
transform:
|
|
179
|
+
transform: utilities.CSS.Transform.toString(transform),
|
|
180
180
|
transition,
|
|
181
181
|
};
|
|
182
182
|
return (React__default.default.createElement("div", { ref: setNodeRef, ...attributes, ...(!disabled ? listeners : {}), style: style },
|
|
@@ -2,8 +2,8 @@ import React, { useState } from 'react';
|
|
|
2
2
|
import { TextInput, Button, Tag, DismissibleTag } from '@carbon/react';
|
|
3
3
|
import { Information, Add, Draggable } from '@carbon/react/icons';
|
|
4
4
|
import { useSensors, useSensor, PointerSensor, DndContext, closestCenter } from '@dnd-kit/core';
|
|
5
|
-
import { SortableContext, verticalListSortingStrategy, useSortable, arrayMove } from '
|
|
6
|
-
import { CSS } from '
|
|
5
|
+
import { SortableContext, verticalListSortingStrategy, useSortable, arrayMove } from '@dnd-kit/sortable';
|
|
6
|
+
import { CSS } from '@dnd-kit/utilities';
|
|
7
7
|
import cx from 'classnames';
|
|
8
8
|
import TooltipHover from '../TooltipHover/TooltipHover.js';
|
|
9
9
|
import { isAccessibleKeyDownEvent } from '../../tools/accessibility.js';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@boomerang-io/carbon-addons-boomerang-react",
|
|
3
3
|
"description": "Carbon Addons for Boomerang apps",
|
|
4
|
-
"version": "4.6.14-beta.
|
|
4
|
+
"version": "4.6.14-beta.13",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Tim Bula",
|
|
7
7
|
"email": "timrbula@gmail.com"
|
|
@@ -50,6 +50,8 @@
|
|
|
50
50
|
"@carbon/ibm-products": "2.57.1",
|
|
51
51
|
"@carbon/react": "1.77.0",
|
|
52
52
|
"@dnd-kit/core": "^6.3.1",
|
|
53
|
+
"@dnd-kit/sortable": "^10.0.0",
|
|
54
|
+
"@dnd-kit/utilities": "^3.2.2",
|
|
53
55
|
"@stomp/stompjs": "6.1.2",
|
|
54
56
|
"@tippyjs/react": "4.2.6",
|
|
55
57
|
"classnames": "2.3.2",
|
|
@@ -1,538 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var React = require('react');
|
|
4
|
-
var core = require('@dnd-kit/core');
|
|
5
|
-
var utilities_esm = require('../../../../../@dnd-kit_utilities@3.2.2_react@16.14.0/node_modules/@dnd-kit/utilities/dist/utilities.esm.js');
|
|
6
|
-
|
|
7
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
-
|
|
9
|
-
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Move an array item to a different position. Returns a new array with the item moved to the new position.
|
|
13
|
-
*/
|
|
14
|
-
function arrayMove(array, from, to) {
|
|
15
|
-
const newArray = array.slice();
|
|
16
|
-
newArray.splice(to < 0 ? newArray.length + to : to, 0, newArray.splice(from, 1)[0]);
|
|
17
|
-
return newArray;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function getSortedRects(items, rects) {
|
|
21
|
-
return items.reduce((accumulator, id, index) => {
|
|
22
|
-
const rect = rects.get(id);
|
|
23
|
-
|
|
24
|
-
if (rect) {
|
|
25
|
-
accumulator[index] = rect;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return accumulator;
|
|
29
|
-
}, Array(items.length));
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function isValidIndex(index) {
|
|
33
|
-
return index !== null && index >= 0;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function itemsEqual(a, b) {
|
|
37
|
-
if (a === b) {
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (a.length !== b.length) {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
for (let i = 0; i < a.length; i++) {
|
|
46
|
-
if (a[i] !== b[i]) {
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return true;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function normalizeDisabled(disabled) {
|
|
55
|
-
if (typeof disabled === 'boolean') {
|
|
56
|
-
return {
|
|
57
|
-
draggable: disabled,
|
|
58
|
-
droppable: disabled
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return disabled;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const rectSortingStrategy = _ref => {
|
|
66
|
-
let {
|
|
67
|
-
rects,
|
|
68
|
-
activeIndex,
|
|
69
|
-
overIndex,
|
|
70
|
-
index
|
|
71
|
-
} = _ref;
|
|
72
|
-
const newRects = arrayMove(rects, overIndex, activeIndex);
|
|
73
|
-
const oldRect = rects[index];
|
|
74
|
-
const newRect = newRects[index];
|
|
75
|
-
|
|
76
|
-
if (!newRect || !oldRect) {
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return {
|
|
81
|
-
x: newRect.left - oldRect.left,
|
|
82
|
-
y: newRect.top - oldRect.top,
|
|
83
|
-
scaleX: newRect.width / oldRect.width,
|
|
84
|
-
scaleY: newRect.height / oldRect.height
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
// To-do: We should be calculating scale transformation
|
|
89
|
-
const defaultScale$1 = {
|
|
90
|
-
scaleX: 1,
|
|
91
|
-
scaleY: 1
|
|
92
|
-
};
|
|
93
|
-
const verticalListSortingStrategy = _ref => {
|
|
94
|
-
var _rects$activeIndex;
|
|
95
|
-
|
|
96
|
-
let {
|
|
97
|
-
activeIndex,
|
|
98
|
-
activeNodeRect: fallbackActiveRect,
|
|
99
|
-
index,
|
|
100
|
-
rects,
|
|
101
|
-
overIndex
|
|
102
|
-
} = _ref;
|
|
103
|
-
const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect;
|
|
104
|
-
|
|
105
|
-
if (!activeNodeRect) {
|
|
106
|
-
return null;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
if (index === activeIndex) {
|
|
110
|
-
const overIndexRect = rects[overIndex];
|
|
111
|
-
|
|
112
|
-
if (!overIndexRect) {
|
|
113
|
-
return null;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return {
|
|
117
|
-
x: 0,
|
|
118
|
-
y: activeIndex < overIndex ? overIndexRect.top + overIndexRect.height - (activeNodeRect.top + activeNodeRect.height) : overIndexRect.top - activeNodeRect.top,
|
|
119
|
-
...defaultScale$1
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
const itemGap = getItemGap$1(rects, index, activeIndex);
|
|
124
|
-
|
|
125
|
-
if (index > activeIndex && index <= overIndex) {
|
|
126
|
-
return {
|
|
127
|
-
x: 0,
|
|
128
|
-
y: -activeNodeRect.height - itemGap,
|
|
129
|
-
...defaultScale$1
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
if (index < activeIndex && index >= overIndex) {
|
|
134
|
-
return {
|
|
135
|
-
x: 0,
|
|
136
|
-
y: activeNodeRect.height + itemGap,
|
|
137
|
-
...defaultScale$1
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
return {
|
|
142
|
-
x: 0,
|
|
143
|
-
y: 0,
|
|
144
|
-
...defaultScale$1
|
|
145
|
-
};
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
function getItemGap$1(clientRects, index, activeIndex) {
|
|
149
|
-
const currentRect = clientRects[index];
|
|
150
|
-
const previousRect = clientRects[index - 1];
|
|
151
|
-
const nextRect = clientRects[index + 1];
|
|
152
|
-
|
|
153
|
-
if (!currentRect) {
|
|
154
|
-
return 0;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
if (activeIndex < index) {
|
|
158
|
-
return previousRect ? currentRect.top - (previousRect.top + previousRect.height) : nextRect ? nextRect.top - (currentRect.top + currentRect.height) : 0;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
return nextRect ? nextRect.top - (currentRect.top + currentRect.height) : previousRect ? currentRect.top - (previousRect.top + previousRect.height) : 0;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
const ID_PREFIX = 'Sortable';
|
|
165
|
-
const Context = /*#__PURE__*/React__default.default.createContext({
|
|
166
|
-
activeIndex: -1,
|
|
167
|
-
containerId: ID_PREFIX,
|
|
168
|
-
disableTransforms: false,
|
|
169
|
-
items: [],
|
|
170
|
-
overIndex: -1,
|
|
171
|
-
useDragOverlay: false,
|
|
172
|
-
sortedRects: [],
|
|
173
|
-
strategy: rectSortingStrategy,
|
|
174
|
-
disabled: {
|
|
175
|
-
draggable: false,
|
|
176
|
-
droppable: false
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
function SortableContext(_ref) {
|
|
180
|
-
let {
|
|
181
|
-
children,
|
|
182
|
-
id,
|
|
183
|
-
items: userDefinedItems,
|
|
184
|
-
strategy = rectSortingStrategy,
|
|
185
|
-
disabled: disabledProp = false
|
|
186
|
-
} = _ref;
|
|
187
|
-
const {
|
|
188
|
-
active,
|
|
189
|
-
dragOverlay,
|
|
190
|
-
droppableRects,
|
|
191
|
-
over,
|
|
192
|
-
measureDroppableContainers
|
|
193
|
-
} = core.useDndContext();
|
|
194
|
-
const containerId = utilities_esm.useUniqueId(ID_PREFIX, id);
|
|
195
|
-
const useDragOverlay = Boolean(dragOverlay.rect !== null);
|
|
196
|
-
const items = React.useMemo(() => userDefinedItems.map(item => typeof item === 'object' && 'id' in item ? item.id : item), [userDefinedItems]);
|
|
197
|
-
const isDragging = active != null;
|
|
198
|
-
const activeIndex = active ? items.indexOf(active.id) : -1;
|
|
199
|
-
const overIndex = over ? items.indexOf(over.id) : -1;
|
|
200
|
-
const previousItemsRef = React.useRef(items);
|
|
201
|
-
const itemsHaveChanged = !itemsEqual(items, previousItemsRef.current);
|
|
202
|
-
const disableTransforms = overIndex !== -1 && activeIndex === -1 || itemsHaveChanged;
|
|
203
|
-
const disabled = normalizeDisabled(disabledProp);
|
|
204
|
-
utilities_esm.useIsomorphicLayoutEffect(() => {
|
|
205
|
-
if (itemsHaveChanged && isDragging) {
|
|
206
|
-
measureDroppableContainers(items);
|
|
207
|
-
}
|
|
208
|
-
}, [itemsHaveChanged, items, isDragging, measureDroppableContainers]);
|
|
209
|
-
React.useEffect(() => {
|
|
210
|
-
previousItemsRef.current = items;
|
|
211
|
-
}, [items]);
|
|
212
|
-
const contextValue = React.useMemo(() => ({
|
|
213
|
-
activeIndex,
|
|
214
|
-
containerId,
|
|
215
|
-
disabled,
|
|
216
|
-
disableTransforms,
|
|
217
|
-
items,
|
|
218
|
-
overIndex,
|
|
219
|
-
useDragOverlay,
|
|
220
|
-
sortedRects: getSortedRects(items, droppableRects),
|
|
221
|
-
strategy
|
|
222
|
-
}), // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
223
|
-
[activeIndex, containerId, disabled.draggable, disabled.droppable, disableTransforms, items, overIndex, droppableRects, useDragOverlay, strategy]);
|
|
224
|
-
return React__default.default.createElement(Context.Provider, {
|
|
225
|
-
value: contextValue
|
|
226
|
-
}, children);
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
const defaultNewIndexGetter = _ref => {
|
|
230
|
-
let {
|
|
231
|
-
id,
|
|
232
|
-
items,
|
|
233
|
-
activeIndex,
|
|
234
|
-
overIndex
|
|
235
|
-
} = _ref;
|
|
236
|
-
return arrayMove(items, activeIndex, overIndex).indexOf(id);
|
|
237
|
-
};
|
|
238
|
-
const defaultAnimateLayoutChanges = _ref2 => {
|
|
239
|
-
let {
|
|
240
|
-
containerId,
|
|
241
|
-
isSorting,
|
|
242
|
-
wasDragging,
|
|
243
|
-
index,
|
|
244
|
-
items,
|
|
245
|
-
newIndex,
|
|
246
|
-
previousItems,
|
|
247
|
-
previousContainerId,
|
|
248
|
-
transition
|
|
249
|
-
} = _ref2;
|
|
250
|
-
|
|
251
|
-
if (!transition || !wasDragging) {
|
|
252
|
-
return false;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
if (previousItems !== items && index === newIndex) {
|
|
256
|
-
return false;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
if (isSorting) {
|
|
260
|
-
return true;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
return newIndex !== index && containerId === previousContainerId;
|
|
264
|
-
};
|
|
265
|
-
const defaultTransition = {
|
|
266
|
-
duration: 200,
|
|
267
|
-
easing: 'ease'
|
|
268
|
-
};
|
|
269
|
-
const transitionProperty = 'transform';
|
|
270
|
-
const disabledTransition = /*#__PURE__*/utilities_esm.CSS.Transition.toString({
|
|
271
|
-
property: transitionProperty,
|
|
272
|
-
duration: 0,
|
|
273
|
-
easing: 'linear'
|
|
274
|
-
});
|
|
275
|
-
const defaultAttributes = {
|
|
276
|
-
roleDescription: 'sortable'
|
|
277
|
-
};
|
|
278
|
-
|
|
279
|
-
/*
|
|
280
|
-
* When the index of an item changes while sorting,
|
|
281
|
-
* we need to temporarily disable the transforms
|
|
282
|
-
*/
|
|
283
|
-
|
|
284
|
-
function useDerivedTransform(_ref) {
|
|
285
|
-
let {
|
|
286
|
-
disabled,
|
|
287
|
-
index,
|
|
288
|
-
node,
|
|
289
|
-
rect
|
|
290
|
-
} = _ref;
|
|
291
|
-
const [derivedTransform, setDerivedtransform] = React.useState(null);
|
|
292
|
-
const previousIndex = React.useRef(index);
|
|
293
|
-
utilities_esm.useIsomorphicLayoutEffect(() => {
|
|
294
|
-
if (!disabled && index !== previousIndex.current && node.current) {
|
|
295
|
-
const initial = rect.current;
|
|
296
|
-
|
|
297
|
-
if (initial) {
|
|
298
|
-
const current = core.getClientRect(node.current, {
|
|
299
|
-
ignoreTransform: true
|
|
300
|
-
});
|
|
301
|
-
const delta = {
|
|
302
|
-
x: initial.left - current.left,
|
|
303
|
-
y: initial.top - current.top,
|
|
304
|
-
scaleX: initial.width / current.width,
|
|
305
|
-
scaleY: initial.height / current.height
|
|
306
|
-
};
|
|
307
|
-
|
|
308
|
-
if (delta.x || delta.y) {
|
|
309
|
-
setDerivedtransform(delta);
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
if (index !== previousIndex.current) {
|
|
315
|
-
previousIndex.current = index;
|
|
316
|
-
}
|
|
317
|
-
}, [disabled, index, node, rect]);
|
|
318
|
-
React.useEffect(() => {
|
|
319
|
-
if (derivedTransform) {
|
|
320
|
-
setDerivedtransform(null);
|
|
321
|
-
}
|
|
322
|
-
}, [derivedTransform]);
|
|
323
|
-
return derivedTransform;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
function useSortable(_ref) {
|
|
327
|
-
let {
|
|
328
|
-
animateLayoutChanges = defaultAnimateLayoutChanges,
|
|
329
|
-
attributes: userDefinedAttributes,
|
|
330
|
-
disabled: localDisabled,
|
|
331
|
-
data: customData,
|
|
332
|
-
getNewIndex = defaultNewIndexGetter,
|
|
333
|
-
id,
|
|
334
|
-
strategy: localStrategy,
|
|
335
|
-
resizeObserverConfig,
|
|
336
|
-
transition = defaultTransition
|
|
337
|
-
} = _ref;
|
|
338
|
-
const {
|
|
339
|
-
items,
|
|
340
|
-
containerId,
|
|
341
|
-
activeIndex,
|
|
342
|
-
disabled: globalDisabled,
|
|
343
|
-
disableTransforms,
|
|
344
|
-
sortedRects,
|
|
345
|
-
overIndex,
|
|
346
|
-
useDragOverlay,
|
|
347
|
-
strategy: globalStrategy
|
|
348
|
-
} = React.useContext(Context);
|
|
349
|
-
const disabled = normalizeLocalDisabled(localDisabled, globalDisabled);
|
|
350
|
-
const index = items.indexOf(id);
|
|
351
|
-
const data = React.useMemo(() => ({
|
|
352
|
-
sortable: {
|
|
353
|
-
containerId,
|
|
354
|
-
index,
|
|
355
|
-
items
|
|
356
|
-
},
|
|
357
|
-
...customData
|
|
358
|
-
}), [containerId, customData, index, items]);
|
|
359
|
-
const itemsAfterCurrentSortable = React.useMemo(() => items.slice(items.indexOf(id)), [items, id]);
|
|
360
|
-
const {
|
|
361
|
-
rect,
|
|
362
|
-
node,
|
|
363
|
-
isOver,
|
|
364
|
-
setNodeRef: setDroppableNodeRef
|
|
365
|
-
} = core.useDroppable({
|
|
366
|
-
id,
|
|
367
|
-
data,
|
|
368
|
-
disabled: disabled.droppable,
|
|
369
|
-
resizeObserverConfig: {
|
|
370
|
-
updateMeasurementsFor: itemsAfterCurrentSortable,
|
|
371
|
-
...resizeObserverConfig
|
|
372
|
-
}
|
|
373
|
-
});
|
|
374
|
-
const {
|
|
375
|
-
active,
|
|
376
|
-
activatorEvent,
|
|
377
|
-
activeNodeRect,
|
|
378
|
-
attributes,
|
|
379
|
-
setNodeRef: setDraggableNodeRef,
|
|
380
|
-
listeners,
|
|
381
|
-
isDragging,
|
|
382
|
-
over,
|
|
383
|
-
setActivatorNodeRef,
|
|
384
|
-
transform
|
|
385
|
-
} = core.useDraggable({
|
|
386
|
-
id,
|
|
387
|
-
data,
|
|
388
|
-
attributes: { ...defaultAttributes,
|
|
389
|
-
...userDefinedAttributes
|
|
390
|
-
},
|
|
391
|
-
disabled: disabled.draggable
|
|
392
|
-
});
|
|
393
|
-
const setNodeRef = utilities_esm.useCombinedRefs(setDroppableNodeRef, setDraggableNodeRef);
|
|
394
|
-
const isSorting = Boolean(active);
|
|
395
|
-
const displaceItem = isSorting && !disableTransforms && isValidIndex(activeIndex) && isValidIndex(overIndex);
|
|
396
|
-
const shouldDisplaceDragSource = !useDragOverlay && isDragging;
|
|
397
|
-
const dragSourceDisplacement = shouldDisplaceDragSource && displaceItem ? transform : null;
|
|
398
|
-
const strategy = localStrategy != null ? localStrategy : globalStrategy;
|
|
399
|
-
const finalTransform = displaceItem ? dragSourceDisplacement != null ? dragSourceDisplacement : strategy({
|
|
400
|
-
rects: sortedRects,
|
|
401
|
-
activeNodeRect,
|
|
402
|
-
activeIndex,
|
|
403
|
-
overIndex,
|
|
404
|
-
index
|
|
405
|
-
}) : null;
|
|
406
|
-
const newIndex = isValidIndex(activeIndex) && isValidIndex(overIndex) ? getNewIndex({
|
|
407
|
-
id,
|
|
408
|
-
items,
|
|
409
|
-
activeIndex,
|
|
410
|
-
overIndex
|
|
411
|
-
}) : index;
|
|
412
|
-
const activeId = active == null ? void 0 : active.id;
|
|
413
|
-
const previous = React.useRef({
|
|
414
|
-
activeId,
|
|
415
|
-
items,
|
|
416
|
-
newIndex,
|
|
417
|
-
containerId
|
|
418
|
-
});
|
|
419
|
-
const itemsHaveChanged = items !== previous.current.items;
|
|
420
|
-
const shouldAnimateLayoutChanges = animateLayoutChanges({
|
|
421
|
-
active,
|
|
422
|
-
containerId,
|
|
423
|
-
isDragging,
|
|
424
|
-
isSorting,
|
|
425
|
-
id,
|
|
426
|
-
index,
|
|
427
|
-
items,
|
|
428
|
-
newIndex: previous.current.newIndex,
|
|
429
|
-
previousItems: previous.current.items,
|
|
430
|
-
previousContainerId: previous.current.containerId,
|
|
431
|
-
transition,
|
|
432
|
-
wasDragging: previous.current.activeId != null
|
|
433
|
-
});
|
|
434
|
-
const derivedTransform = useDerivedTransform({
|
|
435
|
-
disabled: !shouldAnimateLayoutChanges,
|
|
436
|
-
index,
|
|
437
|
-
node,
|
|
438
|
-
rect
|
|
439
|
-
});
|
|
440
|
-
React.useEffect(() => {
|
|
441
|
-
if (isSorting && previous.current.newIndex !== newIndex) {
|
|
442
|
-
previous.current.newIndex = newIndex;
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
if (containerId !== previous.current.containerId) {
|
|
446
|
-
previous.current.containerId = containerId;
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
if (items !== previous.current.items) {
|
|
450
|
-
previous.current.items = items;
|
|
451
|
-
}
|
|
452
|
-
}, [isSorting, newIndex, containerId, items]);
|
|
453
|
-
React.useEffect(() => {
|
|
454
|
-
if (activeId === previous.current.activeId) {
|
|
455
|
-
return;
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
if (activeId && !previous.current.activeId) {
|
|
459
|
-
previous.current.activeId = activeId;
|
|
460
|
-
return;
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
const timeoutId = setTimeout(() => {
|
|
464
|
-
previous.current.activeId = activeId;
|
|
465
|
-
}, 50);
|
|
466
|
-
return () => clearTimeout(timeoutId);
|
|
467
|
-
}, [activeId]);
|
|
468
|
-
return {
|
|
469
|
-
active,
|
|
470
|
-
activeIndex,
|
|
471
|
-
attributes,
|
|
472
|
-
data,
|
|
473
|
-
rect,
|
|
474
|
-
index,
|
|
475
|
-
newIndex,
|
|
476
|
-
items,
|
|
477
|
-
isOver,
|
|
478
|
-
isSorting,
|
|
479
|
-
isDragging,
|
|
480
|
-
listeners,
|
|
481
|
-
node,
|
|
482
|
-
overIndex,
|
|
483
|
-
over,
|
|
484
|
-
setNodeRef,
|
|
485
|
-
setActivatorNodeRef,
|
|
486
|
-
setDroppableNodeRef,
|
|
487
|
-
setDraggableNodeRef,
|
|
488
|
-
transform: derivedTransform != null ? derivedTransform : finalTransform,
|
|
489
|
-
transition: getTransition()
|
|
490
|
-
};
|
|
491
|
-
|
|
492
|
-
function getTransition() {
|
|
493
|
-
if ( // Temporarily disable transitions for a single frame to set up derived transforms
|
|
494
|
-
derivedTransform || // Or to prevent items jumping to back to their "new" position when items change
|
|
495
|
-
itemsHaveChanged && previous.current.newIndex === index) {
|
|
496
|
-
return disabledTransition;
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
if (shouldDisplaceDragSource && !utilities_esm.isKeyboardEvent(activatorEvent) || !transition) {
|
|
500
|
-
return undefined;
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
if (isSorting || shouldAnimateLayoutChanges) {
|
|
504
|
-
return utilities_esm.CSS.Transition.toString({ ...transition,
|
|
505
|
-
property: transitionProperty
|
|
506
|
-
});
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
return undefined;
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
function normalizeLocalDisabled(localDisabled, globalDisabled) {
|
|
514
|
-
var _localDisabled$dragga, _localDisabled$droppa;
|
|
515
|
-
|
|
516
|
-
if (typeof localDisabled === 'boolean') {
|
|
517
|
-
return {
|
|
518
|
-
draggable: localDisabled,
|
|
519
|
-
// Backwards compatibility
|
|
520
|
-
droppable: false
|
|
521
|
-
};
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
return {
|
|
525
|
-
draggable: (_localDisabled$dragga = localDisabled == null ? void 0 : localDisabled.draggable) != null ? _localDisabled$dragga : globalDisabled.draggable,
|
|
526
|
-
droppable: (_localDisabled$droppa = localDisabled == null ? void 0 : localDisabled.droppable) != null ? _localDisabled$droppa : globalDisabled.droppable
|
|
527
|
-
};
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
[core.KeyboardCode.Down, core.KeyboardCode.Right, core.KeyboardCode.Up, core.KeyboardCode.Left];
|
|
531
|
-
|
|
532
|
-
exports.SortableContext = SortableContext;
|
|
533
|
-
exports.arrayMove = arrayMove;
|
|
534
|
-
exports.defaultAnimateLayoutChanges = defaultAnimateLayoutChanges;
|
|
535
|
-
exports.defaultNewIndexGetter = defaultNewIndexGetter;
|
|
536
|
-
exports.rectSortingStrategy = rectSortingStrategy;
|
|
537
|
-
exports.useSortable = useSortable;
|
|
538
|
-
exports.verticalListSortingStrategy = verticalListSortingStrategy;
|