@bigbinary/neetoui 8.3.29 → 8.3.31
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/Accordion.js +94 -76
- package/dist/Accordion.js.map +1 -1
- package/dist/ActionDropdown.js +29 -32
- package/dist/ActionDropdown.js.map +1 -1
- package/dist/Alert.js +44 -38
- package/dist/Alert.js.map +1 -1
- package/dist/Avatar.js +28 -22
- package/dist/Avatar.js.map +1 -1
- package/dist/Button.js +45 -43
- package/dist/Button.js.map +1 -1
- package/dist/Callout.js +12 -7
- package/dist/Callout.js.map +1 -1
- package/dist/Checkbox.js +35 -28
- package/dist/Checkbox.js.map +1 -1
- package/dist/ColorPicker.js +134 -117
- package/dist/ColorPicker.js.map +1 -1
- package/dist/DatePicker.js +25 -9
- package/dist/DatePicker.js.map +1 -1
- package/dist/Dropdown.js +75 -83
- package/dist/Dropdown.js.map +1 -1
- package/dist/Input.js +82 -70
- package/dist/Input.js.map +1 -1
- package/dist/Kbd.js +13 -7
- package/dist/Kbd.js.map +1 -1
- package/dist/Label.js +59 -40
- package/dist/Label.js.map +1 -1
- package/dist/Modal.js +76 -65
- package/dist/Modal.js.map +1 -1
- package/dist/MultiEmailInput.js +118 -99
- package/dist/MultiEmailInput.js.map +1 -1
- package/dist/NoData.js +55 -39
- package/dist/NoData.js.map +1 -1
- package/dist/Pagination.js +64 -52
- package/dist/Pagination.js.map +1 -1
- package/dist/Pane.js +66 -56
- package/dist/Pane.js.map +1 -1
- package/dist/Popover.js +10 -7
- package/dist/Popover.js.map +1 -1
- package/dist/ProgressBar.js +20 -17
- package/dist/ProgressBar.js.map +1 -1
- package/dist/Radio.js +50 -40
- package/dist/Radio.js.map +1 -1
- package/dist/Select.js +111 -90
- package/dist/Select.js.map +1 -1
- package/dist/Sidebar.js +265 -216
- package/dist/Sidebar.js.map +1 -1
- package/dist/Slider.js +45 -38
- package/dist/Slider.js.map +1 -1
- package/dist/Spinner.js +3 -2
- package/dist/Spinner.js.map +1 -1
- package/dist/Stepper.js +33 -26
- package/dist/Stepper.js.map +1 -1
- package/dist/Switch.js +56 -46
- package/dist/Switch.js.map +1 -1
- package/dist/Tab.js +17 -11
- package/dist/Tab.js.map +1 -1
- package/dist/Table.js +221 -182
- package/dist/Table.js.map +1 -1
- package/dist/Tag.js +31 -24
- package/dist/Tag.js.map +1 -1
- package/dist/{Textarea-DlEGZFfG.js → Textarea-D1gsiIxm.js} +66 -56
- package/dist/{Textarea-DlEGZFfG.js.map → Textarea-D1gsiIxm.js.map} +1 -1
- package/dist/Textarea.js +4 -4
- package/dist/TimePicker.js +25 -9
- package/dist/TimePicker.js.map +1 -1
- package/dist/Toastr.js +46 -37
- package/dist/Toastr.js.map +1 -1
- package/dist/Tooltip.js +10 -6
- package/dist/Tooltip.js.map +1 -1
- package/dist/TranslationProvider.js +6 -4
- package/dist/TranslationProvider.js.map +1 -1
- package/dist/Tree.js +17 -15
- package/dist/Tree.js.map +1 -1
- package/dist/TreeSelect.js +65 -58
- package/dist/TreeSelect.js.map +1 -1
- package/dist/Typography.js +7 -3
- package/dist/Typography.js.map +1 -1
- package/dist/cjs/Accordion.js +94 -76
- package/dist/cjs/Accordion.js.map +1 -1
- package/dist/cjs/ActionDropdown.js +29 -32
- package/dist/cjs/ActionDropdown.js.map +1 -1
- package/dist/cjs/Alert.js +43 -37
- package/dist/cjs/Alert.js.map +1 -1
- package/dist/cjs/Avatar.js +27 -21
- package/dist/cjs/Avatar.js.map +1 -1
- package/dist/cjs/Button.js +45 -43
- package/dist/cjs/Button.js.map +1 -1
- package/dist/cjs/Callout.js +11 -6
- package/dist/cjs/Callout.js.map +1 -1
- package/dist/cjs/Checkbox.js +34 -27
- package/dist/cjs/Checkbox.js.map +1 -1
- package/dist/cjs/ColorPicker.js +132 -115
- package/dist/cjs/ColorPicker.js.map +1 -1
- package/dist/cjs/DatePicker.js +25 -9
- package/dist/cjs/DatePicker.js.map +1 -1
- package/dist/cjs/Dropdown.js +74 -82
- package/dist/cjs/Dropdown.js.map +1 -1
- package/dist/cjs/Input.js +81 -69
- package/dist/cjs/Input.js.map +1 -1
- package/dist/cjs/Kbd.js +13 -7
- package/dist/cjs/Kbd.js.map +1 -1
- package/dist/cjs/Label.js +59 -40
- package/dist/cjs/Label.js.map +1 -1
- package/dist/cjs/Modal.js +76 -65
- package/dist/cjs/Modal.js.map +1 -1
- package/dist/cjs/MultiEmailInput.js +117 -98
- package/dist/cjs/MultiEmailInput.js.map +1 -1
- package/dist/cjs/NoData.js +55 -39
- package/dist/cjs/NoData.js.map +1 -1
- package/dist/cjs/Pagination.js +63 -51
- package/dist/cjs/Pagination.js.map +1 -1
- package/dist/cjs/Pane.js +65 -55
- package/dist/cjs/Pane.js.map +1 -1
- package/dist/cjs/Popover.js +10 -7
- package/dist/cjs/Popover.js.map +1 -1
- package/dist/cjs/ProgressBar.js +20 -17
- package/dist/cjs/ProgressBar.js.map +1 -1
- package/dist/cjs/Radio.js +49 -39
- package/dist/cjs/Radio.js.map +1 -1
- package/dist/cjs/Select.js +110 -89
- package/dist/cjs/Select.js.map +1 -1
- package/dist/cjs/Sidebar.js +268 -219
- package/dist/cjs/Sidebar.js.map +1 -1
- package/dist/cjs/Slider.js +45 -38
- package/dist/cjs/Slider.js.map +1 -1
- package/dist/cjs/Spinner.js +3 -2
- package/dist/cjs/Spinner.js.map +1 -1
- package/dist/cjs/Stepper.js +33 -26
- package/dist/cjs/Stepper.js.map +1 -1
- package/dist/cjs/Switch.js +55 -45
- package/dist/cjs/Switch.js.map +1 -1
- package/dist/cjs/Tab.js +17 -11
- package/dist/cjs/Tab.js.map +1 -1
- package/dist/cjs/Table.js +224 -185
- package/dist/cjs/Table.js.map +1 -1
- package/dist/cjs/Tag.js +30 -23
- package/dist/cjs/Tag.js.map +1 -1
- package/dist/cjs/{Textarea-CiUKmQHr.js → Textarea-BzBZbgdT.js} +65 -55
- package/dist/cjs/{Textarea-CiUKmQHr.js.map → Textarea-BzBZbgdT.js.map} +1 -1
- package/dist/cjs/Textarea.js +4 -4
- package/dist/cjs/TimePicker.js +25 -9
- package/dist/cjs/TimePicker.js.map +1 -1
- package/dist/cjs/Toastr.js +45 -36
- package/dist/cjs/Toastr.js.map +1 -1
- package/dist/cjs/Tooltip.js +10 -6
- package/dist/cjs/Tooltip.js.map +1 -1
- package/dist/cjs/TranslationProvider.js +5 -3
- package/dist/cjs/TranslationProvider.js.map +1 -1
- package/dist/cjs/Tree.js +17 -15
- package/dist/cjs/Tree.js.map +1 -1
- package/dist/cjs/TreeSelect.js +66 -59
- package/dist/cjs/TreeSelect.js.map +1 -1
- package/dist/cjs/Typography.js +7 -3
- package/dist/cjs/Typography.js.map +1 -1
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/formik/ActionBlock.js +16 -9
- package/dist/cjs/formik/ActionBlock.js.map +1 -1
- package/dist/cjs/formik/BlockNavigation.js +40 -30
- package/dist/cjs/formik/BlockNavigation.js.map +1 -1
- package/dist/cjs/formik/Button.js +5 -3
- package/dist/cjs/formik/Button.js.map +1 -1
- package/dist/cjs/formik/Checkbox.js +29 -28
- package/dist/cjs/formik/Checkbox.js.map +1 -1
- package/dist/cjs/formik/Form.js +53 -47
- package/dist/cjs/formik/Form.js.map +1 -1
- package/dist/cjs/formik/Input.js +27 -26
- package/dist/cjs/formik/Input.js.map +1 -1
- package/dist/cjs/formik/MultiEmailInput.js +10 -6
- package/dist/cjs/formik/MultiEmailInput.js.map +1 -1
- package/dist/cjs/formik/Radio.js +7 -7
- package/dist/cjs/formik/Radio.js.map +1 -1
- package/dist/cjs/formik/Select.js +15 -10
- package/dist/cjs/formik/Select.js.map +1 -1
- package/dist/cjs/formik/Slider.js +7 -7
- package/dist/cjs/formik/Slider.js.map +1 -1
- package/dist/cjs/formik/Switch.js +31 -28
- package/dist/cjs/formik/Switch.js.map +1 -1
- package/dist/cjs/formik/Textarea.js +28 -27
- package/dist/cjs/formik/Textarea.js.map +1 -1
- package/dist/cjs/formik/TreeSelect.js +8 -5
- package/dist/cjs/formik/TreeSelect.js.map +1 -1
- package/dist/cjs/formik/index.js +11 -7
- package/dist/cjs/formik/index.js.map +1 -1
- package/dist/cjs/{index-BQsO_CAs.js → index-Dv40T5Ly.js} +195 -169
- package/dist/cjs/{index-BQsO_CAs.js.map → index-Dv40T5Ly.js.map} +1 -1
- package/dist/cjs/{index--BeRLo6L.js → index-h3QcOeWw.js} +12 -14
- package/dist/cjs/{index--BeRLo6L.js.map → index-h3QcOeWw.js.map} +1 -1
- package/dist/cjs/index.css +1 -2
- package/dist/cjs/index.js +26 -10
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/layouts.js +8 -3
- package/dist/cjs/layouts.js.map +1 -1
- package/dist/cjs/overlayManager.js +1 -2
- package/dist/cjs/overlayManager.js.map +1 -1
- package/dist/cjs/{react-select-creatable.esm-Bdv9YAMt.js → react-select-creatable.esm-lcdODVBz.js} +449 -243
- package/dist/cjs/react-select-creatable.esm-lcdODVBz.js.map +1 -0
- package/dist/cjs/useId-DXHUzdxd.js.map +1 -1
- package/dist/cjs/{useOverlayManager-CxBh9gVG.js → useOverlayManager-Bj58uLfc.js} +14 -9
- package/dist/cjs/{useOverlayManager-CxBh9gVG.js.map → useOverlayManager-Bj58uLfc.js.map} +1 -1
- package/dist/cjs/useQueryParams-BrrbBvY_.js +18 -0
- package/dist/cjs/{useQueryParams-l5fJJYCR.js.map → useQueryParams-BrrbBvY_.js.map} +1 -1
- package/dist/cjs/useRecentlyUsedColors-BcOkiB-v.js +1239 -0
- package/dist/cjs/useRecentlyUsedColors-BcOkiB-v.js.map +1 -0
- package/dist/cjs/useRestoreScrollPosition-DP8SUs19.js +236 -0
- package/dist/cjs/useRestoreScrollPosition-DP8SUs19.js.map +1 -0
- package/dist/constants.js.map +1 -1
- package/dist/formik/ActionBlock.js +16 -9
- package/dist/formik/ActionBlock.js.map +1 -1
- package/dist/formik/BlockNavigation.js +41 -31
- package/dist/formik/BlockNavigation.js.map +1 -1
- package/dist/formik/Button.js +6 -4
- package/dist/formik/Button.js.map +1 -1
- package/dist/formik/Checkbox.js +30 -29
- package/dist/formik/Checkbox.js.map +1 -1
- package/dist/formik/Form.js +54 -48
- package/dist/formik/Form.js.map +1 -1
- package/dist/formik/Input.js +28 -27
- package/dist/formik/Input.js.map +1 -1
- package/dist/formik/MultiEmailInput.js +11 -7
- package/dist/formik/MultiEmailInput.js.map +1 -1
- package/dist/formik/Radio.js +7 -7
- package/dist/formik/Radio.js.map +1 -1
- package/dist/formik/Select.js +17 -12
- package/dist/formik/Select.js.map +1 -1
- package/dist/formik/Slider.js +8 -8
- package/dist/formik/Slider.js.map +1 -1
- package/dist/formik/Switch.js +31 -28
- package/dist/formik/Switch.js.map +1 -1
- package/dist/formik/Textarea.js +29 -28
- package/dist/formik/Textarea.js.map +1 -1
- package/dist/formik/TreeSelect.js +9 -6
- package/dist/formik/TreeSelect.js.map +1 -1
- package/dist/formik/index.js +11 -7
- package/dist/formik/index.js.map +1 -1
- package/dist/{index-Dxaw6gl9.js → index-D6vmwyYl.js} +14 -16
- package/dist/index-D6vmwyYl.js.map +1 -0
- package/dist/{index-C4Jg7ZKa.js → index-D6yXgUQN.js} +196 -170
- package/dist/{index-C4Jg7ZKa.js.map → index-D6yXgUQN.js.map} +1 -1
- package/dist/index.css +1 -2
- package/dist/index.js +26 -10
- package/dist/index.js.map +1 -1
- package/dist/layouts.js +8 -3
- package/dist/layouts.js.map +1 -1
- package/dist/overlayManager.js +1 -2
- package/dist/overlayManager.js.map +1 -1
- package/dist/{react-select-creatable.esm-Dx_vEnyD.js → react-select-creatable.esm-opiJTCqo.js} +450 -244
- package/dist/react-select-creatable.esm-opiJTCqo.js.map +1 -0
- package/dist/useId-Jj9hXm-g.js.map +1 -1
- package/dist/{useOverlayManager-AZIGhUYS.js → useOverlayManager-BzuBvhPZ.js} +14 -9
- package/dist/{useOverlayManager-AZIGhUYS.js.map → useOverlayManager-BzuBvhPZ.js.map} +1 -1
- package/dist/useQueryParams-BKsf4FPY.js +16 -0
- package/dist/{useQueryParams-b60CHFUx.js.map → useQueryParams-BKsf4FPY.js.map} +1 -1
- package/dist/useRecentlyUsedColors-CtvdF-KQ.js +1236 -0
- package/dist/useRecentlyUsedColors-CtvdF-KQ.js.map +1 -0
- package/dist/useRestoreScrollPosition-BVX-mT5c.js +225 -0
- package/dist/useRestoreScrollPosition-BVX-mT5c.js.map +1 -0
- package/package.json +42 -48
- package/dist/cjs/react-select-creatable.esm-Bdv9YAMt.js.map +0 -1
- package/dist/cjs/useQueryParams-l5fJJYCR.js +0 -18
- package/dist/cjs/useRecentlyUsedColors-3cKx-eDH.js +0 -1270
- package/dist/cjs/useRecentlyUsedColors-3cKx-eDH.js.map +0 -1
- package/dist/cjs/useRestoreScrollPosition-PsoENtiB.js +0 -218
- package/dist/cjs/useRestoreScrollPosition-PsoENtiB.js.map +0 -1
- package/dist/index-Dxaw6gl9.js.map +0 -1
- package/dist/react-select-creatable.esm-Dx_vEnyD.js.map +0 -1
- package/dist/useQueryParams-b60CHFUx.js +0 -16
- package/dist/useRecentlyUsedColors-CqUfqfck.js +0 -1267
- package/dist/useRecentlyUsedColors-CqUfqfck.js.map +0 -1
- package/dist/useRestoreScrollPosition-C1NSANQW.js +0 -207
- package/dist/useRestoreScrollPosition-C1NSANQW.js.map +0 -1
- package/src/translations/ar.json +0 -41
- package/src/translations/bg.json +0 -41
- package/src/translations/ca.json +0 -41
- package/src/translations/cs.json +0 -41
- package/src/translations/da.json +0 -41
- package/src/translations/de.json +0 -41
- package/src/translations/en.json +0 -41
- package/src/translations/es-MX.json +0 -41
- package/src/translations/es.json +0 -41
- package/src/translations/et.json +0 -41
- package/src/translations/fi.json +0 -41
- package/src/translations/fil.json +0 -41
- package/src/translations/fr.json +0 -41
- package/src/translations/hi.json +0 -41
- package/src/translations/hr.json +0 -41
- package/src/translations/id.json +0 -41
- package/src/translations/index.js +0 -18
- package/src/translations/it.json +0 -41
- package/src/translations/ja.json +0 -41
- package/src/translations/ko.json +0 -41
- package/src/translations/nl.json +0 -41
- package/src/translations/pl.json +0 -41
- package/src/translations/pt-BR.json +0 -41
- package/src/translations/pt.json +0 -41
- package/src/translations/ro.json +0 -41
- package/src/translations/ru.json +0 -41
- package/src/translations/sk.json +0 -41
- package/src/translations/sl.json +0 -41
- package/src/translations/sv.json +0 -41
- package/src/translations/th.json +0 -41
- package/src/translations/tr.json +0 -41
- package/src/translations/uk.json +0 -41
- package/src/translations/vi.json +0 -41
- package/src/translations/zh-CN.json +0 -41
- package/src/translations/zh-TW.json +0 -41
package/dist/Dropdown.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import _extends from '@babel/runtime/helpers/extends';
|
|
2
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
2
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
3
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
|
-
import
|
|
4
|
+
import { forwardRef, useState } from 'react';
|
|
6
5
|
import Tippy from '@tippyjs/react';
|
|
7
6
|
import classnames from 'classnames';
|
|
8
|
-
import
|
|
7
|
+
import Down from '@bigbinary/neeto-icons/Down';
|
|
9
8
|
import { isNil } from 'ramda';
|
|
10
9
|
import Button from './Button.js';
|
|
11
|
-
import { h as hyphenize, n as noop } from './index-
|
|
10
|
+
import { h as hyphenize, n as noop } from './index-D6vmwyYl.js';
|
|
11
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
12
12
|
import { isPresent } from '@bigbinary/neeto-cist';
|
|
13
13
|
import Tooltip from './Tooltip.js';
|
|
14
14
|
import { Link } from 'react-router-dom';
|
|
@@ -25,51 +25,60 @@ import 'dayjs/plugin/utc';
|
|
|
25
25
|
import 'dayjs/plugin/weekday';
|
|
26
26
|
import 'dayjs/plugin/weekOfYear';
|
|
27
27
|
|
|
28
|
+
function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
29
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28
30
|
var Divider = function Divider(props) {
|
|
29
|
-
return /*#__PURE__*/
|
|
31
|
+
return /*#__PURE__*/jsx("li", _objectSpread$4({
|
|
30
32
|
className: "neeto-ui-dropdown__popup-divider"
|
|
31
33
|
}, props));
|
|
32
34
|
};
|
|
33
35
|
|
|
34
36
|
var _excluded$3 = ["children", "className"];
|
|
37
|
+
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
38
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
35
39
|
var Menu = function Menu(_ref) {
|
|
36
40
|
var children = _ref.children,
|
|
37
41
|
className = _ref.className,
|
|
38
42
|
otherProps = _objectWithoutProperties(_ref, _excluded$3);
|
|
39
|
-
return /*#__PURE__*/
|
|
43
|
+
return /*#__PURE__*/jsx("ul", _objectSpread$3(_objectSpread$3({
|
|
40
44
|
className: classnames("neeto-ui-dropdown__popup-menu", className)
|
|
41
|
-
}, otherProps),
|
|
45
|
+
}, otherProps), {}, {
|
|
46
|
+
children: children
|
|
47
|
+
}));
|
|
42
48
|
};
|
|
43
49
|
|
|
44
50
|
var _excluded$2 = ["children", "className", "tooltipProps"];
|
|
51
|
+
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
52
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
45
53
|
var MenuItem = function MenuItem(_ref) {
|
|
46
54
|
var children = _ref.children,
|
|
47
55
|
className = _ref.className,
|
|
48
56
|
tooltipProps = _ref.tooltipProps,
|
|
49
57
|
otherProps = _objectWithoutProperties(_ref, _excluded$2);
|
|
50
58
|
var renderMenuItem = function renderMenuItem() {
|
|
51
|
-
return /*#__PURE__*/
|
|
59
|
+
return /*#__PURE__*/jsx("li", _objectSpread$2(_objectSpread$2({
|
|
52
60
|
className: classnames("neeto-ui-dropdown__popup-menu-item", className)
|
|
53
|
-
}, otherProps),
|
|
61
|
+
}, otherProps), {}, {
|
|
62
|
+
children: children
|
|
63
|
+
}));
|
|
54
64
|
};
|
|
55
65
|
if (isPresent(tooltipProps)) {
|
|
56
|
-
return /*#__PURE__*/
|
|
66
|
+
return /*#__PURE__*/jsx(Tooltip, _objectSpread$2(_objectSpread$2({}, tooltipProps), {}, {
|
|
67
|
+
children: renderMenuItem()
|
|
68
|
+
}));
|
|
57
69
|
}
|
|
58
70
|
return renderMenuItem();
|
|
59
71
|
};
|
|
60
72
|
|
|
61
73
|
var _excluded$1 = ["children", "className", "isActive", "isDisabled", "style", "prefix", "suffix", "type", "to", "href", "tooltipProps"];
|
|
62
|
-
function ownKeys$1(
|
|
63
|
-
function _objectSpread$1(
|
|
74
|
+
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
75
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
64
76
|
var ITEM_BTN_STYLES = {
|
|
65
77
|
"default": "default",
|
|
66
78
|
danger: "danger"
|
|
67
79
|
};
|
|
68
80
|
var BUTTON_TYPES = {
|
|
69
|
-
button: "button"
|
|
70
|
-
reset: "reset",
|
|
71
|
-
submit: "submit"
|
|
72
|
-
};
|
|
81
|
+
button: "button"};
|
|
73
82
|
var MenuItemButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
74
83
|
var children = _ref.children,
|
|
75
84
|
className = _ref.className,
|
|
@@ -104,22 +113,27 @@ var MenuItemButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
104
113
|
type: type
|
|
105
114
|
};
|
|
106
115
|
}
|
|
107
|
-
return /*#__PURE__*/
|
|
108
|
-
tooltipProps: tooltipProps
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
116
|
+
return /*#__PURE__*/jsx(MenuItem, {
|
|
117
|
+
tooltipProps: tooltipProps,
|
|
118
|
+
children: /*#__PURE__*/jsxs(Parent, _objectSpread$1(_objectSpread$1({
|
|
119
|
+
disabled: isDisabled,
|
|
120
|
+
className: classnames("neeto-ui-dropdown__popup-menu-item-btn", className, {
|
|
121
|
+
"neeto-ui-dropdown__popup-menu-item-btn--active": isActive,
|
|
122
|
+
"neeto-ui-dropdown__popup-menu-item-btn--disabled": isDisabled,
|
|
123
|
+
"neeto-ui-dropdown__popup-menu-item-btn--style-danger": style === ITEM_BTN_STYLES.danger
|
|
124
|
+
})
|
|
125
|
+
}, _objectSpread$1(_objectSpread$1({
|
|
126
|
+
ref: ref
|
|
127
|
+
}, otherProps), elementSpecificProps)), {}, {
|
|
128
|
+
children: [prefix && /*#__PURE__*/jsx("div", {
|
|
129
|
+
className: "neeto-ui-dropdown__popup-menu-item-btn__prefix",
|
|
130
|
+
children: prefix
|
|
131
|
+
}), children, suffix && /*#__PURE__*/jsx("div", {
|
|
132
|
+
className: "neeto-ui-dropdown__popup-menu-item-btn__suffix",
|
|
133
|
+
children: suffix
|
|
134
|
+
})]
|
|
135
|
+
}))
|
|
136
|
+
});
|
|
123
137
|
});
|
|
124
138
|
MenuItemButton.displayName = "MenuItemButton";
|
|
125
139
|
|
|
@@ -128,43 +142,16 @@ MenuItem.Button = MenuItemButton;
|
|
|
128
142
|
var _excluded = ["style", "size"],
|
|
129
143
|
_excluded2 = ["icon", "label", "isOpen", "onClose", "dropdownProps", "position", "children", "className", "buttonStyle", "buttonSize", "buttonProps", "customTarget", "disabled", "closeOnEsc", "closeOnSelect", "closeOnOutsideClick", "dropdownModifiers", "trigger", "strategy", "onClick"],
|
|
130
144
|
_excluded3 = ["classNames", "className"];
|
|
131
|
-
function ownKeys(
|
|
132
|
-
function _objectSpread(
|
|
145
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
146
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
133
147
|
var BTN_STYLES = {
|
|
134
|
-
primary: "primary"
|
|
135
|
-
secondary: "secondary",
|
|
136
|
-
tertiary: "tertiary",
|
|
137
|
-
danger: "danger",
|
|
138
|
-
danger_text: "danger-text",
|
|
139
|
-
text: "text",
|
|
140
|
-
link: "link"
|
|
141
|
-
};
|
|
148
|
+
primary: "primary"};
|
|
142
149
|
var BTN_SIZES = {
|
|
143
|
-
|
|
144
|
-
medium: "medium",
|
|
145
|
-
large: "large"
|
|
146
|
-
};
|
|
150
|
+
medium: "medium"};
|
|
147
151
|
var STRATEGY = {
|
|
148
|
-
absolute: "absolute"
|
|
149
|
-
fixed: "fixed"
|
|
150
|
-
};
|
|
152
|
+
absolute: "absolute"};
|
|
151
153
|
var PLACEMENT = {
|
|
152
|
-
|
|
153
|
-
autoStart: "auto-start",
|
|
154
|
-
autoEnd: "auto-end",
|
|
155
|
-
top: "top",
|
|
156
|
-
topStart: "top-start",
|
|
157
|
-
topEnd: "top-end",
|
|
158
|
-
bottom: "bottom",
|
|
159
|
-
bottomStart: "bottom-start",
|
|
160
|
-
bottomEnd: "bottom-end",
|
|
161
|
-
right: "right",
|
|
162
|
-
rightStart: "right-start",
|
|
163
|
-
rightEnd: "right-end",
|
|
164
|
-
left: "left",
|
|
165
|
-
leftStart: "left-start",
|
|
166
|
-
leftEnd: "left-end"
|
|
167
|
-
};
|
|
154
|
+
bottomEnd: "bottom-end"};
|
|
168
155
|
var TRIGGERS = {
|
|
169
156
|
click: "click",
|
|
170
157
|
hover: "mouseenter focus",
|
|
@@ -252,7 +239,7 @@ var Dropdown = function Dropdown(_ref2) {
|
|
|
252
239
|
var close = function close() {
|
|
253
240
|
return instance.hide();
|
|
254
241
|
};
|
|
255
|
-
return /*#__PURE__*/
|
|
242
|
+
return /*#__PURE__*/jsx(Tippy, _objectSpread(_objectSpread({
|
|
256
243
|
interactive: true,
|
|
257
244
|
animation: false,
|
|
258
245
|
arrow: false,
|
|
@@ -273,11 +260,13 @@ var Dropdown = function Dropdown(_ref2) {
|
|
|
273
260
|
theme: "light",
|
|
274
261
|
trigger: isControlled ? undefined : TRIGGERS[trigger],
|
|
275
262
|
className: classnames("neeto-ui-dropdown", _defineProperty({}, className, className)),
|
|
276
|
-
content: mounted ? /*#__PURE__*/
|
|
263
|
+
content: mounted ? /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
|
|
277
264
|
"data-cy": "".concat(hyphenize(label), "-dropdown-container"),
|
|
278
265
|
className: classnames("neeto-ui-dropdown__popup", _defineProperty(_defineProperty({}, dropdownClassName, dropdownClassName), dropdownClassnames, dropdownClassnames)),
|
|
279
266
|
onClick: closeOnSelect ? close : noop
|
|
280
|
-
}, otherDropdownProps),
|
|
267
|
+
}, otherDropdownProps), {}, {
|
|
268
|
+
children: children
|
|
269
|
+
})) : null,
|
|
281
270
|
onCreate: function onCreate(instance) {
|
|
282
271
|
return instance && setInstance(instance);
|
|
283
272
|
},
|
|
@@ -291,21 +280,24 @@ var Dropdown = function Dropdown(_ref2) {
|
|
|
291
280
|
}, _objectSpread(_objectSpread({
|
|
292
281
|
disabled: disabled,
|
|
293
282
|
plugins: plugins
|
|
294
|
-
}, otherProps), controlledProps)),
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
283
|
+
}, otherProps), controlledProps)), {}, {
|
|
284
|
+
children: customTarget ? /*#__PURE__*/jsx("span", {
|
|
285
|
+
onClick: onClick,
|
|
286
|
+
className: classnames({
|
|
287
|
+
"neeto-ui-cursor-not-allowed": disabled
|
|
288
|
+
}),
|
|
289
|
+
children: typeof customTarget === "function" ? customTarget() : customTarget
|
|
290
|
+
}) : /*#__PURE__*/jsx(Button, _objectSpread({
|
|
291
|
+
label: label,
|
|
292
|
+
onClick: onClick,
|
|
293
|
+
"data-cy": "".concat(hyphenize(label), "-dropdown-icon"),
|
|
294
|
+
disabled: disabled || (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.disabled),
|
|
295
|
+
icon: icon || Down,
|
|
296
|
+
iconPosition: "right",
|
|
297
|
+
size: size !== null && size !== void 0 ? size : buttonSize,
|
|
298
|
+
style: style !== null && style !== void 0 ? style : buttonStyle
|
|
299
|
+
}, buttonProps))
|
|
300
|
+
}));
|
|
309
301
|
};
|
|
310
302
|
Dropdown.Menu = Menu;
|
|
311
303
|
Dropdown.MenuItem = MenuItem;
|
package/dist/Dropdown.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.js","sources":["../src/components/Dropdown/Divider.jsx","../src/components/Dropdown/Menu.jsx","../src/components/Dropdown/MenuItem/MenuItem.jsx","../src/components/Dropdown/MenuItem/MenuItemButton.jsx","../src/components/Dropdown/MenuItem/index.js","../src/components/Dropdown/index.jsx"],"sourcesContent":["import React from \"react\";\n\nconst Divider = props => (\n <li className=\"neeto-ui-dropdown__popup-divider\" {...props} />\n);\n\nexport default Divider;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Menu = ({ children, className, ...otherProps }) => (\n <ul\n className={classnames(\"neeto-ui-dropdown__popup-menu\", className)}\n {...otherProps}\n >\n {children}\n </ul>\n);\n\nMenu.propTypes = {\n /**\n * To specify className to be applied to the Menu.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Menu.\n */\n children: PropTypes.node,\n};\n\nexport default Menu;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport { isPresent } from \"neetocist\";\nimport PropTypes from \"prop-types\";\n\nimport Tooltip from \"components/Tooltip\";\n\nconst MenuItem = ({ children, className, tooltipProps, ...otherProps }) => {\n const renderMenuItem = () => (\n <li\n className={classnames(\"neeto-ui-dropdown__popup-menu-item\", className)}\n {...otherProps}\n >\n {children}\n </li>\n );\n\n if (isPresent(tooltipProps)) {\n return <Tooltip {...tooltipProps}>{renderMenuItem()}</Tooltip>;\n }\n\n return renderMenuItem();\n};\n\nMenuItem.propTypes = {\n /**\n * To specify className to be applied to the MenuItem.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the MenuItem.\n */\n children: PropTypes.node,\n /**\n * To specify the active state of the MenuItem.\n */\n isActive: PropTypes.bool,\n /**\n * To specify the props to be passed to the tooltip.\n */\n tooltipProps: PropTypes.object,\n};\n\nexport default MenuItem;\n","import React, { forwardRef } from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\nimport { Link } from \"react-router-dom\";\n\nimport MenuItem from \"./MenuItem\";\n\nconst ITEM_BTN_STYLES = { default: \"default\", danger: \"danger\" };\n\nconst BUTTON_TYPES = { button: \"button\", reset: \"reset\", submit: \"submit\" };\n\nconst MenuItemButton = forwardRef(\n (\n {\n children,\n className,\n isActive,\n isDisabled,\n style = ITEM_BTN_STYLES.default,\n prefix,\n suffix,\n type = BUTTON_TYPES.button,\n to = \"\",\n href = \"\",\n tooltipProps,\n ...otherProps\n },\n ref\n ) => {\n let Parent, elementSpecificProps;\n if (to) {\n Parent = Link;\n elementSpecificProps = { to };\n } else if (href) {\n Parent = \"a\";\n elementSpecificProps = { href };\n } else {\n Parent = \"button\";\n elementSpecificProps = { type };\n }\n\n return (\n <MenuItem {...{ tooltipProps }}>\n <Parent\n disabled={isDisabled}\n className={classnames(\n \"neeto-ui-dropdown__popup-menu-item-btn\",\n className,\n {\n \"neeto-ui-dropdown__popup-menu-item-btn--active\": isActive,\n \"neeto-ui-dropdown__popup-menu-item-btn--disabled\": isDisabled,\n \"neeto-ui-dropdown__popup-menu-item-btn--style-danger\":\n style === ITEM_BTN_STYLES.danger,\n }\n )}\n {...{ ref, ...otherProps, ...elementSpecificProps }}\n >\n {prefix && (\n <div className=\"neeto-ui-dropdown__popup-menu-item-btn__prefix\">\n {prefix}\n </div>\n )}\n {children}\n {suffix && (\n <div className=\"neeto-ui-dropdown__popup-menu-item-btn__suffix\">\n {suffix}\n </div>\n )}\n </Parent>\n </MenuItem>\n );\n }\n);\n\nMenuItemButton.displayName = \"MenuItemButton\";\n\nMenuItemButton.propTypes = {\n /**\n * To specify className to be applied to the MenuItem.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the MenuItem.\n */\n children: PropTypes.node,\n /**\n * To specify the active state of the MenuItem.\n */\n isActive: PropTypes.bool,\n /**\n * To specify whether the MenuItem is disabled.\n */\n isDisabled: PropTypes.bool,\n /**\n * To specify an internal route to which the button points to.\n */\n to: PropTypes.string,\n /**\n * To specify an external link to which the button points to.\n */\n href: PropTypes.string,\n /**\n * To specify the content to be added at the end of the input field.\n */\n suffix: PropTypes.node,\n /**\n * To specify the content to be added at the beginning of the input field.\n */\n prefix: PropTypes.node,\n /**\n * To specify the type of button.\n */\n type: PropTypes.oneOf(Object.values(BUTTON_TYPES)),\n /**\n * To specify the style of button.\n */\n style: PropTypes.oneOf(Object.values(ITEM_BTN_STYLES)),\n /**\n * To specify the props to be passed to the tooltip.\n */\n tooltipProps: PropTypes.object,\n};\n\nexport default MenuItemButton;\n","import MenuItem from \"./MenuItem\";\nimport MenuItemButton from \"./MenuItemButton\";\n\nMenuItem.Button = MenuItemButton;\n\nexport default MenuItem;\n","import React, { useState } from \"react\";\n\nimport Tippy from \"@tippyjs/react\";\nimport classnames from \"classnames\";\nimport { Down } from \"neetoicons\";\nimport PropTypes from \"prop-types\";\nimport { isNil } from \"ramda\";\n\nimport Button from \"components/Button\";\nimport { hyphenize, noop } from \"utils\";\n\nimport Divider from \"./Divider\";\nimport Menu from \"./Menu\";\nimport MenuItem from \"./MenuItem\";\n\nconst BTN_STYLES = {\n primary: \"primary\",\n secondary: \"secondary\",\n tertiary: \"tertiary\",\n danger: \"danger\",\n danger_text: \"danger-text\",\n text: \"text\",\n link: \"link\",\n};\n\nconst BTN_SIZES = {\n small: \"small\",\n medium: \"medium\",\n large: \"large\",\n};\n\nconst STRATEGY = { absolute: \"absolute\", fixed: \"fixed\" };\n\nconst PLACEMENT = {\n auto: \"auto\",\n autoStart: \"auto-start\",\n autoEnd: \"auto-end\",\n top: \"top\",\n topStart: \"top-start\",\n topEnd: \"top-end\",\n bottom: \"bottom\",\n bottomStart: \"bottom-start\",\n bottomEnd: \"bottom-end\",\n right: \"right\",\n rightStart: \"right-start\",\n rightEnd: \"right-end\",\n left: \"left\",\n leftStart: \"left-start\",\n leftEnd: \"left-end\",\n};\n\nconst TRIGGERS = {\n click: \"click\",\n hover: \"mouseenter focus\",\n all: \"mouseenter focus click\",\n manual: \"manual\",\n};\n\nconst hideOnEsc = {\n name: \"hideOnEsc\",\n defaultValue: true,\n fn({ hide, props: { hideOnEsc } }) {\n function onKeyDown(event) {\n if (event.key?.toLowerCase() === \"escape\" && hideOnEsc) hide();\n }\n\n return {\n onShow() {\n document.addEventListener(\"keydown\", onKeyDown);\n },\n onHide() {\n document.removeEventListener(\"keydown\", onKeyDown);\n },\n };\n },\n};\n\nconst plugins = [hideOnEsc];\n\nconst Dropdown = ({\n icon,\n label,\n isOpen,\n onClose = noop,\n dropdownProps = {},\n position = PLACEMENT.bottomEnd,\n children,\n className,\n buttonStyle = BTN_STYLES.primary,\n buttonSize = BTN_SIZES.medium,\n buttonProps: { style, size, ...buttonProps } = {},\n customTarget,\n disabled = false,\n closeOnEsc = true,\n closeOnSelect = true,\n closeOnOutsideClick = true,\n dropdownModifiers = [],\n trigger = TRIGGERS.click,\n strategy = STRATEGY.absolute,\n onClick,\n ...otherProps\n}) => {\n const [instance, setInstance] = useState(null);\n const [mounted, setMounted] = useState(false);\n\n const isControlled = !isNil(isOpen);\n\n const controlledProps = isControlled\n ? { visible: isOpen }\n : { onClickOutside: () => closeOnOutsideClick };\n\n const {\n classNames: dropdownClassnames,\n className: dropdownClassName,\n ...otherDropdownProps\n } = dropdownProps;\n\n const close = () => instance.hide();\n\n return (\n <Tippy\n interactive\n animation={false}\n arrow={false}\n duration={0}\n // hideOnClick determines whether the dropdown should be hidden when the user clicks outside of the dropdown.\n // https://atomiks.github.io/tippyjs/v6/all-props/#hideonclick\n hideOnClick={isControlled ? undefined : closeOnOutsideClick || \"toggle\"}\n hideOnEsc={closeOnEsc}\n maxWidth=\"none\"\n offset={0}\n placement={position || PLACEMENT.bottomEnd}\n popperOptions={{ strategy, modifiers: dropdownModifiers }}\n role=\"dropdown\"\n theme=\"light\"\n trigger={isControlled ? undefined : TRIGGERS[trigger]}\n className={classnames(\"neeto-ui-dropdown\", {\n [className]: className,\n })}\n content={\n mounted ? (\n <div\n data-cy={`${hyphenize(label)}-dropdown-container`}\n className={classnames(\"neeto-ui-dropdown__popup\", {\n [dropdownClassName]: dropdownClassName,\n [dropdownClassnames]: dropdownClassnames,\n })}\n onClick={closeOnSelect ? close : noop}\n {...otherDropdownProps}\n >\n {children}\n </div>\n ) : null\n }\n onCreate={instance => instance && setInstance(instance)}\n onMount={() => setMounted(true)}\n onHidden={() => {\n onClose();\n setMounted(false);\n }}\n {...{ disabled, plugins, ...otherProps, ...controlledProps }}\n >\n {customTarget ? (\n <span\n {...{ onClick }}\n className={classnames({ \"neeto-ui-cursor-not-allowed\": disabled })}\n >\n {typeof customTarget === \"function\" ? customTarget() : customTarget}\n </span>\n ) : (\n <Button\n {...{ label, onClick }}\n data-cy={`${hyphenize(label)}-dropdown-icon`}\n disabled={disabled || buttonProps?.disabled}\n icon={icon || Down}\n iconPosition=\"right\"\n size={size ?? buttonSize}\n style={style ?? buttonStyle}\n {...buttonProps}\n />\n )}\n </Tippy>\n );\n};\n\nDropdown.Menu = Menu;\nDropdown.MenuItem = MenuItem;\nDropdown.Divider = Divider;\n\nDropdown.propTypes = {\n /**\n * To specify the icon to be rendered in the Dropdown target.\n */\n icon: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),\n /**\n * To specify the label for Dropdown target button.\n */\n label: PropTypes.string,\n /**\n * To specify whether the Dropdown is open or not.\n */\n isOpen: PropTypes.bool,\n /**\n * To specify the action to be triggered on closing the Dropdown.\n */\n onClose: PropTypes.func,\n /**\n * To specify the triggering action for Dropdown.\n */\n trigger: PropTypes.oneOf(Object.keys(TRIGGERS)),\n /**\n * To specify the positioning strategy to use. By default, it is absolute, which in the simplest cases does not require repositioning of the Dropdown.\n *\n * If your reference element is in a fixed container, use the fixed strategy\n */\n strategy: PropTypes.oneOf(Object.values(STRATEGY)),\n /**\n * To specify the classes to be passed to the Dropdown menu.\n */\n dropdownProps: PropTypes.object,\n /**\n * To specify the position of the Dropdown menu.\n */\n position: PropTypes.oneOf(Object.values(PLACEMENT)),\n /**\n * To specify the content to be rendered inside the Dropdown.\n */\n children: PropTypes.node,\n /**\n * To provide external classnames to Dropdown target wrapper.\n */\n className: PropTypes.string,\n /**\n * <div class=\"neeto-ui-tag neeto-ui-tag--size-small neeto-ui-tag--style-outline neeto-ui-tag--style-success mb-2\">\n * New\n * </div>\n * To specify the size of the button to be rendered as the Dropdown target.\n */\n buttonSize: PropTypes.oneOf(Object.values(BTN_SIZES)),\n /**\n * To specify the style of the button to be rendered as the Dropdown target.\n */\n buttonStyle: PropTypes.oneOf(Object.values(BTN_STYLES)),\n /**\n * To specify the props to be passed to the Dropdown target button.\n */\n buttonProps: PropTypes.object,\n /**\n * To provide a custom target to be rendered instead of the default button target.\n */\n customTarget: PropTypes.node,\n /**\n * To specify whether the Dropdown is disabled or not.\n */\n disabled: PropTypes.bool,\n /**\n * To specify whether the Dropdown should close on pressing esc key.\n */\n closeOnEsc: PropTypes.bool,\n /**\n * To specify whether the Dropdown should close on selecting an option.\n */\n closeOnSelect: PropTypes.bool,\n /**\n * To specify whether the Dropdown should close on clicking outside the Dropdown content. (will not have any effect if the component is controlled.)\n */\n closeOnOutsideClick: PropTypes.bool,\n /**\n * To provide custom modifiers to Dropdown component.\n */\n dropdownModifiers: PropTypes.array,\n /**\n * <div class=\"neeto-ui-tag neeto-ui-tag--size-small neeto-ui-tag--style-outline neeto-ui-tag--style-danger mb-2\">\n * Removed\n * </div>\n * _Use `dropdownProps` props instead._\n *\n */\n ulProps: PropTypes.object,\n /**\n * To specify the action that should be triggered when clicking outside of the controlled dropdown component.\n */\n onClickOutside: PropTypes.func,\n};\n\nexport default Dropdown;\n"],"names":["Divider","props","React","createElement","_extends","className","Menu","_ref","children","otherProps","_objectWithoutProperties","_excluded","classnames","MenuItem","tooltipProps","renderMenuItem","isPresent","Tooltip","ITEM_BTN_STYLES","danger","BUTTON_TYPES","button","reset","submit","MenuItemButton","forwardRef","ref","isActive","isDisabled","_ref$style","style","prefix","suffix","_ref$type","type","_ref$to","to","_ref$href","href","Parent","elementSpecificProps","Link","disabled","_objectSpread","displayName","Button","BTN_STYLES","primary","secondary","tertiary","danger_text","text","link","BTN_SIZES","small","medium","large","STRATEGY","absolute","fixed","PLACEMENT","auto","autoStart","autoEnd","top","topStart","topEnd","bottom","bottomStart","bottomEnd","right","rightStart","rightEnd","left","leftStart","leftEnd","TRIGGERS","click","hover","all","manual","hideOnEsc","name","defaultValue","fn","hide","onKeyDown","event","_event$key","key","toLowerCase","onShow","document","addEventListener","onHide","removeEventListener","plugins","Dropdown","_ref2","icon","label","isOpen","_ref2$onClose","onClose","noop","_ref2$dropdownProps","dropdownProps","_ref2$position","position","_ref2$buttonStyle","buttonStyle","_ref2$buttonSize","buttonSize","_ref2$buttonProps","buttonProps","_ref2$buttonProps2","size","customTarget","_ref2$disabled","_ref2$closeOnEsc","closeOnEsc","_ref2$closeOnSelect","closeOnSelect","_ref2$closeOnOutsideC","closeOnOutsideClick","_ref2$dropdownModifie","dropdownModifiers","_ref2$trigger","trigger","_ref2$strategy","strategy","onClick","_excluded2","_useState","useState","_useState2","_slicedToArray","instance","setInstance","_useState3","_useState4","mounted","setMounted","isControlled","isNil","controlledProps","visible","onClickOutside","dropdownClassnames","classNames","dropdownClassName","otherDropdownProps","_excluded3","close","Tippy","interactive","animation","arrow","duration","hideOnClick","undefined","maxWidth","offset","placement","popperOptions","modifiers","role","theme","_defineProperty","content","concat","hyphenize","onCreate","onMount","onHidden","Down","iconPosition"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,OAAO,GAAG,SAAVA,OAAOA,CAAGC,KAAK,EAAA;AAAA,EAAA,oBACnBC,cAAA,CAAAC,aAAA,CAAA,IAAA,EAAAC,QAAA,CAAA;AAAIC,IAAAA,SAAS,EAAC,kCAAA;AAAkC,GAAA,EAAKJ,KAAK,CAAI,CAAA,CAAA;AAAA,CAC/D;;;ACCD,IAAMK,IAAI,GAAG,SAAPA,IAAIA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEH,SAAS,GAAAE,IAAA,CAATF,SAAS;AAAKI,IAAAA,UAAU,GAAAC,wBAAA,CAAAH,IAAA,EAAAI,WAAA,CAAA,CAAA;AAAA,EAAA,oBAChDT,cAAA,CAAAC,aAAA,CAAA,IAAA,EAAAC,QAAA,CAAA;AACEC,IAAAA,SAAS,EAAEO,UAAU,CAAC,+BAA+B,EAAEP,SAAS,CAAA;GAC5DI,EAAAA,UAAU,CAEbD,EAAAA,QAAQ,CACN,CAAA;AAAA,CACN;;;ACJD,IAAMK,QAAQ,GAAG,SAAXA,QAAQA,CAAAN,IAAA,EAA6D;AAAA,EAAA,IAAvDC,QAAQ,GAAAD,IAA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IAAI4E,IAAK;AACnBC,IAAAA,YAAY,EAAC,OAAO;AACpB5D,IAAAA,IAAI,EAAEA,IAAI,KAAA,IAAA,IAAJA,IAAI,KAAJA,KAAAA,CAAAA,GAAAA,IAAI,GAAIJ,UAAW;AACzBlF,IAAAA,KAAK,EAAEA,KAAK,KAAA,IAAA,IAALA,KAAK,KAAA,KAAA,CAAA,GAALA,KAAK,GAAIgF,WAAAA;GACZI,EAAAA,WAAW,EAElB,CACK,CAAA;AAEZ,EAAC;AAEDjB,QAAQ,CAAC3F,IAAI,GAAGA,IAAI,CAAA;AACpB2F,QAAQ,CAACpF,QAAQ,GAAGA,QAAQ,CAAA;AAC5BoF,QAAQ,CAACjG,OAAO,GAAGA,OAAO;;;;"}
|
|
1
|
+
{"version":3,"file":"Dropdown.js","sources":["../src/components/Dropdown/Divider.jsx","../src/components/Dropdown/Menu.jsx","../src/components/Dropdown/MenuItem/MenuItem.jsx","../src/components/Dropdown/MenuItem/MenuItemButton.jsx","../src/components/Dropdown/MenuItem/index.js","../src/components/Dropdown/index.jsx"],"sourcesContent":["import React from \"react\";\n\nconst Divider = props => (\n <li className=\"neeto-ui-dropdown__popup-divider\" {...props} />\n);\n\nexport default Divider;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Menu = ({ children, className, ...otherProps }) => (\n <ul\n className={classnames(\"neeto-ui-dropdown__popup-menu\", className)}\n {...otherProps}\n >\n {children}\n </ul>\n);\n\nMenu.propTypes = {\n /**\n * To specify className to be applied to the Menu.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Menu.\n */\n children: PropTypes.node,\n};\n\nexport default Menu;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport { isPresent } from \"neetocist\";\nimport PropTypes from \"prop-types\";\n\nimport Tooltip from \"components/Tooltip\";\n\nconst MenuItem = ({ children, className, tooltipProps, ...otherProps }) => {\n const renderMenuItem = () => (\n <li\n className={classnames(\"neeto-ui-dropdown__popup-menu-item\", className)}\n {...otherProps}\n >\n {children}\n </li>\n );\n\n if (isPresent(tooltipProps)) {\n return <Tooltip {...tooltipProps}>{renderMenuItem()}</Tooltip>;\n }\n\n return renderMenuItem();\n};\n\nMenuItem.propTypes = {\n /**\n * To specify className to be applied to the MenuItem.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the MenuItem.\n */\n children: PropTypes.node,\n /**\n * To specify the active state of the MenuItem.\n */\n isActive: PropTypes.bool,\n /**\n * To specify the props to be passed to the tooltip.\n */\n tooltipProps: PropTypes.object,\n};\n\nexport default MenuItem;\n","import React, { forwardRef } from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\nimport { Link } from \"react-router-dom\";\n\nimport MenuItem from \"./MenuItem\";\n\nconst ITEM_BTN_STYLES = { default: \"default\", danger: \"danger\" };\n\nconst BUTTON_TYPES = { button: \"button\", reset: \"reset\", submit: \"submit\" };\n\nconst MenuItemButton = forwardRef(\n (\n {\n children,\n className,\n isActive,\n isDisabled,\n style = ITEM_BTN_STYLES.default,\n prefix,\n suffix,\n type = BUTTON_TYPES.button,\n to = \"\",\n href = \"\",\n tooltipProps,\n ...otherProps\n },\n ref\n ) => {\n let Parent, elementSpecificProps;\n if (to) {\n Parent = Link;\n elementSpecificProps = { to };\n } else if (href) {\n Parent = \"a\";\n elementSpecificProps = { href };\n } else {\n Parent = \"button\";\n elementSpecificProps = { type };\n }\n\n return (\n <MenuItem {...{ tooltipProps }}>\n <Parent\n disabled={isDisabled}\n className={classnames(\n \"neeto-ui-dropdown__popup-menu-item-btn\",\n className,\n {\n \"neeto-ui-dropdown__popup-menu-item-btn--active\": isActive,\n \"neeto-ui-dropdown__popup-menu-item-btn--disabled\": isDisabled,\n \"neeto-ui-dropdown__popup-menu-item-btn--style-danger\":\n style === ITEM_BTN_STYLES.danger,\n }\n )}\n {...{ ref, ...otherProps, ...elementSpecificProps }}\n >\n {prefix && (\n <div className=\"neeto-ui-dropdown__popup-menu-item-btn__prefix\">\n {prefix}\n </div>\n )}\n {children}\n {suffix && (\n <div className=\"neeto-ui-dropdown__popup-menu-item-btn__suffix\">\n {suffix}\n </div>\n )}\n </Parent>\n </MenuItem>\n );\n }\n);\n\nMenuItemButton.displayName = \"MenuItemButton\";\n\nMenuItemButton.propTypes = {\n /**\n * To specify className to be applied to the MenuItem.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the MenuItem.\n */\n children: PropTypes.node,\n /**\n * To specify the active state of the MenuItem.\n */\n isActive: PropTypes.bool,\n /**\n * To specify whether the MenuItem is disabled.\n */\n isDisabled: PropTypes.bool,\n /**\n * To specify an internal route to which the button points to.\n */\n to: PropTypes.string,\n /**\n * To specify an external link to which the button points to.\n */\n href: PropTypes.string,\n /**\n * To specify the content to be added at the end of the input field.\n */\n suffix: PropTypes.node,\n /**\n * To specify the content to be added at the beginning of the input field.\n */\n prefix: PropTypes.node,\n /**\n * To specify the type of button.\n */\n type: PropTypes.oneOf(Object.values(BUTTON_TYPES)),\n /**\n * To specify the style of button.\n */\n style: PropTypes.oneOf(Object.values(ITEM_BTN_STYLES)),\n /**\n * To specify the props to be passed to the tooltip.\n */\n tooltipProps: PropTypes.object,\n};\n\nexport default MenuItemButton;\n","import MenuItem from \"./MenuItem\";\nimport MenuItemButton from \"./MenuItemButton\";\n\nMenuItem.Button = MenuItemButton;\n\nexport default MenuItem;\n","import React, { useState } from \"react\";\n\nimport Tippy from \"@tippyjs/react\";\nimport classnames from \"classnames\";\nimport { Down } from \"neetoicons\";\nimport PropTypes from \"prop-types\";\nimport { isNil } from \"ramda\";\n\nimport Button from \"components/Button\";\nimport { hyphenize, noop } from \"utils\";\n\nimport Divider from \"./Divider\";\nimport Menu from \"./Menu\";\nimport MenuItem from \"./MenuItem\";\n\nconst BTN_STYLES = {\n primary: \"primary\",\n secondary: \"secondary\",\n tertiary: \"tertiary\",\n danger: \"danger\",\n danger_text: \"danger-text\",\n text: \"text\",\n link: \"link\",\n};\n\nconst BTN_SIZES = {\n small: \"small\",\n medium: \"medium\",\n large: \"large\",\n};\n\nconst STRATEGY = { absolute: \"absolute\", fixed: \"fixed\" };\n\nconst PLACEMENT = {\n auto: \"auto\",\n autoStart: \"auto-start\",\n autoEnd: \"auto-end\",\n top: \"top\",\n topStart: \"top-start\",\n topEnd: \"top-end\",\n bottom: \"bottom\",\n bottomStart: \"bottom-start\",\n bottomEnd: \"bottom-end\",\n right: \"right\",\n rightStart: \"right-start\",\n rightEnd: \"right-end\",\n left: \"left\",\n leftStart: \"left-start\",\n leftEnd: \"left-end\",\n};\n\nconst TRIGGERS = {\n click: \"click\",\n hover: \"mouseenter focus\",\n all: \"mouseenter focus click\",\n manual: \"manual\",\n};\n\nconst hideOnEsc = {\n name: \"hideOnEsc\",\n defaultValue: true,\n fn({ hide, props: { hideOnEsc } }) {\n function onKeyDown(event) {\n if (event.key?.toLowerCase() === \"escape\" && hideOnEsc) hide();\n }\n\n return {\n onShow() {\n document.addEventListener(\"keydown\", onKeyDown);\n },\n onHide() {\n document.removeEventListener(\"keydown\", onKeyDown);\n },\n };\n },\n};\n\nconst plugins = [hideOnEsc];\n\nconst Dropdown = ({\n icon,\n label,\n isOpen,\n onClose = noop,\n dropdownProps = {},\n position = PLACEMENT.bottomEnd,\n children,\n className,\n buttonStyle = BTN_STYLES.primary,\n buttonSize = BTN_SIZES.medium,\n buttonProps: { style, size, ...buttonProps } = {},\n customTarget,\n disabled = false,\n closeOnEsc = true,\n closeOnSelect = true,\n closeOnOutsideClick = true,\n dropdownModifiers = [],\n trigger = TRIGGERS.click,\n strategy = STRATEGY.absolute,\n onClick,\n ...otherProps\n}) => {\n const [instance, setInstance] = useState(null);\n const [mounted, setMounted] = useState(false);\n\n const isControlled = !isNil(isOpen);\n\n const controlledProps = isControlled\n ? { visible: isOpen }\n : { onClickOutside: () => closeOnOutsideClick };\n\n const {\n classNames: dropdownClassnames,\n className: dropdownClassName,\n ...otherDropdownProps\n } = dropdownProps;\n\n const close = () => instance.hide();\n\n return (\n <Tippy\n interactive\n animation={false}\n arrow={false}\n duration={0}\n // hideOnClick determines whether the dropdown should be hidden when the user clicks outside of the dropdown.\n // https://atomiks.github.io/tippyjs/v6/all-props/#hideonclick\n hideOnClick={isControlled ? undefined : closeOnOutsideClick || \"toggle\"}\n hideOnEsc={closeOnEsc}\n maxWidth=\"none\"\n offset={0}\n placement={position || PLACEMENT.bottomEnd}\n popperOptions={{ strategy, modifiers: dropdownModifiers }}\n role=\"dropdown\"\n theme=\"light\"\n trigger={isControlled ? undefined : TRIGGERS[trigger]}\n className={classnames(\"neeto-ui-dropdown\", {\n [className]: className,\n })}\n content={\n mounted ? (\n <div\n data-cy={`${hyphenize(label)}-dropdown-container`}\n className={classnames(\"neeto-ui-dropdown__popup\", {\n [dropdownClassName]: dropdownClassName,\n [dropdownClassnames]: dropdownClassnames,\n })}\n onClick={closeOnSelect ? close : noop}\n {...otherDropdownProps}\n >\n {children}\n </div>\n ) : null\n }\n onCreate={instance => instance && setInstance(instance)}\n onMount={() => setMounted(true)}\n onHidden={() => {\n onClose();\n setMounted(false);\n }}\n {...{ disabled, plugins, ...otherProps, ...controlledProps }}\n >\n {customTarget ? (\n <span\n {...{ onClick }}\n className={classnames({ \"neeto-ui-cursor-not-allowed\": disabled })}\n >\n {typeof customTarget === \"function\" ? customTarget() : customTarget}\n </span>\n ) : (\n <Button\n {...{ label, onClick }}\n data-cy={`${hyphenize(label)}-dropdown-icon`}\n disabled={disabled || buttonProps?.disabled}\n icon={icon || Down}\n iconPosition=\"right\"\n size={size ?? buttonSize}\n style={style ?? buttonStyle}\n {...buttonProps}\n />\n )}\n </Tippy>\n );\n};\n\nDropdown.Menu = Menu;\nDropdown.MenuItem = MenuItem;\nDropdown.Divider = Divider;\n\nDropdown.propTypes = {\n /**\n * To specify the icon to be rendered in the Dropdown target.\n */\n icon: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),\n /**\n * To specify the label for Dropdown target button.\n */\n label: PropTypes.string,\n /**\n * To specify whether the Dropdown is open or not.\n */\n isOpen: PropTypes.bool,\n /**\n * To specify the action to be triggered on closing the Dropdown.\n */\n onClose: PropTypes.func,\n /**\n * To specify the triggering action for Dropdown.\n */\n trigger: PropTypes.oneOf(Object.keys(TRIGGERS)),\n /**\n * To specify the positioning strategy to use. By default, it is absolute, which in the simplest cases does not require repositioning of the Dropdown.\n *\n * If your reference element is in a fixed container, use the fixed strategy\n */\n strategy: PropTypes.oneOf(Object.values(STRATEGY)),\n /**\n * To specify the classes to be passed to the Dropdown menu.\n */\n dropdownProps: PropTypes.object,\n /**\n * To specify the position of the Dropdown menu.\n */\n position: PropTypes.oneOf(Object.values(PLACEMENT)),\n /**\n * To specify the content to be rendered inside the Dropdown.\n */\n children: PropTypes.node,\n /**\n * To provide external classnames to Dropdown target wrapper.\n */\n className: PropTypes.string,\n /**\n * <div class=\"neeto-ui-tag neeto-ui-tag--size-small neeto-ui-tag--style-outline neeto-ui-tag--style-success mb-2\">\n * New\n * </div>\n * To specify the size of the button to be rendered as the Dropdown target.\n */\n buttonSize: PropTypes.oneOf(Object.values(BTN_SIZES)),\n /**\n * To specify the style of the button to be rendered as the Dropdown target.\n */\n buttonStyle: PropTypes.oneOf(Object.values(BTN_STYLES)),\n /**\n * To specify the props to be passed to the Dropdown target button.\n */\n buttonProps: PropTypes.object,\n /**\n * To provide a custom target to be rendered instead of the default button target.\n */\n customTarget: PropTypes.node,\n /**\n * To specify whether the Dropdown is disabled or not.\n */\n disabled: PropTypes.bool,\n /**\n * To specify whether the Dropdown should close on pressing esc key.\n */\n closeOnEsc: PropTypes.bool,\n /**\n * To specify whether the Dropdown should close on selecting an option.\n */\n closeOnSelect: PropTypes.bool,\n /**\n * To specify whether the Dropdown should close on clicking outside the Dropdown content. (will not have any effect if the component is controlled.)\n */\n closeOnOutsideClick: PropTypes.bool,\n /**\n * To provide custom modifiers to Dropdown component.\n */\n dropdownModifiers: PropTypes.array,\n /**\n * <div class=\"neeto-ui-tag neeto-ui-tag--size-small neeto-ui-tag--style-outline neeto-ui-tag--style-danger mb-2\">\n * Removed\n * </div>\n * _Use `dropdownProps` props instead._\n *\n */\n ulProps: PropTypes.object,\n /**\n * To specify the action that should be triggered when clicking outside of the controlled dropdown component.\n */\n onClickOutside: PropTypes.func,\n};\n\nexport default Dropdown;\n"],"names":["Divider","props","_jsx","_objectSpread","className","Menu","_ref","children","otherProps","_objectWithoutProperties","_excluded","classnames","MenuItem","tooltipProps","renderMenuItem","isPresent","Tooltip","ITEM_BTN_STYLES","danger","BUTTON_TYPES","button","MenuItemButton","forwardRef","ref","isActive","isDisabled","_ref$style","style","prefix","suffix","_ref$type","type","_ref$to","to","_ref$href","href","Parent","elementSpecificProps","Link","_jsxs","disabled","displayName","Button","BTN_STYLES","primary","BTN_SIZES","small","medium","STRATEGY","absolute","PLACEMENT","auto","bottomEnd","TRIGGERS","click","hover","all","manual","hideOnEsc","name","defaultValue","fn","hide","onKeyDown","event","_event$key","key","toLowerCase","onShow","document","addEventListener","onHide","removeEventListener","plugins","Dropdown","_ref2","icon","label","isOpen","_ref2$onClose","onClose","noop","_ref2$dropdownProps","dropdownProps","_ref2$position","position","_ref2$buttonStyle","buttonStyle","_ref2$buttonSize","buttonSize","_ref2$buttonProps","buttonProps","_ref2$buttonProps2","size","customTarget","_ref2$disabled","_ref2$closeOnEsc","closeOnEsc","_ref2$closeOnSelect","closeOnSelect","_ref2$closeOnOutsideC","closeOnOutsideClick","_ref2$dropdownModifie","dropdownModifiers","_ref2$trigger","trigger","_ref2$strategy","strategy","onClick","_excluded2","_useState","useState","_useState2","_slicedToArray","instance","setInstance","_useState3","_useState4","mounted","setMounted","isControlled","isNil","controlledProps","visible","onClickOutside","dropdownClassnames","classNames","dropdownClassName","otherDropdownProps","_excluded3","close","Tippy","interactive","animation","arrow","duration","hideOnClick","undefined","maxWidth","offset","placement","popperOptions","modifiers","role","theme","_defineProperty","content","concat","hyphenize","onCreate","onMount","onHidden","Down","iconPosition"],"mappings":";;;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AA,EACxBI,WAAW,CAChB;AACF,GAAA,CACI,CAAC;AAEZ;AAEAjB,QAAQ,CAACrE,IAAI,GAAGA,IAAI;AACpBqE,QAAQ,CAAC9D,QAAQ,GAAGA,QAAQ;AAC5B8D,QAAQ,CAAC1E,OAAO,GAAGA,OAAO;;;;"}
|
package/dist/Input.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
-
import _extends from '@babel/runtime/helpers/extends';
|
|
3
2
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
3
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
|
-
import
|
|
4
|
+
import { forwardRef, useState } from 'react';
|
|
6
5
|
import classnames from 'classnames';
|
|
6
|
+
import { replace, mergeDeepLeft } from 'ramda';
|
|
7
7
|
import { u as useId } from './useId-Jj9hXm-g.js';
|
|
8
8
|
import 'react-router-dom';
|
|
9
9
|
import '@bigbinary/neeto-hotkeys';
|
|
10
10
|
import './overlayManager.js';
|
|
11
|
-
import { h as hyphenize } from './index-
|
|
11
|
+
import { h as hyphenize } from './index-D6vmwyYl.js';
|
|
12
12
|
import 'qs';
|
|
13
|
-
import { replace } from 'ramda';
|
|
14
13
|
import Label from './Label.js';
|
|
14
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
15
15
|
import '@babel/runtime/helpers/classCallCheck';
|
|
16
16
|
import '@babel/runtime/helpers/createClass';
|
|
17
17
|
import '@bigbinary/neeto-cist';
|
|
@@ -22,7 +22,7 @@ import 'dayjs/plugin/localeData';
|
|
|
22
22
|
import 'dayjs/plugin/utc';
|
|
23
23
|
import 'dayjs/plugin/weekday';
|
|
24
24
|
import 'dayjs/plugin/weekOfYear';
|
|
25
|
-
import '@bigbinary/neeto-icons';
|
|
25
|
+
import '@bigbinary/neeto-icons/Help';
|
|
26
26
|
import './Button.js';
|
|
27
27
|
import './Spinner.js';
|
|
28
28
|
import './Tooltip.js';
|
|
@@ -82,13 +82,10 @@ var preserveCursor = function preserveCursor(e, updateValueFn) {
|
|
|
82
82
|
};
|
|
83
83
|
|
|
84
84
|
var _excluded = ["size", "type", "label", "dataCy", "error", "suffix", "prefix", "disabled", "helpText", "className", "nakedInput", "contentSize", "required", "maxLength", "unlimitedChars", "labelProps", "rejectCharsRegex", "onBlur", "disableTrimOnBlur", "precision"];
|
|
85
|
-
function ownKeys(
|
|
86
|
-
function _objectSpread(
|
|
85
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
86
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
87
87
|
var SIZES = {
|
|
88
|
-
|
|
89
|
-
medium: "medium",
|
|
90
|
-
large: "large"
|
|
91
|
-
};
|
|
88
|
+
medium: "medium"};
|
|
92
89
|
var Input = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
93
90
|
var _ref2, _formatWithPrecision;
|
|
94
91
|
var _ref$size = _ref.size,
|
|
@@ -144,7 +141,7 @@ var Input = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
144
141
|
if (!otherProps.onChange || !otherProps.value) {
|
|
145
142
|
setValueInternal(e.target.value);
|
|
146
143
|
}
|
|
147
|
-
(_otherProps$onChange = otherProps.onChange) === null || _otherProps$onChange === void 0
|
|
144
|
+
(_otherProps$onChange = otherProps.onChange) === null || _otherProps$onChange === void 0 ? void 0 : _otherProps$onChange.call(otherProps, e);
|
|
148
145
|
};
|
|
149
146
|
var isMaxLengthPresent = !!maxLength || maxLength === 0;
|
|
150
147
|
var handleChange = function handleChange(e) {
|
|
@@ -156,14 +153,19 @@ var Input = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
156
153
|
formattedValue = enforceDecimalPrecision(formattedValue, precision);
|
|
157
154
|
if (formattedValue !== e.target.value) {
|
|
158
155
|
preserveCursor(e, function () {
|
|
159
|
-
return
|
|
156
|
+
return mergeDeepLeft({
|
|
157
|
+
target: {
|
|
158
|
+
value: formattedValue
|
|
159
|
+
}
|
|
160
|
+
}, e);
|
|
160
161
|
});
|
|
162
|
+
} else {
|
|
163
|
+
onChange(e);
|
|
161
164
|
}
|
|
162
|
-
onChange(e);
|
|
163
165
|
};
|
|
164
166
|
var handleOnBlur = function handleOnBlur(e) {
|
|
165
167
|
if (type === "file") {
|
|
166
|
-
onBlur === null || onBlur === void 0
|
|
168
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
|
|
167
169
|
return;
|
|
168
170
|
}
|
|
169
171
|
var trimmedValue = getTrimmedValue(value, disableTrimOnBlur);
|
|
@@ -172,66 +174,76 @@ var Input = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
172
174
|
e.target.value = formattedValue;
|
|
173
175
|
handleChange(e);
|
|
174
176
|
}
|
|
175
|
-
onBlur === null || onBlur === void 0
|
|
177
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
|
|
176
178
|
};
|
|
177
179
|
var handleOnWheel = function handleOnWheel(e) {
|
|
178
180
|
if (type === "number") e.target.blur();
|
|
179
181
|
};
|
|
180
182
|
var dataCyLabel = typeof label === "string" ? hyphenize(label) : hyphenize(dataCy);
|
|
181
|
-
return /*#__PURE__*/
|
|
182
|
-
className: classnames(["neeto-ui-input__wrapper", className])
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
"
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
"
|
|
199
|
-
"neeto-ui-input
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
183
|
+
return /*#__PURE__*/jsxs("div", {
|
|
184
|
+
className: classnames(["neeto-ui-input__wrapper", className]),
|
|
185
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
186
|
+
className: "neeto-ui-input__label-wrapper",
|
|
187
|
+
children: [label && /*#__PURE__*/jsx(Label, _objectSpread(_objectSpread({
|
|
188
|
+
required: required,
|
|
189
|
+
"data-cy": "".concat(dataCyLabel, "-input-label"),
|
|
190
|
+
htmlFor: id
|
|
191
|
+
}, labelProps), {}, {
|
|
192
|
+
children: label
|
|
193
|
+
})), isCharacterLimitVisible && /*#__PURE__*/jsxs("p", {
|
|
194
|
+
className: classnames("neeto-ui-input__max-length", {
|
|
195
|
+
"neeto-ui-input__max-length--error": maxLengthError
|
|
196
|
+
}),
|
|
197
|
+
children: [valueLength, "/", maxLength]
|
|
198
|
+
})]
|
|
199
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
200
|
+
"data-cy": "".concat(dataCyLabel, "-input"),
|
|
201
|
+
className: classnames("neeto-ui-input", {
|
|
202
|
+
"neeto-ui-input--naked": !!nakedInput,
|
|
203
|
+
"neeto-ui-input--error": !!error,
|
|
204
|
+
"neeto-ui-input--disabled": !!disabled,
|
|
205
|
+
"neeto-ui-input--small": size === "small",
|
|
206
|
+
"neeto-ui-input--medium": size === "medium",
|
|
207
|
+
"neeto-ui-input--large": size === "large"
|
|
208
|
+
}),
|
|
209
|
+
children: [prefix && /*#__PURE__*/jsx("div", {
|
|
210
|
+
className: "neeto-ui-input__prefix",
|
|
211
|
+
children: prefix
|
|
212
|
+
}), /*#__PURE__*/jsx("input", _objectSpread(_objectSpread({
|
|
213
|
+
"aria-invalid": !!error,
|
|
214
|
+
"data-cy": "".concat(dataCyLabel, "-input-field"),
|
|
215
|
+
size: contentSize,
|
|
216
|
+
"aria-describedby": classnames(_defineProperty(_defineProperty({}, errorId, !!error), helpTextId, helpText))
|
|
217
|
+
}, _objectSpread(_objectSpread(_objectSpread({
|
|
218
|
+
disabled: disabled,
|
|
219
|
+
id: id,
|
|
220
|
+
ref: ref,
|
|
221
|
+
required: required,
|
|
222
|
+
type: type
|
|
223
|
+
}, isMaxLengthPresent && !unlimitedChars && {
|
|
224
|
+
maxLength: maxLength
|
|
225
|
+
}), otherProps), {}, {
|
|
226
|
+
value: value
|
|
227
|
+
})), {}, {
|
|
228
|
+
onBlur: handleOnBlur,
|
|
229
|
+
onChange: handleChange,
|
|
230
|
+
onWheel: handleOnWheel
|
|
231
|
+
})), suffix && /*#__PURE__*/jsx("div", {
|
|
232
|
+
className: "neeto-ui-input__suffix",
|
|
233
|
+
children: suffix
|
|
234
|
+
})]
|
|
235
|
+
}), !!error && /*#__PURE__*/jsx("p", {
|
|
236
|
+
className: "neeto-ui-input__error",
|
|
237
|
+
"data-cy": "".concat(dataCyLabel, "-input-error"),
|
|
238
|
+
id: errorId,
|
|
239
|
+
children: error
|
|
240
|
+
}), helpText && /*#__PURE__*/jsx("p", {
|
|
241
|
+
className: "neeto-ui-input__help-text",
|
|
242
|
+
"data-cy": "".concat(dataCyLabel, "-input-help"),
|
|
243
|
+
id: helpTextId,
|
|
244
|
+
children: helpText
|
|
245
|
+
})]
|
|
246
|
+
});
|
|
235
247
|
});
|
|
236
248
|
Input.displayName = "Input";
|
|
237
249
|
|