@geneui/components 3.0.0-next-06dadf3-29102024 → 3.0.0-next-63cb5e7-01112024
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/Avatar.js +63 -0
- package/Divider.js +23 -0
- package/{GeneUIProvider/index.js → GeneUIProvider.js} +51 -64
- package/HelperText.js +69 -0
- package/Info.js +64 -0
- package/Label.js +38 -0
- package/Loader.js +21 -0
- package/Pill.js +64 -0
- package/TextLink.js +20 -0
- package/{index-c7646e48.js → Tooltip.js} +101 -79
- package/{lib → components}/atoms/Avatar/Avatar.d.ts +7 -6
- package/components/atoms/Avatar/index.d.ts +1 -0
- package/{lib → components}/atoms/Divider/Divider.d.ts +5 -5
- package/components/atoms/Divider/index.d.ts +1 -0
- package/{lib → components}/atoms/HelperText/HelperText.d.ts +6 -5
- package/components/atoms/HelperText/index.d.ts +1 -0
- package/{lib → components}/atoms/Info/Info.d.ts +5 -5
- package/components/atoms/Info/index.d.ts +1 -0
- package/{lib → components}/atoms/Label/Label.d.ts +3 -3
- package/components/atoms/Label/index.d.ts +1 -0
- package/{lib → components}/atoms/Loader/Loader.d.ts +5 -5
- package/components/atoms/Loader/index.d.ts +1 -0
- package/{lib → components}/atoms/Pill/Pill.d.ts +7 -6
- package/components/atoms/Pill/index.d.ts +1 -0
- package/{lib → components}/atoms/TextLink/TextLink.d.ts +5 -5
- package/components/atoms/TextLink/index.d.ts +1 -0
- package/{lib → components}/molecules/Tooltip/Tooltip.d.ts +26 -21
- package/components/molecules/Tooltip/index.d.ts +1 -0
- package/components/providers/GeneUIProvider/GeneUIProvider.d.ts +30 -0
- package/components/providers/GeneUIProvider/index.d.ts +1 -0
- package/hooks/index.d.ts +2 -20
- package/hooks/useDebounceCallback/index.d.ts +1 -0
- package/hooks/useDebounceCallback/useDebounceCallback.d.ts +2 -0
- package/hooks/useEllipsisDetection/index.d.ts +1 -1
- package/hooks/useEllipsisDetection/useEllipsisDetection.d.ts +2 -2
- package/{index-031ff73c.js → index-ce02421b.js} +4 -4
- package/index.d.ts +11 -121
- package/index.js +12 -159
- package/package.json +24 -43
- package/tokens-0abb4e1b.js +6 -0
- package/types/index.d.ts +0 -3
- package/useEllipsisDetection-46d712b6.js +34 -0
- package/ActionableList/index.js +0 -1694
- package/AdvancedSearch/index.js +0 -892
- package/Alert/index.js +0 -98
- package/Avatar/index.js +0 -58
- package/Badge/index.js +0 -29
- package/Breadcrumb/index.js +0 -130
- package/BusyLoader/index.js +0 -31
- package/Button/index.js +0 -30
- package/Card/index.js +0 -502
- package/CardList/index.js +0 -662
- package/CellMeasurerCache-26f3693c.js +0 -229
- package/Charts/index.js +0 -17662
- package/Checkbox/index.js +0 -229
- package/CheckboxGroup/index.js +0 -203
- package/CheckboxGroupWithSearch/index.js +0 -280
- package/Collapse/index.js +0 -195
- package/ColorPicker/index.js +0 -210
- package/ComboBox/index.js +0 -524
- package/Copy/index.js +0 -56
- package/Counter/index.js +0 -312
- package/DateFilter/index.js +0 -183
- package/DatePicker/index.js +0 -1229
- package/DatePickerInput/index.js +0 -883
- package/Divider/index.js +0 -23
- package/Drawer/index.js +0 -261
- package/Dropdown/index.js +0 -43
- package/Editor/index.js +0 -22975
- package/Empty/index.js +0 -76
- package/ExtendedInput/index.js +0 -590
- package/Form/index.js +0 -85
- package/FormContainer/index.js +0 -189
- package/FormableCheckbox/index.js +0 -24
- package/FormableDatePicker/index.js +0 -43
- package/FormableDropdown/index.js +0 -50
- package/FormableEditor/index.js +0 -26
- package/FormableHOC-85f89a81.js +0 -83
- package/FormableMultiSelectDropdown/index.js +0 -50
- package/FormableNumberInput/index.js +0 -34
- package/FormableRadio/index.js +0 -22
- package/FormableSwitcher/index.js +0 -22
- package/FormableTextInput/index.js +0 -34
- package/FormableUploader/index.js +0 -44
- package/Grid/index.js +0 -167
- package/HelperText/index.js +0 -86
- package/Holder/index.js +0 -261
- package/Icon/index.js +0 -62
- package/Image/index.js +0 -45
- package/ImagePreview/index.js +0 -217
- package/Info/index.js +0 -41
- package/InfoOutline-dd2e89d9.js +0 -29
- package/InteractiveWidget/index.js +0 -78
- package/KeyValue/index.js +0 -22
- package/Label/index.js +0 -48
- package/LinkButton/index.js +0 -34
- package/Loader/index.js +0 -23
- package/Menu/index.js +0 -281
- package/MobileNavigation/index.js +0 -94
- package/MobilePopup/index.js +0 -182
- package/Modal/index.js +0 -251
- package/ModuleTitle/index.js +0 -141
- package/NavigationMenu/index.js +0 -222
- package/Notification/index.js +0 -120
- package/Option/index.js +0 -184
- package/Overlay/index.js +0 -187
- package/Overspread/index.js +0 -291
- package/Pagination/index.js +0 -261
- package/Paper/index.js +0 -96
- package/Pill/index.js +0 -67
- package/Popover/index.js +0 -725
- package/PopoverV2/index.js +0 -19
- package/Portal/index.js +0 -58
- package/Products/index.js +0 -115
- package/Profile/index.js +0 -589
- package/Progress/index.js +0 -200
- package/QRCode/index.js +0 -814
- package/Radio/index.js +0 -151
- package/RadioGroup/index.js +0 -104
- package/Range/index.js +0 -191
- package/Rating/index.js +0 -174
- package/RichEditor/index.js +0 -13
- package/RichEditor-6ca8346f.js +0 -228
- package/Scrollbar/index.js +0 -1585
- package/Search/index.js +0 -75
- package/SearchWithDropdown/index.js +0 -140
- package/Section/index.js +0 -61
- package/SkeletonLoader/index.js +0 -81
- package/Slider/index.js +0 -261
- package/Status/index.js +0 -97
- package/Steps/index.js +0 -314
- package/SuggestionList/index.js +0 -385
- package/Switcher/index.js +0 -193
- package/Table/index.js +0 -57
- package/TableCompositions/index.js +0 -16995
- package/Tabs/index.js +0 -235
- package/Tag/index.js +0 -102
- package/TextLink/index.js +0 -20
- package/Textarea/index.js +0 -242
- package/Time/index.js +0 -62
- package/TimePicker/index.js +0 -575
- package/Timeline/index.js +0 -113
- package/Title/index.js +0 -65
- package/Toaster/index.js +0 -116
- package/Tooltip/index.js +0 -6
- package/TransferList/index.js +0 -493
- package/Uploader/index.js +0 -992
- package/ValidatableCheckbox/index.js +0 -123
- package/ValidatableDatePicker/index.js +0 -316
- package/ValidatableDropdown/index.js +0 -141
- package/ValidatableElements/index.js +0 -67
- package/ValidatableMultiSelectDropdown/index.js +0 -152
- package/ValidatableNumberInput/index.js +0 -204
- package/ValidatableRadio/index.js +0 -116
- package/ValidatableSwitcher/index.js +0 -93
- package/ValidatableTextInput/index.js +0 -167
- package/ValidatableTimeInput/index.js +0 -174
- package/ValidatableUploader/index.js +0 -98
- package/Widget/index.js +0 -225
- package/_commonjsHelpers-24198af3.js +0 -35
- package/_rollupPluginBabelHelpers-a83240e1.js +0 -11
- package/callAfterDelay-7272faca.js +0 -12
- package/checkTimeValidation-e56771be.js +0 -16
- package/checkboxRadioSwitcher-5b69d7bd.js +0 -4
- package/clsx.m-2bb6df4b.js +0 -3
- package/config-1053d64d.js +0 -20
- package/configs-00612ce0.js +0 -103
- package/configs.js +0 -111
- package/dateValidation-67caec66.js +0 -225
- package/debounce-4419bc2f.js +0 -17
- package/guid-8ddf77b3.js +0 -16
- package/hooks/useBodyScroll.js +0 -16
- package/hooks/useClick.js +0 -18
- package/hooks/useClickOutside.js +0 -25
- package/hooks/useDebounce.js +0 -28
- package/hooks/useDeviceType.js +0 -17
- package/hooks/useDidMount.js +0 -15
- package/hooks/useForceUpdate.js +0 -8
- package/hooks/useHover.js +0 -20
- package/hooks/useImgDownload.js +0 -18
- package/hooks/useKeyDown.js +0 -21
- package/hooks/useMount.js +0 -13
- package/hooks/useMutationObserver.js +0 -21
- package/hooks/usePrevious.js +0 -10
- package/hooks/useThrottle.js +0 -16
- package/hooks/useToggle.js +0 -11
- package/hooks/useUpdatableRef.js +0 -14
- package/hooks/useUpdate.js +0 -10
- package/hooks/useWidth.js +0 -16
- package/hooks/useWindowSize.js +0 -40
- package/index-122432cd.js +0 -270
- package/index-262edd7a.js +0 -77
- package/index-3188e46e.js +0 -1940
- package/index-45eafea6.js +0 -90
- package/index-5f37f281.js +0 -168
- package/index-ce12e4a9.js +0 -10032
- package/index-d0ecb950.js +0 -6483
- package/index-fcbae78d.js +0 -4
- package/index.mobile.d.ts +0 -14
- package/lib/atoms/Avatar/index.d.ts +0 -1
- package/lib/atoms/Badge/Badge.d.ts +0 -36
- package/lib/atoms/Badge/index.d.ts +0 -1
- package/lib/atoms/BusyLoader/BusyLoader.d.ts +0 -32
- package/lib/atoms/BusyLoader/BusyLoaderHolderHOC.d.ts +0 -8
- package/lib/atoms/BusyLoader/index.d.ts +0 -1
- package/lib/atoms/Button/Button.d.ts +0 -70
- package/lib/atoms/Button/index.d.ts +0 -1
- package/lib/atoms/Divider/index.d.ts +0 -1
- package/lib/atoms/Empty/Empty.d.ts +0 -39
- package/lib/atoms/Empty/index.d.ts +0 -1
- package/lib/atoms/Empty/utils.d.ts +0 -9
- package/lib/atoms/HelperText/index.d.ts +0 -1
- package/lib/atoms/Image/Image.d.ts +0 -51
- package/lib/atoms/Image/index.d.ts +0 -1
- package/lib/atoms/ImagePreview/ImagePreview.d.ts +0 -56
- package/lib/atoms/ImagePreview/ImagePreviewHOC.d.ts +0 -4
- package/lib/atoms/ImagePreview/Magnifier.d.ts +0 -40
- package/lib/atoms/ImagePreview/index.d.ts +0 -1
- package/lib/atoms/Info/index.d.ts +0 -1
- package/lib/atoms/KeyValue/KeyValue.d.ts +0 -29
- package/lib/atoms/KeyValue/index.d.ts +0 -1
- package/lib/atoms/Label/index.d.ts +0 -1
- package/lib/atoms/LinkButton/LinkButton.d.ts +0 -46
- package/lib/atoms/LinkButton/index.d.ts +0 -1
- package/lib/atoms/Loader/index.d.ts +0 -1
- package/lib/atoms/Pill/index.d.ts +0 -1
- package/lib/atoms/Rating/DefaultSvg.d.ts +0 -3
- package/lib/atoms/Rating/Rating.d.ts +0 -49
- package/lib/atoms/Rating/index.d.ts +0 -1
- package/lib/atoms/TextLink/index.d.ts +0 -1
- package/lib/molecules/Copy/Copy.d.ts +0 -38
- package/lib/molecules/Copy/index.d.ts +0 -1
- package/lib/molecules/InteractiveWidget/InteractiveWidget.d.ts +0 -70
- package/lib/molecules/InteractiveWidget/InteractiveWidgetIcon.d.ts +0 -8
- package/lib/molecules/InteractiveWidget/index.d.ts +0 -1
- package/lib/molecules/Tooltip/index.d.ts +0 -1
- package/lib/providers/GeneUIProvider/GeneUIProvider.d.ts +0 -30
- package/lib/providers/GeneUIProvider/index.d.ts +0 -1
- package/localization-4ba17032.js +0 -46
- package/objectWithoutPropertiesLoose-e1596bdb.js +0 -62
- package/rangeAndSlider-740a236c.js +0 -8676
- package/react-beautiful-dnd.esm-8c7b5a83.js +0 -10116
- package/react-lifecycles-compat.es-6e1f3768.js +0 -158
- package/redux-e591c1b8.js +0 -536
- package/tokens-8ab1179c.js +0 -6
- package/tslib.es6-f211516f.js +0 -35
- package/useEllipsisDetection-c1c9ad94.js +0 -38
package/TransferList/index.js
DELETED
|
@@ -1,493 +0,0 @@
|
|
|
1
|
-
import React__default, { forwardRef, useState, useMemo, useEffect, useCallback } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { P as PublicDraggable, C as ConnectedDroppable, D as DragDropContext } from '../react-beautiful-dnd.esm-8c7b5a83.js';
|
|
4
|
-
import { c as classnames } from '../index-031ff73c.js';
|
|
5
|
-
import { n as noop } from '../index-5f37f281.js';
|
|
6
|
-
import '../configs-00612ce0.js';
|
|
7
|
-
import useDidMount from '../hooks/useDidMount.js';
|
|
8
|
-
import { _ as _extends } from '../_rollupPluginBabelHelpers-a83240e1.js';
|
|
9
|
-
import Icon from '../Icon/index.js';
|
|
10
|
-
import Empty from '../Empty/index.js';
|
|
11
|
-
import Search from '../Search/index.js';
|
|
12
|
-
import CustomScrollbar from '../Scrollbar/index.js';
|
|
13
|
-
import Checkbox from '../Checkbox/index.js';
|
|
14
|
-
import { s as styleInject } from '../style-inject.es-746bb8ed.js';
|
|
15
|
-
import Button from '../Button/index.js';
|
|
16
|
-
import { T as Tooltip } from '../index-c7646e48.js';
|
|
17
|
-
import '../objectWithoutPropertiesLoose-e1596bdb.js';
|
|
18
|
-
import '../redux-e591c1b8.js';
|
|
19
|
-
import 'react-dom';
|
|
20
|
-
import '../dateValidation-67caec66.js';
|
|
21
|
-
import '../_commonjsHelpers-24198af3.js';
|
|
22
|
-
import '../tslib.es6-f211516f.js';
|
|
23
|
-
import '../ExtendedInput/index.js';
|
|
24
|
-
import '../hooks/useDeviceType.js';
|
|
25
|
-
import '../hooks/useWindowSize.js';
|
|
26
|
-
import '../hooks/useDebounce.js';
|
|
27
|
-
import '../useEllipsisDetection-c1c9ad94.js';
|
|
28
|
-
import '../SuggestionList/index.js';
|
|
29
|
-
import '../hooks/useKeyDown.js';
|
|
30
|
-
import '../hooks/useClickOutside.js';
|
|
31
|
-
import '../config-1053d64d.js';
|
|
32
|
-
import '../callAfterDelay-7272faca.js';
|
|
33
|
-
import '../GeneUIProvider/index.js';
|
|
34
|
-
import '../checkboxRadioSwitcher-5b69d7bd.js';
|
|
35
|
-
import '../guid-8ddf77b3.js';
|
|
36
|
-
|
|
37
|
-
function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];if("production"!==process.env.NODE_ENV){var i=Y[n],o=i?"function"==typeof i?i.apply(null,t):i:"unknown error nr: "+n;throw Error("[Immer] "+o)}throw Error("[Immer] minified error nr: "+n+(t.length?" "+t.map((function(n){return "'"+n+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function r(n){return !!n&&!!n[Q]}function t(n){var r;return !!n&&(function(n){if(!n||"object"!=typeof n)return !1;var r=Object.getPrototypeOf(n);if(null===r)return !0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return t===Object||"function"==typeof t&&Function.toString.call(t)===Z}(n)||Array.isArray(n)||!!n[L]||!!(null===(r=n.constructor)||void 0===r?void 0:r[L])||s(n)||v(n))}function i(n,r,t){void 0===t&&(t=!1),0===o(n)?(t?Object.keys:nn)(n).forEach((function(e){t&&"symbol"==typeof e||r(e,n[e],n);})):n.forEach((function(t,e){return r(e,t,n)}));}function o(n){var r=n[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u(n,r){return 2===o(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a(n,r){return 2===o(n)?n.get(r):n[r]}function f(n,r,t){var e=o(n);2===e?n.set(r,t):3===e?n.add(t):n[r]=t;}function c(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(r),e=0;e<t.length;e++){var i=t[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]});}return Object.create(Object.getPrototypeOf(n),r)}function d(n,e){return void 0===e&&(e=!1),y(n)||r(n)||!t(n)||(o(n)>1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i(n,(function(n,r){return d(r,!0)}),!0)),n}function h(){n(2);}function y(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b(r){var t=tn[r];return t||n(18,r),t}function _(){return "production"===process.env.NODE_ENV||U||n(0),U}function j(n,r){r&&(b("Patches"),n.u=[],n.s=[],n.v=r);}function g(n){O(n),n.p.forEach(S),n.p=null;}function O(n){n===U&&(U=n.l);}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.g=!0;}function P(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.O||b("ES5").S(e,r,o),o?(i[Q].P&&(g(e),n(4)),t(r)&&(r=M(e,r),e.l||x(e,r)),e.u&&b("Patches").M(i[Q].t,r,e.u,e.s)):r=M(e,i,[]),g(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y(r))return r;var e=r[Q];if(!e)return i(r,(function(i,o){return A(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l(e.k):e.o,u=o,a=!1;3===e.i&&(u=new Set(o),o.clear(),a=!0),i(u,(function(r,i){return A(n,e,o,r,i,t,a)})),x(n,o,!1),t&&n.u&&b("Patches").N(e,t,n.u,n.s);}return e.o}function A(e,i,o,a,c,s,v){if("production"!==process.env.NODE_ENV&&c===o&&n(5),r(c)){var p=M(e,c,s&&i&&3!==i.i&&!u(i.R,a)?s.concat(a):void 0);if(f(o,a,p),!r(p))return;e.m=!1;}else v&&o.add(c);if(t(c)&&!y(c)){if(!e.h.D&&e._<1)return;M(e,c),i&&i.A.l||x(e,c);}}function x(n,r,t){void 0===t&&(t=!1),!n.l&&n.h.D&&n.m&&d(r,t);}function z(n,r){var t=n[Q];return (t?p(t):n)[r]}function I(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t);}}function k(n){n.P||(n.P=!0,n.l&&k(n.l));}function E(n){n.o||(n.o=l(n.t));}function N(n,r,t){var e=s(r)?b("MapSet").F(r,t):v(r)?b("MapSet").T(r,t):n.O?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,R:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b("ES5").J(r,t);return (t?t.A:_()).p.push(e),e}function R(e){return r(e)||n(22,e),function n(r){if(!t(r))return r;var e,u=r[Q],c=o(r);if(u){if(!u.P&&(u.i<4||!b("ES5").K(u)))return u.t;u.I=!0,e=D(r,c),u.I=!1;}else e=D(r,c);return i(e,(function(r,t){u&&a(u.t,r)===t||f(e,r,n(t));})),3===c?new Set(e):e}(e)}function D(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}var G,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",Y={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(n){return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+n},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(n){return "Cannot apply patch, path doesn't resolve: "+n},16:'Sets cannot have "replace" patches.',17:function(n){return "Unsupported patch operation: "+n},18:function(n){return "The plugin for '"+n+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+n+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(n){return "produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+n+"'"},22:function(n){return "'current' expects a draft, got: "+n},23:function(n){return "'original' expects a draft, got: "+n},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Z=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t);})),r},tn={},en={get:function(n,r){if(r===Q)return n;var e=p(n);if(!u(e,r))return function(n,r,t){var e,i=I(r,t);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,r);var i=e[r];return n.I||!t(i)?i:i===z(n.t,r)?(E(n),n.o[r]=N(n.A.h,i,n)):i},has:function(n,r){return r in p(n)},ownKeys:function(n){return Reflect.ownKeys(p(n))},set:function(n,r,t){var e=I(p(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z(p(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.R[r]=!1,!0;if(c(t,i)&&(void 0!==t||u(n.t,r)))return !0;E(n),k(n);}return n.o[r]===t&&(void 0!==t||r in n.o)||Number.isNaN(t)&&Number.isNaN(n.o[r])||(n.o[r]=t,n.R[r]=!0),!0},deleteProperty:function(n,r){return void 0!==z(n.t,r)||r in n.t?(n.R[r]=!1,E(n),k(n)):delete n.R[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:!0,configurable:1!==n.i||"length"!==r,enumerable:e.enumerable,value:t[r]}:e},defineProperty:function(){n(11);},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n(12);}},on={};i(en,(function(n,r){on[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)};})),on.deleteProperty=function(r,t){return "production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&n(13),on.set.call(this,r,t,void 0)},on.set=function(r,t,e){return "production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&n(14),en.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.O=B,this.D=!0,this.produce=function(r,i,o){if("function"==typeof r&&"function"!=typeof i){var u=i;i=r;var a=e;return function(n){var r=this;void 0===n&&(n=u);for(var t=arguments.length,e=Array(t>1?t-1:0),o=1;o<t;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var t;return (t=i).call.apply(t,[r,n].concat(e))}))}}var f;if("function"!=typeof i&&n(6),void 0!==o&&"function"!=typeof o&&n(7),t(r)){var c=w(e),s=N(e,r,void 0),v=!0;try{f=i(s),v=!1;}finally{v?g(c):O(c);}return "undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P(n,c)}),(function(n){throw g(c),n})):(j(c,o),P(f,c))}if(!r||"object"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H&&(f=void 0),e.D&&d(f,!0),o){var p=[],l=[];b("Patches").M(r,f,p,l),o(p,l);}return f}n(21,r);},this.produceWithPatches=function(n,r){if("function"==typeof n)return function(r){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,(function(r){return n.apply(void 0,[r].concat(i))}))};var t,i,o=e.produce(n,r,(function(n,r){t=n,i=r;}));return "undefined"!=typeof Promise&&o instanceof Promise?o.then((function(n){return [n,t,i]})):[o,t,i]},"boolean"==typeof(null==r?void 0:r.useProxies)&&this.setUseProxies(r.useProxies),"boolean"==typeof(null==r?void 0:r.autoFreeze)&&this.setAutoFreeze(r.autoFreeze);}var i=e.prototype;return i.createDraft=function(e){t(e)||n(8),r(e)&&(e=R(e));var i=w(this),o=N(this,e,void 0);return o[Q].C=!0,O(i),o},i.finishDraft=function(r,t){var e=r&&r[Q];"production"!==process.env.NODE_ENV&&(e&&e.C||n(9),e.I&&n(10));var i=e.A;return j(i,t),P(void 0,i)},i.setAutoFreeze=function(n){this.D=n;},i.setUseProxies=function(r){r&&!B&&n(20),this.O=r;},i.applyPatches=function(n,t){var e;for(e=t.length-1;e>=0;e--){var i=t[e];if(0===i.path.length&&"replace"===i.op){n=i.value;break}}e>-1&&(t=t.slice(e+1));var o=b("Patches").$;return r(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un,fn=an.produce;an.produceWithPatches.bind(an);an.setAutoFreeze.bind(an);an.setUseProxies.bind(an);an.applyPatches.bind(an);an.createDraft.bind(an);an.finishDraft.bind(an);var produce = fn;
|
|
38
|
-
|
|
39
|
-
const reorderElement = (container, startIndex, endIndex) => produce(container, draft => {
|
|
40
|
-
const [removed] = draft.splice(startIndex, 1);
|
|
41
|
-
draft.splice(endIndex, 0, removed);
|
|
42
|
-
});
|
|
43
|
-
const moveElement = (containers, source, destination) => produce(containers, draft => {
|
|
44
|
-
const [removed] = draft[source.droppableId].splice(source.index, 1);
|
|
45
|
-
draft[destination.droppableId].splice(destination.index, 0, removed);
|
|
46
|
-
});
|
|
47
|
-
const multiMoveElement = _ref => {
|
|
48
|
-
let {
|
|
49
|
-
containers,
|
|
50
|
-
selectedElements,
|
|
51
|
-
destination
|
|
52
|
-
} = _ref;
|
|
53
|
-
return produce(containers, draft => {
|
|
54
|
-
let removed = [];
|
|
55
|
-
Object.entries(selectedElements).forEach(_ref2 => {
|
|
56
|
-
let [source, elements] = _ref2;
|
|
57
|
-
removed = [...removed, ...draft[source].filter((_, index) => elements.includes(index))];
|
|
58
|
-
draft[source] = draft[source].filter((_, index) => !elements.includes(index));
|
|
59
|
-
});
|
|
60
|
-
draft[destination.droppableId].splice(destination.index, 0, ...removed);
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
|
-
const selectedInitialState = containers => {
|
|
64
|
-
const data = {};
|
|
65
|
-
Object.keys(containers).forEach(key => {
|
|
66
|
-
data[key] = [];
|
|
67
|
-
});
|
|
68
|
-
return data;
|
|
69
|
-
};
|
|
70
|
-
const unionIndexes = arr => Array.from(new Set(arr));
|
|
71
|
-
const addOrRemove = (data, value) => produce(data, draft => {
|
|
72
|
-
const index = draft.indexOf(value);
|
|
73
|
-
if (index === -1) {
|
|
74
|
-
draft.push(value);
|
|
75
|
-
} else {
|
|
76
|
-
draft.splice(index, 1);
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
const DEFAULT_TRANSLATE_MESSAGE = {
|
|
81
|
-
empty: 'No data',
|
|
82
|
-
dropHere: 'Drop Element Here',
|
|
83
|
-
multiSelectText: 'Elements',
|
|
84
|
-
moveTo: 'Move to'
|
|
85
|
-
};
|
|
86
|
-
const DEFAULT_DATA_ERROR_MESSAGE = 'TransferList: Be sure to send the defaultDate according to the documentation standard';
|
|
87
|
-
|
|
88
|
-
var css_248z$2 = "[data-gene-ui-version=\"2.16.4\"] .bc-transfer-element{grid-column-gap:1.2rem;--crs-grid-column-gap:2rem;align-items:center;cursor:pointer;display:grid;grid-template-columns:1fr auto;margin:.75rem 0;overflow:hidden;padding:0 1.5rem 0 2rem;transition:color .4s,background .4s,opacity .4s,box-shadow .4s;width:100%}[data-gene-ui-version=\"2.16.4\"] .bc-transfer-element:not(.minimalistic){background:var(--background);border:1px solid rgba(var(--background-sc-rgb),.1);border-radius:1rem;box-shadow:inset 0 0 0 4.2rem rgba(var(--hero-rgb),0),0 .2rem .4rem 0 rgba(var(--hero-rgb),0);height:4.2rem}@media (hover:hover){[data-gene-ui-version=\"2.16.4\"] .bc-transfer-element:not(.minimalistic):hover{border-color:rgba(var(--hero-rgb),.2);box-shadow:inset 0 0 0 4.2rem rgba(var(--hero-rgb),.1),0 .2rem .4rem 0 rgba(var(--hero-rgb),0);color:var(--hero)}}[data-gene-ui-version=\"2.16.4\"] .bc-transfer-element.hovered{border-color:rgba(var(--hero-rgb),.2);box-shadow:inset 0 0 0 4.2rem rgba(var(--hero-rgb),.1),0 .2rem .4rem 0 rgba(var(--hero-rgb),0);color:var(--hero)}[data-gene-ui-version=\"2.16.4\"] .bc-transfer-element.disabled{opacity:.5;pointer-events:none}[data-gene-ui-version=\"2.16.4\"] .bc-transfer-element.dragged{border-color:rgba(var(--hero-rgb),.1);box-shadow:inset 0 0 0 4.2rem rgba(var(--hero-rgb),.1),0 .2rem .4rem 0 rgba(var(--hero-rgb),.1);color:var(--hero)}[data-gene-ui-version=\"2.16.4\"] .bc-transfer-element.readOnly{cursor:default}[data-gene-ui-version=\"2.16.4\"] .bc-transfer-element.readOnly .crs-holder .crs-component{display:none}[data-gene-ui-version=\"2.16.4\"] .bc-transfer-element>.icon{cursor:grab}[data-gene-ui-version=\"2.16.4\"] .bc-transfer-element>.icon:active{cursor:grabbing}[data-gene-ui-version=\"2.16.4\"] .bc-transfer-element .crs-holder{pointer-events:none}";
|
|
89
|
-
styleInject(css_248z$2);
|
|
90
|
-
|
|
91
|
-
const TransferElement = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
92
|
-
let {
|
|
93
|
-
disabled,
|
|
94
|
-
hovered,
|
|
95
|
-
dragged,
|
|
96
|
-
checked,
|
|
97
|
-
label,
|
|
98
|
-
onClick,
|
|
99
|
-
readOnly,
|
|
100
|
-
minimalistic,
|
|
101
|
-
indeterminate
|
|
102
|
-
} = _ref;
|
|
103
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
104
|
-
ref: ref,
|
|
105
|
-
onClick: onClick,
|
|
106
|
-
className: classnames('bc-transfer-element', 'crs-external-hover', 'crs-external-active', {
|
|
107
|
-
minimalistic,
|
|
108
|
-
disabled,
|
|
109
|
-
hovered,
|
|
110
|
-
dragged,
|
|
111
|
-
readOnly
|
|
112
|
-
})
|
|
113
|
-
}, /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
114
|
-
indeterminate: indeterminate,
|
|
115
|
-
checked: checked,
|
|
116
|
-
label: label
|
|
117
|
-
}), !readOnly && !minimalistic && /*#__PURE__*/React__default.createElement(Icon, {
|
|
118
|
-
type: "bc-icon-drag"
|
|
119
|
-
}));
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
function TransferListItem(_ref) {
|
|
123
|
-
let {
|
|
124
|
-
index,
|
|
125
|
-
element,
|
|
126
|
-
onClick,
|
|
127
|
-
selected,
|
|
128
|
-
readOnly,
|
|
129
|
-
isDragActive,
|
|
130
|
-
multiSelectText,
|
|
131
|
-
selectedElementsLength
|
|
132
|
-
} = _ref;
|
|
133
|
-
const isDisabled = readOnly || element.disabled;
|
|
134
|
-
const handleClick = event => !isDisabled && onClick(index, event);
|
|
135
|
-
return /*#__PURE__*/React__default.createElement(PublicDraggable, {
|
|
136
|
-
isDragDisabled: isDisabled,
|
|
137
|
-
draggableId: element.id,
|
|
138
|
-
index: index
|
|
139
|
-
}, (_ref2, _ref3) => {
|
|
140
|
-
let {
|
|
141
|
-
innerRef,
|
|
142
|
-
draggableProps,
|
|
143
|
-
dragHandleProps
|
|
144
|
-
} = _ref2;
|
|
145
|
-
let {
|
|
146
|
-
isDragging
|
|
147
|
-
} = _ref3;
|
|
148
|
-
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
149
|
-
ref: innerRef
|
|
150
|
-
}, draggableProps, dragHandleProps, {
|
|
151
|
-
onClick: handleClick,
|
|
152
|
-
className: "bc-tl-item"
|
|
153
|
-
}), /*#__PURE__*/React__default.createElement(TransferElement, {
|
|
154
|
-
label: isDragging && selectedElementsLength > 1 ? "".concat(selectedElementsLength, " ").concat(multiSelectText) : element.title,
|
|
155
|
-
checked: selected,
|
|
156
|
-
readOnly: readOnly,
|
|
157
|
-
dragged: isDragging,
|
|
158
|
-
disabled: element.disabled || selected && isDragActive && !isDragging
|
|
159
|
-
}));
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
function TransferListButtons(_ref) {
|
|
164
|
-
let {
|
|
165
|
-
onTransmit,
|
|
166
|
-
send,
|
|
167
|
-
receive,
|
|
168
|
-
readOnly
|
|
169
|
-
} = _ref;
|
|
170
|
-
const handleReceive = () => onTransmit(send.id, receive.id);
|
|
171
|
-
const handleSend = () => onTransmit(receive.id, send.id);
|
|
172
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
173
|
-
className: "bc-tl-buttons"
|
|
174
|
-
}, /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
175
|
-
text: send.title
|
|
176
|
-
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
177
|
-
onClick: handleSend,
|
|
178
|
-
disabled: readOnly || send.disabled,
|
|
179
|
-
icon: "bc-icon-arrow-right",
|
|
180
|
-
appearance: "clean"
|
|
181
|
-
})), /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
182
|
-
text: receive.title
|
|
183
|
-
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
184
|
-
onClick: handleReceive,
|
|
185
|
-
disabled: readOnly || receive.disabled,
|
|
186
|
-
icon: "bc-icon-arrow-left",
|
|
187
|
-
appearance: "clean"
|
|
188
|
-
})));
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
var css_248z$1 = "[data-gene-ui-version=\"2.16.4\"] .bc-transfer-container{width:100%}[data-gene-ui-version=\"2.16.4\"] .bc-transfer-container>li+li{border-top:1px solid var(--transfer-container-border-color,#0000)}[data-gene-ui-version=\"2.16.4\"] .bc-tl-head{align-items:center;display:flex;font:600 1.4rem/1.8rem var(--font-family);height:5.1rem;justify-content:space-between;padding:0 2rem}[data-gene-ui-version=\"2.16.4\"] .bc-tl-head h5{color:var(--hero)}[data-gene-ui-version=\"2.16.4\"] .bc-tl-head span{color:rgba(var(--background-sc-rgb),.5)}[data-gene-ui-version=\"2.16.4\"] .bc-tl-buttons{--button-external-size:4rem;border-width:medium;border-bottom:0 solid rgba(var(--background-sc-rgb),.1);border-left:1px solid rgba(var(--background-sc-rgb),.1);border-right:1px solid rgba(var(--background-sc-rgb),.1);border-top:0 solid rgba(var(--background-sc-rgb),.1);display:flex;flex-direction:column;flex-shrink:0;justify-content:center;padding:0 1rem}[data-gene-ui-version=\"2.16.4\"] .bc-tl-buttons>*+*{margin:1rem 0 0}[data-gene-ui-version=\"2.16.4\"] .bc-tl-search{padding:2rem}[data-gene-ui-version=\"2.16.4\"] .bc-tl-content-holder{height:var(--transfer-container-content-height);overflow:hidden;position:relative}[data-gene-ui-version=\"2.16.4\"] .bc-tl-content{display:flex;flex-direction:column;justify-content:flex-start;min-height:100%;padding:.7rem 2rem;width:100%}[data-gene-ui-version=\"2.16.4\"] .bc-tl-content>.bc-tl-item{opacity:1!important}[data-gene-ui-version=\"2.16.4\"] .bc-tl-placeholder{align-items:center;display:flex;height:100%;justify-content:center;left:0;padding:0 0 3.6rem;position:absolute;top:0;width:100%}[data-gene-ui-version=\"2.16.4\"] .bc-tl-drop-here{align-items:center;display:flex;flex-direction:column;font:600 1.4rem/1.8rem var(--font-family);text-align:center;width:100%}[data-gene-ui-version=\"2.16.4\"] .bc-tl-drop-here i{color:rgba(var(--hero-rgb),.1);font-size:11rem}";
|
|
192
|
-
styleInject(css_248z$1);
|
|
193
|
-
|
|
194
|
-
function TransferListContainer(_ref) {
|
|
195
|
-
let {
|
|
196
|
-
data,
|
|
197
|
-
isEditable,
|
|
198
|
-
messages,
|
|
199
|
-
onTransmit,
|
|
200
|
-
containerId,
|
|
201
|
-
isDragActive,
|
|
202
|
-
onElementSelect,
|
|
203
|
-
selectedElements,
|
|
204
|
-
onSelectAllElements,
|
|
205
|
-
transmissionButtons,
|
|
206
|
-
selectedElementsLength
|
|
207
|
-
} = _ref;
|
|
208
|
-
const [searchText, setSearchText] = useState('');
|
|
209
|
-
const filteredData = useMemo(() => {
|
|
210
|
-
const elements = [];
|
|
211
|
-
data.forEach((element, index) => {
|
|
212
|
-
if (element.title.toLowerCase().includes(searchText)) {
|
|
213
|
-
elements.push({
|
|
214
|
-
...element,
|
|
215
|
-
index
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
return elements;
|
|
220
|
-
}, [data, searchText]);
|
|
221
|
-
const selectableElements = useMemo(() => filteredData.filter(_ref2 => {
|
|
222
|
-
let {
|
|
223
|
-
disabled
|
|
224
|
-
} = _ref2;
|
|
225
|
-
return !disabled;
|
|
226
|
-
}), [filteredData]);
|
|
227
|
-
const isAllSelected = useMemo(() => {
|
|
228
|
-
const selectableElements = filteredData.filter(_ref3 => {
|
|
229
|
-
let {
|
|
230
|
-
disabled
|
|
231
|
-
} = _ref3;
|
|
232
|
-
return !disabled;
|
|
233
|
-
});
|
|
234
|
-
const filteredSelectedElements = selectableElements.filter(_ref4 => {
|
|
235
|
-
let {
|
|
236
|
-
index
|
|
237
|
-
} = _ref4;
|
|
238
|
-
return selectedElements.includes(index);
|
|
239
|
-
});
|
|
240
|
-
return !!selectableElements.length && selectableElements.length === filteredSelectedElements.length && selectedElements.length === filteredSelectedElements.length;
|
|
241
|
-
}, [selectedElements, filteredData]);
|
|
242
|
-
const handleSelectAll = () => onSelectAllElements(containerId, isAllSelected);
|
|
243
|
-
const handleElementClick = index => onElementSelect(containerId, index);
|
|
244
|
-
const handleSearchChange = event => {
|
|
245
|
-
setSearchText(event.target.value.toLowerCase());
|
|
246
|
-
};
|
|
247
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ConnectedDroppable, {
|
|
248
|
-
key: containerId,
|
|
249
|
-
droppableId: containerId,
|
|
250
|
-
isDropDisabled: isEditable,
|
|
251
|
-
children: (_ref5, _ref6) => {
|
|
252
|
-
let {
|
|
253
|
-
innerRef,
|
|
254
|
-
placeholder,
|
|
255
|
-
droppableProps
|
|
256
|
-
} = _ref5;
|
|
257
|
-
let {
|
|
258
|
-
isDraggingOver
|
|
259
|
-
} = _ref6;
|
|
260
|
-
return /*#__PURE__*/React__default.createElement("ul", {
|
|
261
|
-
className: classnames('bc-transfer-container', {
|
|
262
|
-
isDraggingOver,
|
|
263
|
-
isDragActive
|
|
264
|
-
})
|
|
265
|
-
}, /*#__PURE__*/React__default.createElement("li", {
|
|
266
|
-
className: "bc-tl-head"
|
|
267
|
-
}, /*#__PURE__*/React__default.createElement("h5", null, messages && messages.titles ? messages.titles[containerId] : containerId), /*#__PURE__*/React__default.createElement("span", null, messages && messages.countTitle && messages.countTitle[containerId], " (", selectedElements.length, "/", data.length, ")")), /*#__PURE__*/React__default.createElement("li", {
|
|
268
|
-
className: "bc-tl-search"
|
|
269
|
-
}, /*#__PURE__*/React__default.createElement(Search, {
|
|
270
|
-
inputSize: "big",
|
|
271
|
-
disabled: !data.length,
|
|
272
|
-
onChange: handleSearchChange
|
|
273
|
-
})), /*#__PURE__*/React__default.createElement("li", {
|
|
274
|
-
className: "bc-tl-content-holder"
|
|
275
|
-
}, /*#__PURE__*/React__default.createElement(CustomScrollbar, null, /*#__PURE__*/React__default.createElement("div", _extends({
|
|
276
|
-
ref: innerRef
|
|
277
|
-
}, droppableProps, {
|
|
278
|
-
className: "bc-tl-content"
|
|
279
|
-
}), filteredData.length ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, !isEditable && /*#__PURE__*/React__default.createElement(TransferElement, {
|
|
280
|
-
minimalistic: true,
|
|
281
|
-
label: "Select All",
|
|
282
|
-
checked: isAllSelected,
|
|
283
|
-
onClick: handleSelectAll,
|
|
284
|
-
disabled: !selectableElements.length,
|
|
285
|
-
indeterminate: !isAllSelected && !!selectedElements.length
|
|
286
|
-
}), filteredData.map(element => /*#__PURE__*/React__default.createElement(TransferListItem, {
|
|
287
|
-
key: element.id,
|
|
288
|
-
element: element,
|
|
289
|
-
readOnly: isEditable,
|
|
290
|
-
index: element.index,
|
|
291
|
-
isDragActive: isDragActive,
|
|
292
|
-
onClick: handleElementClick,
|
|
293
|
-
selectedElementsLength: selectedElementsLength,
|
|
294
|
-
selected: selectedElements.includes(element.index),
|
|
295
|
-
multiSelectText: messages.multiSelectText
|
|
296
|
-
}))) : /*#__PURE__*/React__default.createElement("div", {
|
|
297
|
-
className: "bc-tl-placeholder pointer-events-none"
|
|
298
|
-
}, isDraggingOver ? /*#__PURE__*/React__default.createElement("div", {
|
|
299
|
-
className: "bc-tl-drop-here"
|
|
300
|
-
}, /*#__PURE__*/React__default.createElement(Icon, {
|
|
301
|
-
type: "bc-icon-drag-here"
|
|
302
|
-
}), /*#__PURE__*/React__default.createElement("p", null, messages.dropHere)) : /*#__PURE__*/React__default.createElement(Empty, {
|
|
303
|
-
size: "medium",
|
|
304
|
-
type: "data",
|
|
305
|
-
appearance: "greyscale",
|
|
306
|
-
title: messages.empty
|
|
307
|
-
}))), placeholder)));
|
|
308
|
-
}
|
|
309
|
-
}), transmissionButtons && /*#__PURE__*/React__default.createElement(TransferListButtons, _extends({
|
|
310
|
-
readOnly: isEditable,
|
|
311
|
-
onTransmit: onTransmit
|
|
312
|
-
}, transmissionButtons)));
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
var css_248z = "[data-gene-ui-version=\"2.16.4\"] .bc-transfer-list{--transfer-container-border-color:rgba(var(--background-sc-rgb),0.1);--transfer-container-content-height:33.4rem;background:var(--background);box-shadow:0 0 0 1px var(--transfer-container-border-color);display:flex;grid-template-columns:1fr auto 1fr;-webkit-user-select:none;user-select:none;width:100%}[data-gene-ui-version=\"2.16.4\"] .bc-transfer-list .scroll-holder .scroll-content{z-index:inherit}";
|
|
316
|
-
styleInject(css_248z);
|
|
317
|
-
|
|
318
|
-
function TransferList(_ref) {
|
|
319
|
-
let {
|
|
320
|
-
onChange,
|
|
321
|
-
className,
|
|
322
|
-
isEditable,
|
|
323
|
-
defaultData,
|
|
324
|
-
translateMessages,
|
|
325
|
-
...props
|
|
326
|
-
} = _ref;
|
|
327
|
-
if (!(defaultData && Object.keys(defaultData).length)) {
|
|
328
|
-
console.error(DEFAULT_DATA_ERROR_MESSAGE);
|
|
329
|
-
return null;
|
|
330
|
-
}
|
|
331
|
-
const [isDragActive, setIsDragActive] = useState(false);
|
|
332
|
-
const [containers, setContainers] = useState(defaultData);
|
|
333
|
-
const [selectedElements, setSelectedElements] = useState(selectedInitialState(defaultData));
|
|
334
|
-
useEffect(() => {
|
|
335
|
-
setContainers(defaultData);
|
|
336
|
-
setSelectedElements(selectedInitialState(defaultData));
|
|
337
|
-
}, [defaultData, isEditable]);
|
|
338
|
-
const messages = useMemo(() => ({
|
|
339
|
-
...DEFAULT_TRANSLATE_MESSAGE,
|
|
340
|
-
...translateMessages
|
|
341
|
-
}), [translateMessages]);
|
|
342
|
-
const containersEntries = useMemo(() => Object.entries(containers), [containers]);
|
|
343
|
-
const selectedElementsLength = useMemo(() => selectedElements && Object.values(selectedElements).reduce((length, data) => {
|
|
344
|
-
length += data.length;
|
|
345
|
-
return length;
|
|
346
|
-
}, 0), [selectedElements]);
|
|
347
|
-
useDidMount(() => {
|
|
348
|
-
onChange(containers);
|
|
349
|
-
}, [onChange, containers]);
|
|
350
|
-
function handleDragStart() {
|
|
351
|
-
setIsDragActive(true);
|
|
352
|
-
}
|
|
353
|
-
function handleDragEnd(_ref2) {
|
|
354
|
-
let {
|
|
355
|
-
destination,
|
|
356
|
-
source
|
|
357
|
-
} = _ref2;
|
|
358
|
-
if (destination && source) {
|
|
359
|
-
if (selectedElementsLength) {
|
|
360
|
-
setContainers(containers => multiMoveElement({
|
|
361
|
-
containers,
|
|
362
|
-
destination,
|
|
363
|
-
selectedElements: {
|
|
364
|
-
...selectedElements,
|
|
365
|
-
[source.droppableId]: unionIndexes([...selectedElements[source.droppableId], source.index])
|
|
366
|
-
}
|
|
367
|
-
}));
|
|
368
|
-
} else if (destination.droppableId === source.droppableId) {
|
|
369
|
-
setContainers(prev => ({
|
|
370
|
-
...prev,
|
|
371
|
-
[source.droppableId]: reorderElement(prev[source.droppableId], source.index, destination.index)
|
|
372
|
-
}));
|
|
373
|
-
} else {
|
|
374
|
-
setContainers(prev => moveElement(prev, source, destination));
|
|
375
|
-
}
|
|
376
|
-
setSelectedElements(selectedInitialState(containers));
|
|
377
|
-
}
|
|
378
|
-
setIsDragActive(false);
|
|
379
|
-
}
|
|
380
|
-
const handleElementSelect = useCallback((source, index) => {
|
|
381
|
-
setSelectedElements(prev => ({
|
|
382
|
-
...prev,
|
|
383
|
-
[source]: addOrRemove(prev[source], index)
|
|
384
|
-
}));
|
|
385
|
-
}, []);
|
|
386
|
-
const handleSelectAllElements = useCallback((containerId, isUnselect) => {
|
|
387
|
-
let indexes = [];
|
|
388
|
-
if (!isUnselect) {
|
|
389
|
-
indexes = containers[containerId].map((_ref3, index) => {
|
|
390
|
-
let {
|
|
391
|
-
disabled
|
|
392
|
-
} = _ref3;
|
|
393
|
-
return !disabled && index;
|
|
394
|
-
}).filter(index => typeof index === 'number');
|
|
395
|
-
}
|
|
396
|
-
setSelectedElements(prev => ({
|
|
397
|
-
...prev,
|
|
398
|
-
[containerId]: indexes
|
|
399
|
-
}));
|
|
400
|
-
}, [containers]);
|
|
401
|
-
const transmissionButtons = useCallback(index => {
|
|
402
|
-
var _containersEntries$in, _containersEntries;
|
|
403
|
-
const prev = (_containersEntries$in = containersEntries[index]) === null || _containersEntries$in === void 0 ? void 0 : _containersEntries$in[0];
|
|
404
|
-
const next = (_containersEntries = containersEntries[index + 1]) === null || _containersEntries === void 0 ? void 0 : _containersEntries[0];
|
|
405
|
-
if (prev && next) {
|
|
406
|
-
return {
|
|
407
|
-
send: {
|
|
408
|
-
id: next,
|
|
409
|
-
disabled: !selectedElements[prev].length,
|
|
410
|
-
title: "".concat(messages.moveTo, " ").concat(messages.titles[next])
|
|
411
|
-
},
|
|
412
|
-
receive: {
|
|
413
|
-
id: prev,
|
|
414
|
-
disabled: !selectedElements[next].length,
|
|
415
|
-
title: "".concat(messages.moveTo, " ").concat(messages.titles[prev])
|
|
416
|
-
}
|
|
417
|
-
};
|
|
418
|
-
}
|
|
419
|
-
}, [messages, containersEntries, selectedElements]);
|
|
420
|
-
const handleTransmit = useCallback((ofContainer, toConteiner) => {
|
|
421
|
-
setContainers(prev => multiMoveElement({
|
|
422
|
-
containers: prev,
|
|
423
|
-
selectedElements: {
|
|
424
|
-
[ofContainer]: selectedElements[ofContainer]
|
|
425
|
-
},
|
|
426
|
-
destination: {
|
|
427
|
-
index: 0,
|
|
428
|
-
droppableId: toConteiner
|
|
429
|
-
}
|
|
430
|
-
}));
|
|
431
|
-
setSelectedElements(prev => ({
|
|
432
|
-
...prev,
|
|
433
|
-
[toConteiner]: prev[toConteiner].map(i => i + prev[ofContainer].length),
|
|
434
|
-
[ofContainer]: []
|
|
435
|
-
}));
|
|
436
|
-
}, [selectedElements]);
|
|
437
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
438
|
-
className: classnames('bc-transfer-list', className)
|
|
439
|
-
}, /*#__PURE__*/React__default.createElement(DragDropContext, {
|
|
440
|
-
onDragEnd: handleDragEnd,
|
|
441
|
-
onDragStart: handleDragStart
|
|
442
|
-
}, containersEntries.map((_ref4, index) => {
|
|
443
|
-
let [id, data] = _ref4;
|
|
444
|
-
return /*#__PURE__*/React__default.createElement(TransferListContainer, {
|
|
445
|
-
key: id,
|
|
446
|
-
data: data,
|
|
447
|
-
containerId: id,
|
|
448
|
-
messages: messages,
|
|
449
|
-
isEditable: isEditable,
|
|
450
|
-
onTransmit: handleTransmit,
|
|
451
|
-
isDragActive: isDragActive,
|
|
452
|
-
onElementSelect: handleElementSelect,
|
|
453
|
-
selectedElements: selectedElements[id],
|
|
454
|
-
onSelectAllElements: handleSelectAllElements,
|
|
455
|
-
selectedElementsLength: selectedElementsLength,
|
|
456
|
-
transmissionButtons: transmissionButtons(index)
|
|
457
|
-
});
|
|
458
|
-
})));
|
|
459
|
-
}
|
|
460
|
-
TransferList.propTypes = {
|
|
461
|
-
/**
|
|
462
|
-
* DefaultData there should be objects with different keys names, inside which there should be container data
|
|
463
|
-
* { taskts: [], toDo: [{ id: 1, name: "Element 1", disabled: false }] }
|
|
464
|
-
*/
|
|
465
|
-
defaultData: PropTypes.object.isRequired,
|
|
466
|
-
/**
|
|
467
|
-
* onChange listen to the change in the container and return you the new object
|
|
468
|
-
*/
|
|
469
|
-
onChange: PropTypes.func,
|
|
470
|
-
/**
|
|
471
|
-
* Using translateMessages prop you can add/change the text title of the containers, count subtitle, empty Text, etc.
|
|
472
|
-
*/
|
|
473
|
-
translateMessages: PropTypes.shape({
|
|
474
|
-
titles: PropTypes.object,
|
|
475
|
-
countTitle: PropTypes.object,
|
|
476
|
-
dropHere: PropTypes.string,
|
|
477
|
-
empty: PropTypes.string
|
|
478
|
-
}),
|
|
479
|
-
/**
|
|
480
|
-
* CSS classname to add on the outer container.
|
|
481
|
-
*/
|
|
482
|
-
className: PropTypes.string,
|
|
483
|
-
/**
|
|
484
|
-
* When do you send: false
|
|
485
|
-
* Hide Select All buttons / items checkboxes / disabled all drag and drop functionality
|
|
486
|
-
*/
|
|
487
|
-
isEditable: PropTypes.bool
|
|
488
|
-
};
|
|
489
|
-
TransferList.defaultProps = {
|
|
490
|
-
onChange: noop
|
|
491
|
-
};
|
|
492
|
-
|
|
493
|
-
export { TransferList as default };
|