@boomerang-io/carbon-addons-boomerang-react 4.6.14-beta.11 → 4.6.14-beta.12

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