@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.
- 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
- 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
- package/dist/cjs/{components → src/components}/Creatable/Creatable.js +32 -3
- package/dist/cjs/{components → src/components}/DataDrivenInput/DataDrivenInput.js +11 -2
- package/dist/cjs/{components → src/components}/DynamicFormik/DynamicFormik.js +11 -1
- package/dist/cjs/{constants → src/constants}/DataDrivenInputTypes.js +4 -0
- 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
- 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
- package/dist/esm/{components → src/components}/Creatable/Creatable.js +34 -5
- package/dist/esm/{components → src/components}/DataDrivenInput/DataDrivenInput.js +11 -2
- package/dist/esm/{components → src/components}/DynamicFormik/DynamicFormik.js +11 -1
- package/dist/esm/{constants → src/constants}/DataDrivenInputTypes.js +4 -0
- package/dist/types/index.d.ts +2 -1
- package/package.json +3 -2
- package/scss/components/Creatable/_creatable.scss +30 -1
- /package/dist/cjs/{components → src/components}/AboutPlatform/AboutPlatform.js +0 -0
- /package/dist/cjs/{components → src/components}/AdvantageSideNav/AdvantageSideNav.js +0 -0
- /package/dist/cjs/{components → src/components}/AutoSuggest/AutoSuggest.js +0 -0
- /package/dist/cjs/{components → src/components}/Avatar/Avatar.js +0 -0
- /package/dist/cjs/{components → src/components}/CheckboxList/CheckboxList.js +0 -0
- /package/dist/cjs/{components → src/components}/ComboBox/ComboBox.js +0 -0
- /package/dist/cjs/{components → src/components}/ComboBoxMultiSelect/ComboBoxMultiSelect.js +0 -0
- /package/dist/cjs/{components → src/components}/ComboBoxMultiSelect/MultiSelect.js +0 -0
- /package/dist/cjs/{components → src/components}/ComposedModal/ComposedModal.js +0 -0
- /package/dist/cjs/{components → src/components}/ConfirmModal/ConfirmModal.js +0 -0
- /package/dist/cjs/{components → src/components}/DateInput/DateInput.js +0 -0
- /package/dist/cjs/{components → src/components}/DecisionButtons/DecisionButtons.js +0 -0
- /package/dist/cjs/{components → src/components}/DelayedRender/DelayedRender.js +0 -0
- /package/dist/cjs/{components → src/components}/Error403/Error403.js +0 -0
- /package/dist/cjs/{components → src/components}/Error403/ForbiddenErrorBackground.js +0 -0
- /package/dist/cjs/{components → src/components}/Error403/GraphicWrangler/GraphicWrangler.js +0 -0
- /package/dist/cjs/{components → src/components}/Error404/Error404.js +0 -0
- /package/dist/cjs/{components → src/components}/Error404/GraphicLoch/GraphicLoch.js +0 -0
- /package/dist/cjs/{components → src/components}/Error404/NotFoundErrorBackground.js +0 -0
- /package/dist/cjs/{components → src/components}/ErrorBoundary/ErrorBoundary.js +0 -0
- /package/dist/cjs/{components → src/components}/ErrorDragon/ErrorDragon.js +0 -0
- /package/dist/cjs/{components → src/components}/ErrorDragon/assets/ErrorGraphic.js +0 -0
- /package/dist/cjs/{components → src/components}/ErrorFullPage/ErrorFullPage.js +0 -0
- /package/dist/cjs/{components → src/components}/ErrorMessage/ErrorMessage.js +0 -0
- /package/dist/cjs/{components → src/components}/ErrorPage/ErrorPage.js +0 -0
- /package/dist/cjs/{components → src/components}/ErrorPageCore/ErrorPageCore.js +0 -0
- /package/dist/cjs/{components → src/components}/ErrorPageCore/GenericErrorBackground.js +0 -0
- /package/dist/cjs/{components → src/components}/FeatureHeader/FeatureHeader.js +0 -0
- /package/dist/cjs/{components → src/components}/FeatureNavTab/FeatureNavTab.js +0 -0
- /package/dist/cjs/{components → src/components}/FeatureNavTabs/FeatureNavTabs.js +0 -0
- /package/dist/cjs/{components → src/components}/FeatureSideNav/FeatureSideNav.js +0 -0
- /package/dist/cjs/{components → src/components}/FeatureSideNav/FeatureSideNavFooter.js +0 -0
- /package/dist/cjs/{components → src/components}/FeatureSideNav/FeatureSideNavHeader.js +0 -0
- /package/dist/cjs/{components → src/components}/FeatureSideNav/FeatureSideNavLinks.js +0 -0
- /package/dist/cjs/{components → src/components}/FeatureSideNavLink/FeatureSideNavLink.js +0 -0
- /package/dist/cjs/{components → src/components}/Feedback/Feedback.js +0 -0
- /package/dist/cjs/{components → src/components}/FlowModal/FlowModal.js +0 -0
- /package/dist/cjs/{components → src/components}/FlowModal/FlowModalForm.js +0 -0
- /package/dist/cjs/{components → src/components}/Header/Header.js +0 -0
- /package/dist/cjs/{components → src/components}/Header/HeaderAppSwitcher.js +0 -0
- /package/dist/cjs/{components → src/components}/Header/HeaderMenu.js +0 -0
- /package/dist/cjs/{components → src/components}/Header/HeaderMenuItem.js +0 -0
- /package/dist/cjs/{components → src/components}/Header/HeaderTeamSwitcher.js +0 -0
- /package/dist/cjs/{components → src/components}/Header/UserRequests.js +0 -0
- /package/dist/cjs/{components → src/components}/ImageModal/ImageModal.js +0 -0
- /package/dist/cjs/{components → src/components}/Loading/Loading.js +0 -0
- /package/dist/cjs/{components → src/components}/MemberBar/MemberBar.js +0 -0
- /package/dist/cjs/{components → src/components}/Modal/Modal.js +0 -0
- /package/dist/cjs/{components → src/components}/ModalConfirmEdit/ModalConfirmArray.js +0 -0
- /package/dist/cjs/{components → src/components}/ModalConfirmEdit/ModalConfirmDetails.js +0 -0
- /package/dist/cjs/{components → src/components}/ModalConfirmEdit/ModalConfirmEdit.js +0 -0
- /package/dist/cjs/{components → src/components}/ModalForm/ModalForm.js +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/NotificationsContainer.js +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/ToastNotification.js +0 -0
- /package/dist/cjs/{components → src/components}/Notifications/notify.js +0 -0
- /package/dist/cjs/{components → src/components}/PlatformBanner/PlatformBanner.js +0 -0
- /package/dist/cjs/{components → src/components}/PlatformNotifications/PlatformNotification.js +0 -0
- /package/dist/cjs/{components → src/components}/PlatformNotifications/PlatformNotificationsContainer.js +0 -0
- /package/dist/cjs/{components → src/components}/Portal/Portal.js +0 -0
- /package/dist/cjs/{components → src/components}/PrivacyRedirect/PrivacyRedirect.js +0 -0
- /package/dist/cjs/{components → src/components}/PrivacyStatement/PrivacyStatement.js +0 -0
- /package/dist/cjs/{components → src/components}/ProfileSettings/ProfileSettings.js +0 -0
- /package/dist/cjs/{components → src/components}/ProtectedRoute/ProtectedRoute.js +0 -0
- /package/dist/cjs/{components → src/components}/RadioGroup/RadioGroup.js +0 -0
- /package/dist/cjs/{components → src/components}/RichTextArea/RichTextArea.js +0 -0
- /package/dist/cjs/{components → src/components}/SignOut/SignOut.js +0 -0
- /package/dist/cjs/{components → src/components}/SupportCenter/SupportCenter.js +0 -0
- /package/dist/cjs/{components → src/components}/TextArea/TextArea.js +0 -0
- /package/dist/cjs/{components → src/components}/TextInput/TextInput.js +0 -0
- /package/dist/cjs/{components → src/components}/Toggle/Toggle.js +0 -0
- /package/dist/cjs/{components → src/components}/TooltipHover/TooltipHover.js +0 -0
- /package/dist/cjs/{components → src/components}/UIShell/UIShell.js +0 -0
- /package/dist/cjs/{config → src/config}/servicesConfig.js +0 -0
- /package/dist/cjs/{constants → src/constants}/TeamTypes.js +0 -0
- /package/dist/cjs/{constants → src/constants}/UserType.js +0 -0
- /package/dist/cjs/{hooks → src/hooks}/useHeaderMenu.js +0 -0
- /package/dist/cjs/{hooks → src/hooks}/usePortal.js +0 -0
- /package/dist/cjs/{hooks → src/hooks}/useWindowSize.js +0 -0
- /package/dist/cjs/{index.js → src/index.js} +0 -0
- /package/dist/cjs/{internal → src/internal}/ListBox/ListBox.js +0 -0
- /package/dist/cjs/{internal → src/internal}/ListBox/ListBoxField.js +0 -0
- /package/dist/cjs/{internal → src/internal}/ListBox/ListBoxMenu.js +0 -0
- /package/dist/cjs/{internal → src/internal}/ListBox/ListBoxMenuIcon.js +0 -0
- /package/dist/cjs/{internal → src/internal}/ListBox/ListBoxMenuItem.js +0 -0
- /package/dist/cjs/{internal → src/internal}/ListBox/ListBoxSelection.js +0 -0
- /package/dist/cjs/{internal → src/internal}/ListBox/index.js +0 -0
- /package/dist/cjs/{internal → src/internal}/keyboard/keys.js +0 -0
- /package/dist/cjs/{internal → src/internal}/keyboard/match.js +0 -0
- /package/dist/cjs/{internal → src/internal}/settings.js +0 -0
- /package/dist/cjs/{tools → src/tools}/accessibility.js +0 -0
- /package/dist/cjs/{tools → src/tools}/createPropAdapter.js +0 -0
- /package/dist/cjs/{tools → src/tools}/isUrl.js +0 -0
- /package/dist/cjs/{tools → src/tools}/setupGetInstanceId.js +0 -0
- /package/dist/cjs/{tools → src/tools}/useSetState.js +0 -0
- /package/dist/cjs/{tools → src/tools}/yupAst/astGenerator.js +0 -0
- /package/dist/cjs/{tools → src/tools}/yupAst/customValidators.js +0 -0
- /package/dist/esm/{components → src/components}/AboutPlatform/AboutPlatform.js +0 -0
- /package/dist/esm/{components → src/components}/AdvantageSideNav/AdvantageSideNav.js +0 -0
- /package/dist/esm/{components → src/components}/AutoSuggest/AutoSuggest.js +0 -0
- /package/dist/esm/{components → src/components}/Avatar/Avatar.js +0 -0
- /package/dist/esm/{components → src/components}/CheckboxList/CheckboxList.js +0 -0
- /package/dist/esm/{components → src/components}/ComboBox/ComboBox.js +0 -0
- /package/dist/esm/{components → src/components}/ComboBoxMultiSelect/ComboBoxMultiSelect.js +0 -0
- /package/dist/esm/{components → src/components}/ComboBoxMultiSelect/MultiSelect.js +0 -0
- /package/dist/esm/{components → src/components}/ComposedModal/ComposedModal.js +0 -0
- /package/dist/esm/{components → src/components}/ConfirmModal/ConfirmModal.js +0 -0
- /package/dist/esm/{components → src/components}/DateInput/DateInput.js +0 -0
- /package/dist/esm/{components → src/components}/DecisionButtons/DecisionButtons.js +0 -0
- /package/dist/esm/{components → src/components}/DelayedRender/DelayedRender.js +0 -0
- /package/dist/esm/{components → src/components}/Error403/Error403.js +0 -0
- /package/dist/esm/{components → src/components}/Error403/ForbiddenErrorBackground.js +0 -0
- /package/dist/esm/{components → src/components}/Error403/GraphicWrangler/GraphicWrangler.js +0 -0
- /package/dist/esm/{components → src/components}/Error404/Error404.js +0 -0
- /package/dist/esm/{components → src/components}/Error404/GraphicLoch/GraphicLoch.js +0 -0
- /package/dist/esm/{components → src/components}/Error404/NotFoundErrorBackground.js +0 -0
- /package/dist/esm/{components → src/components}/ErrorBoundary/ErrorBoundary.js +0 -0
- /package/dist/esm/{components → src/components}/ErrorDragon/ErrorDragon.js +0 -0
- /package/dist/esm/{components → src/components}/ErrorDragon/assets/ErrorGraphic.js +0 -0
- /package/dist/esm/{components → src/components}/ErrorFullPage/ErrorFullPage.js +0 -0
- /package/dist/esm/{components → src/components}/ErrorMessage/ErrorMessage.js +0 -0
- /package/dist/esm/{components → src/components}/ErrorPage/ErrorPage.js +0 -0
- /package/dist/esm/{components → src/components}/ErrorPageCore/ErrorPageCore.js +0 -0
- /package/dist/esm/{components → src/components}/ErrorPageCore/GenericErrorBackground.js +0 -0
- /package/dist/esm/{components → src/components}/FeatureHeader/FeatureHeader.js +0 -0
- /package/dist/esm/{components → src/components}/FeatureNavTab/FeatureNavTab.js +0 -0
- /package/dist/esm/{components → src/components}/FeatureNavTabs/FeatureNavTabs.js +0 -0
- /package/dist/esm/{components → src/components}/FeatureSideNav/FeatureSideNav.js +0 -0
- /package/dist/esm/{components → src/components}/FeatureSideNav/FeatureSideNavFooter.js +0 -0
- /package/dist/esm/{components → src/components}/FeatureSideNav/FeatureSideNavHeader.js +0 -0
- /package/dist/esm/{components → src/components}/FeatureSideNav/FeatureSideNavLinks.js +0 -0
- /package/dist/esm/{components → src/components}/FeatureSideNavLink/FeatureSideNavLink.js +0 -0
- /package/dist/esm/{components → src/components}/Feedback/Feedback.js +0 -0
- /package/dist/esm/{components → src/components}/FlowModal/FlowModal.js +0 -0
- /package/dist/esm/{components → src/components}/FlowModal/FlowModalForm.js +0 -0
- /package/dist/esm/{components → src/components}/Header/Header.js +0 -0
- /package/dist/esm/{components → src/components}/Header/HeaderAppSwitcher.js +0 -0
- /package/dist/esm/{components → src/components}/Header/HeaderMenu.js +0 -0
- /package/dist/esm/{components → src/components}/Header/HeaderMenuItem.js +0 -0
- /package/dist/esm/{components → src/components}/Header/HeaderTeamSwitcher.js +0 -0
- /package/dist/esm/{components → src/components}/Header/UserRequests.js +0 -0
- /package/dist/esm/{components → src/components}/ImageModal/ImageModal.js +0 -0
- /package/dist/esm/{components → src/components}/Loading/Loading.js +0 -0
- /package/dist/esm/{components → src/components}/MemberBar/MemberBar.js +0 -0
- /package/dist/esm/{components → src/components}/Modal/Modal.js +0 -0
- /package/dist/esm/{components → src/components}/ModalConfirmEdit/ModalConfirmArray.js +0 -0
- /package/dist/esm/{components → src/components}/ModalConfirmEdit/ModalConfirmDetails.js +0 -0
- /package/dist/esm/{components → src/components}/ModalConfirmEdit/ModalConfirmEdit.js +0 -0
- /package/dist/esm/{components → src/components}/ModalForm/ModalForm.js +0 -0
- /package/dist/esm/{components → src/components}/Notifications/NotificationsContainer.js +0 -0
- /package/dist/esm/{components → src/components}/Notifications/ToastNotification.js +0 -0
- /package/dist/esm/{components → src/components}/Notifications/notify.js +0 -0
- /package/dist/esm/{components → src/components}/PlatformBanner/PlatformBanner.js +0 -0
- /package/dist/esm/{components → src/components}/PlatformNotifications/PlatformNotification.js +0 -0
- /package/dist/esm/{components → src/components}/PlatformNotifications/PlatformNotificationsContainer.js +0 -0
- /package/dist/esm/{components → src/components}/Portal/Portal.js +0 -0
- /package/dist/esm/{components → src/components}/PrivacyRedirect/PrivacyRedirect.js +0 -0
- /package/dist/esm/{components → src/components}/PrivacyStatement/PrivacyStatement.js +0 -0
- /package/dist/esm/{components → src/components}/ProfileSettings/ProfileSettings.js +0 -0
- /package/dist/esm/{components → src/components}/ProtectedRoute/ProtectedRoute.js +0 -0
- /package/dist/esm/{components → src/components}/RadioGroup/RadioGroup.js +0 -0
- /package/dist/esm/{components → src/components}/RichTextArea/RichTextArea.js +0 -0
- /package/dist/esm/{components → src/components}/SignOut/SignOut.js +0 -0
- /package/dist/esm/{components → src/components}/SupportCenter/SupportCenter.js +0 -0
- /package/dist/esm/{components → src/components}/TextArea/TextArea.js +0 -0
- /package/dist/esm/{components → src/components}/TextInput/TextInput.js +0 -0
- /package/dist/esm/{components → src/components}/Toggle/Toggle.js +0 -0
- /package/dist/esm/{components → src/components}/TooltipHover/TooltipHover.js +0 -0
- /package/dist/esm/{components → src/components}/UIShell/UIShell.js +0 -0
- /package/dist/esm/{config → src/config}/servicesConfig.js +0 -0
- /package/dist/esm/{constants → src/constants}/TeamTypes.js +0 -0
- /package/dist/esm/{constants → src/constants}/UserType.js +0 -0
- /package/dist/esm/{hooks → src/hooks}/useHeaderMenu.js +0 -0
- /package/dist/esm/{hooks → src/hooks}/usePortal.js +0 -0
- /package/dist/esm/{hooks → src/hooks}/useWindowSize.js +0 -0
- /package/dist/esm/{index.js → src/index.js} +0 -0
- /package/dist/esm/{internal → src/internal}/ListBox/ListBox.js +0 -0
- /package/dist/esm/{internal → src/internal}/ListBox/ListBoxField.js +0 -0
- /package/dist/esm/{internal → src/internal}/ListBox/ListBoxMenu.js +0 -0
- /package/dist/esm/{internal → src/internal}/ListBox/ListBoxMenuIcon.js +0 -0
- /package/dist/esm/{internal → src/internal}/ListBox/ListBoxMenuItem.js +0 -0
- /package/dist/esm/{internal → src/internal}/ListBox/ListBoxSelection.js +0 -0
- /package/dist/esm/{internal → src/internal}/ListBox/index.js +0 -0
- /package/dist/esm/{internal → src/internal}/keyboard/keys.js +0 -0
- /package/dist/esm/{internal → src/internal}/keyboard/match.js +0 -0
- /package/dist/esm/{internal → src/internal}/settings.js +0 -0
- /package/dist/esm/{tools → src/tools}/accessibility.js +0 -0
- /package/dist/esm/{tools → src/tools}/createPropAdapter.js +0 -0
- /package/dist/esm/{tools → src/tools}/isUrl.js +0 -0
- /package/dist/esm/{tools → src/tools}/setupGetInstanceId.js +0 -0
- /package/dist/esm/{tools → src/tools}/useSetState.js +0 -0
- /package/dist/esm/{tools → src/tools}/yupAst/astGenerator.js +0 -0
- /package/dist/esm/{tools → src/tools}/yupAst/customValidators.js +0 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { useMemo, useLayoutEffect, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
function useCombinedRefs() {
|
|
4
|
+
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
5
|
+
refs[_key] = arguments[_key];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
return useMemo(() => node => {
|
|
9
|
+
refs.forEach(ref => ref(node));
|
|
10
|
+
}, // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
11
|
+
refs);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js
|
|
15
|
+
const canUseDOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined';
|
|
16
|
+
|
|
17
|
+
function isWindow(element) {
|
|
18
|
+
const elementString = Object.prototype.toString.call(element);
|
|
19
|
+
return elementString === '[object Window]' || // In Electron context the Window object serializes to [object global]
|
|
20
|
+
elementString === '[object global]';
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function isNode(node) {
|
|
24
|
+
return 'nodeType' in node;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function getWindow(target) {
|
|
28
|
+
var _target$ownerDocument, _target$ownerDocument2;
|
|
29
|
+
|
|
30
|
+
if (!target) {
|
|
31
|
+
return window;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (isWindow(target)) {
|
|
35
|
+
return target;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (!isNode(target)) {
|
|
39
|
+
return window;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return (_target$ownerDocument = (_target$ownerDocument2 = target.ownerDocument) == null ? void 0 : _target$ownerDocument2.defaultView) != null ? _target$ownerDocument : window;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* A hook that resolves to useEffect on the server and useLayoutEffect on the client
|
|
47
|
+
* @param callback {function} Callback function that is invoked when the dependencies of the hook change
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
const useIsomorphicLayoutEffect = canUseDOM ? useLayoutEffect : useEffect;
|
|
51
|
+
|
|
52
|
+
let ids = {};
|
|
53
|
+
function useUniqueId(prefix, value) {
|
|
54
|
+
return useMemo(() => {
|
|
55
|
+
if (value) {
|
|
56
|
+
return value;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const id = ids[prefix] == null ? 0 : ids[prefix] + 1;
|
|
60
|
+
ids[prefix] = id;
|
|
61
|
+
return prefix + "-" + id;
|
|
62
|
+
}, [prefix, value]);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function isKeyboardEvent(event) {
|
|
66
|
+
if (!event) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const {
|
|
71
|
+
KeyboardEvent
|
|
72
|
+
} = getWindow(event.target);
|
|
73
|
+
return KeyboardEvent && event instanceof KeyboardEvent;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const CSS = /*#__PURE__*/Object.freeze({
|
|
77
|
+
Translate: {
|
|
78
|
+
toString(transform) {
|
|
79
|
+
if (!transform) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const {
|
|
84
|
+
x,
|
|
85
|
+
y
|
|
86
|
+
} = transform;
|
|
87
|
+
return "translate3d(" + (x ? Math.round(x) : 0) + "px, " + (y ? Math.round(y) : 0) + "px, 0)";
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
},
|
|
91
|
+
Scale: {
|
|
92
|
+
toString(transform) {
|
|
93
|
+
if (!transform) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const {
|
|
98
|
+
scaleX,
|
|
99
|
+
scaleY
|
|
100
|
+
} = transform;
|
|
101
|
+
return "scaleX(" + scaleX + ") scaleY(" + scaleY + ")";
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
},
|
|
105
|
+
Transform: {
|
|
106
|
+
toString(transform) {
|
|
107
|
+
if (!transform) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return [CSS.Translate.toString(transform), CSS.Scale.toString(transform)].join(' ');
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
},
|
|
115
|
+
Transition: {
|
|
116
|
+
toString(_ref) {
|
|
117
|
+
let {
|
|
118
|
+
property,
|
|
119
|
+
duration,
|
|
120
|
+
easing
|
|
121
|
+
} = _ref;
|
|
122
|
+
return property + " " + duration + "ms " + easing;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
export { CSS, canUseDOM, getWindow, isKeyboardEvent, isNode, isWindow, useCombinedRefs, useIsomorphicLayoutEffect, useUniqueId };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { TextInput, Button, Tag } from '@carbon/react';
|
|
3
|
-
import { Information, Add } from '@carbon/react/icons';
|
|
2
|
+
import { TextInput, Button, Tag, DismissibleTag } from '@carbon/react';
|
|
3
|
+
import { Information, Add, Draggable } from '@carbon/react/icons';
|
|
4
|
+
import { useSensors, useSensor, PointerSensor, DndContext, closestCenter } from '@dnd-kit/core';
|
|
5
|
+
import { SortableContext, verticalListSortingStrategy, useSortable, arrayMove } from '../../../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';
|
|
6
|
+
import { CSS } from '../../../node_modules/.pnpm/@dnd-kit_utilities@3.2.2_react@16.14.0/node_modules/@dnd-kit/utilities/dist/utilities.esm.js';
|
|
4
7
|
import cx from 'classnames';
|
|
5
8
|
import TooltipHover from '../TooltipHover/TooltipHover.js';
|
|
6
9
|
import { isAccessibleKeyDownEvent } from '../../tools/accessibility.js';
|
|
@@ -11,7 +14,7 @@ IBM Confidential
|
|
|
11
14
|
694970X, 69497O0
|
|
12
15
|
© Copyright IBM Corp. 2022, 2024
|
|
13
16
|
*/
|
|
14
|
-
function CreatableComponent({ buttonClassName = `${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 = `${prefix}--bmrg-creatable__tooltip`, tooltipContent, tooltipProps = { direction: "top" }, type = "text", valueHelperText, valueLabel, valueLabelText, valuePlaceholder, value: externalValues, values, trimInput = false, removeOnlyFirst = false, }) {
|
|
17
|
+
function CreatableComponent({ buttonClassName = `${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 = `${prefix}--bmrg-creatable__tooltip`, tooltipContent, tooltipProps = { direction: "top" }, type = "text", valueHelperText, valueLabel, valueLabelText, valuePlaceholder, value: externalValues, values, trimInput = false, removeOnlyFirst = false, }) {
|
|
15
18
|
const [keyValue, setKeyValue] = useState("");
|
|
16
19
|
const [value, setValue] = useState("");
|
|
17
20
|
const [input, setInput] = useState("");
|
|
@@ -119,6 +122,21 @@ function CreatableComponent({ buttonClassName = `${prefix}--bmrg-creatable__butt
|
|
|
119
122
|
if (onChange)
|
|
120
123
|
onChange(items);
|
|
121
124
|
};
|
|
125
|
+
const sensors = useSensors(useSensor(PointerSensor, {
|
|
126
|
+
activationConstraint: { distance: 5 },
|
|
127
|
+
}));
|
|
128
|
+
function handleDragEnd(event) {
|
|
129
|
+
const { active, over } = event;
|
|
130
|
+
if (over && active.id !== over.id) {
|
|
131
|
+
const oldIndex = tagItems.indexOf(active.id);
|
|
132
|
+
const newIndex = tagItems.indexOf(over.id);
|
|
133
|
+
const reorderedItems = arrayMove(tagItems, oldIndex, newIndex);
|
|
134
|
+
setCreatedItems(reorderedItems);
|
|
135
|
+
if (onChange) {
|
|
136
|
+
onChange(reorderedItems);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
122
140
|
return (React.createElement("div", { key: key, className: `${prefix}--bmrg-creatable` },
|
|
123
141
|
React.createElement("div", { className: `${prefix}--bmrg-creatable__input` },
|
|
124
142
|
createKeyValuePair ? (React.createElement("div", { className: `${prefix}--bmrg-creatable__key-value-inputs` },
|
|
@@ -140,9 +158,20 @@ function CreatableComponent({ buttonClassName = `${prefix}--bmrg-creatable__butt
|
|
|
140
158
|
React.createElement(TooltipHover, { ...tooltipProps, tooltipText: tooltipContent },
|
|
141
159
|
React.createElement(Information, { size: 16, fill: "currentColor" }))))), onBlur: onInputBlur, onChange: onInputChange, placeholder: placeholder, ref: inputRef, type: type, value: input, ...textInputProps })),
|
|
142
160
|
React.createElement(Button, { className: createButtonClassName, disabled: isAddButtonDisabled, onClick: addValue, iconDescription: "Add", renderIcon: Add, size: "md", type: "button", ...buttonProps }, buttonContent)),
|
|
143
|
-
|
|
161
|
+
reorderable ? (React.createElement(DndContext, { sensors: disabled ? [] : sensors, collisionDetection: closestCenter, onDragEnd: handleDragEnd },
|
|
162
|
+
React.createElement(SortableContext, { items: tagsToShow, strategy: verticalListSortingStrategy },
|
|
163
|
+
React.createElement("div", { className: `${prefix}--bmrg-creatable__tags--reorderable` }, tagsToShow.map((item, index) => (React.createElement(ReorderableTag, { key: `${item}-${index}`, disabled: disabled, initialTagItems: initialTagItems, item: item, nonDeletable: nonDeletable, removeValue: removeValue, tagProps: tagProps, tagType: tagType }))))))) : (React.createElement("div", { className: `${prefix}--bmrg-creatable__tags` }, tagsToShow.map((item, index) => (React.createElement(Tag, { key: `${item}-${index}`, disabled: disabled, type: tagType, onClick: nonDeletable && initialTagItems.includes(item) ? undefined : () => removeValue(item), onKeyDown: nonDeletable && initialTagItems.includes(item)
|
|
144
164
|
? undefined
|
|
145
|
-
: (e) => isAccessibleKeyDownEvent(e) && removeValue(item), filter: !nonDeletable || (nonDeletable && !initialTagItems.includes(item)), ...tagProps }, item))))));
|
|
165
|
+
: (e) => isAccessibleKeyDownEvent(e) && removeValue(item), filter: !nonDeletable || (nonDeletable && !initialTagItems.includes(item)), ...tagProps }, item)))))));
|
|
166
|
+
}
|
|
167
|
+
function ReorderableTag({ disabled, initialTagItems, item, nonDeletable, removeValue, tagProps, tagType, }) {
|
|
168
|
+
const { attributes, listeners, setNodeRef, transform, transition } = useSortable({ id: item });
|
|
169
|
+
const style = {
|
|
170
|
+
transform: CSS.Transform.toString(transform),
|
|
171
|
+
transition,
|
|
172
|
+
};
|
|
173
|
+
return (React.createElement("div", { ref: setNodeRef, ...attributes, ...(!disabled ? listeners : {}), style: style },
|
|
174
|
+
React.createElement(DismissibleTag, { disabled: disabled, type: tagType, onClose: nonDeletable && initialTagItems.includes(item) ? undefined : () => removeValue(item), renderIcon: Draggable, title: "", text: item, ...tagProps })));
|
|
146
175
|
}
|
|
147
176
|
|
|
148
177
|
export { CreatableComponent as default };
|
|
@@ -109,9 +109,18 @@ function DataDrivenInput(props) {
|
|
|
109
109
|
Component = Creatable;
|
|
110
110
|
componentProps = {
|
|
111
111
|
...allInputProps,
|
|
112
|
-
createKeyValuePair: type === CREATABLE_TYPES.CREATABLE_PAIR ||
|
|
112
|
+
createKeyValuePair: type === CREATABLE_TYPES.CREATABLE_PAIR ||
|
|
113
|
+
type === CREATABLE_TYPES.CREATABLE_PAIR_NON_DELETABLE ||
|
|
114
|
+
type === CREATABLE_TYPES.CREATABLE_PAIR_REORDERABLE ||
|
|
115
|
+
type === CREATABLE_TYPES.CREATABLE_PAIR_REORDERABLE_NON_DELETABLE,
|
|
113
116
|
nonDeletable: type === CREATABLE_TYPES.CREATABLE_SINGLE_NON_DELETABLE ||
|
|
114
|
-
type === CREATABLE_TYPES.
|
|
117
|
+
type === CREATABLE_TYPES.CREATABLE_SINGLE_REORDERABLE_NON_DELETABLE ||
|
|
118
|
+
type === CREATABLE_TYPES.CREATABLE_PAIR_NON_DELETABLE ||
|
|
119
|
+
type === CREATABLE_TYPES.CREATABLE_PAIR_REORDERABLE_NON_DELETABLE,
|
|
120
|
+
reorderable: type === CREATABLE_TYPES.CREATABLE_SINGLE_REORDERABLE ||
|
|
121
|
+
type === CREATABLE_TYPES.CREATABLE_SINGLE_REORDERABLE_NON_DELETABLE ||
|
|
122
|
+
type === CREATABLE_TYPES.CREATABLE_PAIR_REORDERABLE ||
|
|
123
|
+
type === CREATABLE_TYPES.CREATABLE_PAIR_REORDERABLE_NON_DELETABLE,
|
|
115
124
|
invalid: invalidInput,
|
|
116
125
|
invalidText: invalidTextMessage,
|
|
117
126
|
placeholder,
|
|
@@ -106,7 +106,13 @@ async function handleGoverningSelectChange({ formikProps, input, inputs, isInput
|
|
|
106
106
|
/** Erase value of governed inputs */
|
|
107
107
|
if (inputsGovernedByCurrentOne.length) {
|
|
108
108
|
await inputsGovernedByCurrentOne.forEach(async (input) => {
|
|
109
|
-
await handleGoverningSelectChange({
|
|
109
|
+
await handleGoverningSelectChange({
|
|
110
|
+
formikProps,
|
|
111
|
+
input,
|
|
112
|
+
inputs,
|
|
113
|
+
isInputBeingChanged: false,
|
|
114
|
+
selectedItem: null,
|
|
115
|
+
});
|
|
110
116
|
});
|
|
111
117
|
}
|
|
112
118
|
// only the top governing select should display warnings if changed and reset touched status for governed ones
|
|
@@ -198,8 +204,12 @@ function generateYupAst({ inputs, allowCustomPropertySyntax, customPropertySynta
|
|
|
198
204
|
if (inputType === MULTI_SELECT_TYPES.MULTI_SELECT ||
|
|
199
205
|
inputType === CREATABLE_TYPES.CREATABLE_SINGLE ||
|
|
200
206
|
inputType === CREATABLE_TYPES.CREATABLE_SINGLE_NON_DELETABLE ||
|
|
207
|
+
inputType === CREATABLE_TYPES.CREATABLE_SINGLE_REORDERABLE ||
|
|
208
|
+
inputType === CREATABLE_TYPES.CREATABLE_SINGLE_REORDERABLE_NON_DELETABLE ||
|
|
201
209
|
inputType === CREATABLE_TYPES.CREATABLE_PAIR ||
|
|
202
210
|
inputType === CREATABLE_TYPES.CREATABLE_PAIR_NON_DELETABLE ||
|
|
211
|
+
inputType === CREATABLE_TYPES.CREATABLE_PAIR_REORDERABLE ||
|
|
212
|
+
inputType === CREATABLE_TYPES.CREATABLE_PAIR_REORDERABLE_NON_DELETABLE ||
|
|
203
213
|
inputType === CHECKBOX_TYPES.CHECKBOX) {
|
|
204
214
|
if (useCSVforArrays) {
|
|
205
215
|
yupValidationArray.push(["yup.string"]);
|
|
@@ -9,8 +9,12 @@ const CHECKBOX_TYPES = {
|
|
|
9
9
|
const CREATABLE_TYPES = {
|
|
10
10
|
CREATABLE_SINGLE: "creatable-single",
|
|
11
11
|
CREATABLE_SINGLE_NON_DELETABLE: "creatable-single-non-deletable",
|
|
12
|
+
CREATABLE_SINGLE_REORDERABLE: "creatable-single-reorderable",
|
|
13
|
+
CREATABLE_SINGLE_REORDERABLE_NON_DELETABLE: "creatable-single-reorderable-non-deletable",
|
|
12
14
|
CREATABLE_PAIR: "creatable-pair",
|
|
13
15
|
CREATABLE_PAIR_NON_DELETABLE: "creatable-pair-non-deletable",
|
|
16
|
+
CREATABLE_PAIR_REORDERABLE: "creatable-pair-reorderable",
|
|
17
|
+
CREATABLE_PAIR_REORDERABLE_NON_DELETABLE: "creatable-pair-reorderable-non-deletable",
|
|
14
18
|
};
|
|
15
19
|
const DATE_TYPES = {
|
|
16
20
|
DATE: "date",
|
package/dist/types/index.d.ts
CHANGED
|
@@ -657,6 +657,7 @@ type Props$y = {
|
|
|
657
657
|
onChange?: (items: string[]) => void;
|
|
658
658
|
placeholder?: string;
|
|
659
659
|
readOnly?: boolean;
|
|
660
|
+
reorderable?: boolean;
|
|
660
661
|
tagProps?: any;
|
|
661
662
|
tagType?: string;
|
|
662
663
|
textInputProps?: any;
|
|
@@ -671,7 +672,7 @@ type Props$y = {
|
|
|
671
672
|
value?: string | string[];
|
|
672
673
|
values?: string | string[];
|
|
673
674
|
};
|
|
674
|
-
declare function CreatableComponent({ buttonClassName, buttonContent, buttonProps, createKeyValuePair, disabled, id, initialValues: externalInitialValues, invalid, invalidText, helperText, key, keyHelperText, keyLabel, keyLabelText, keyPlaceholder, label, labelText, max, nonDeletable, onKeyBlur, onValueBlur, onInputBlur, onChange, placeholder, tagProps, tagType, textInputProps, tooltipClassName, tooltipContent, tooltipProps, type, valueHelperText, valueLabel, valueLabelText, valuePlaceholder, value: externalValues, values, trimInput, removeOnlyFirst, }: Props$y): React.JSX.Element;
|
|
675
|
+
declare function CreatableComponent({ buttonClassName, buttonContent, buttonProps, createKeyValuePair, disabled, id, initialValues: externalInitialValues, invalid, invalidText, helperText, key, keyHelperText, keyLabel, keyLabelText, keyPlaceholder, label, labelText, max, nonDeletable, onKeyBlur, onValueBlur, onInputBlur, onChange, placeholder, reorderable, tagProps, tagType, textInputProps, tooltipClassName, tooltipContent, tooltipProps, type, valueHelperText, valueLabel, valueLabelText, valuePlaceholder, value: externalValues, values, trimInput, removeOnlyFirst, }: Props$y): React.JSX.Element;
|
|
675
676
|
|
|
676
677
|
type OwnDataDrivenInputProps = {
|
|
677
678
|
id?: string;
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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.12",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Tim Bula",
|
|
7
7
|
"email": "timrbula@gmail.com"
|
|
8
8
|
},
|
|
9
9
|
"license": "Apache-2",
|
|
10
|
-
"repository": {
|
|
10
|
+
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
12
|
"url": "git@github.com:boomerang-io/carbon-addons-boomerang-react"
|
|
13
13
|
},
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@carbon/ibm-products": "2.57.1",
|
|
51
51
|
"@carbon/react": "1.77.0",
|
|
52
|
+
"@dnd-kit/core": "^6.3.1",
|
|
52
53
|
"@stomp/stompjs": "6.1.2",
|
|
53
54
|
"@tippyjs/react": "4.2.6",
|
|
54
55
|
"classnames": "2.3.2",
|
|
@@ -4,7 +4,6 @@ IBM Confidential
|
|
|
4
4
|
© Copyright IBM Corp. 2022, 2024
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
8
7
|
@use "../../global/config" as *;
|
|
9
8
|
.#{$prefix}--bmrg-creatable {
|
|
10
9
|
position: relative;
|
|
@@ -42,6 +41,36 @@ IBM Confidential
|
|
|
42
41
|
width: 100%;
|
|
43
42
|
}
|
|
44
43
|
|
|
44
|
+
.#{$prefix}--bmrg-creatable__tags--reorderable {
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
width: 100%;
|
|
48
|
+
|
|
49
|
+
.cds--tag {
|
|
50
|
+
cursor: grab;
|
|
51
|
+
margin-left: 0;
|
|
52
|
+
min-width: 100%;
|
|
53
|
+
width: 100%;
|
|
54
|
+
|
|
55
|
+
.cds--tag__custom-icon ~ span {
|
|
56
|
+
min-width: calc(100% - 1.25rem);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.cds--interactive--tag-children {
|
|
60
|
+
max-inline-size: none !important;
|
|
61
|
+
width: 100%;
|
|
62
|
+
|
|
63
|
+
.cds--popover {
|
|
64
|
+
display: none;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.cds--tag__label {
|
|
69
|
+
min-width: calc(100% - 1.5rem);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
45
74
|
.#{$prefix}--bmrg-creatable__tooltip {
|
|
46
75
|
line-height: 0;
|
|
47
76
|
margin-left: 0.5rem;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/cjs/{components → src/components}/PlatformNotifications/PlatformNotification.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|