@webiny/ui 5.27.0 → 5.28.0-beta.0
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/Accordion/Accordion.js +27 -13
- package/Accordion/Accordion.js.map +1 -1
- package/Accordion/Accordion.stories.js +34 -23
- package/Accordion/Accordion.stories.js.map +1 -1
- package/Accordion/AccordionItem.js +60 -36
- package/Accordion/AccordionItem.js.map +1 -1
- package/Accordion/index.js +31 -2
- package/Accordion/index.js.map +1 -1
- package/Alert/Alert.js +21 -10
- package/Alert/Alert.js.map +1 -1
- package/Alert/Alert.stories.js +22 -13
- package/Alert/Alert.stories.js.map +1 -1
- package/Alert/index.js +18 -1
- package/Alert/index.js.map +1 -1
- package/AutoComplete/AutoComplete.js +100 -77
- package/AutoComplete/AutoComplete.js.map +1 -1
- package/AutoComplete/AutoComplete.stories.js +27 -17
- package/AutoComplete/AutoComplete.stories.js.map +1 -1
- package/AutoComplete/MultiAutoComplete.js +164 -139
- package/AutoComplete/MultiAutoComplete.js.map +1 -1
- package/AutoComplete/MultiAutoComplete.stories.js +39 -28
- package/AutoComplete/MultiAutoComplete.stories.js.map +1 -1
- package/AutoComplete/index.js +31 -2
- package/AutoComplete/index.js.map +1 -1
- package/AutoComplete/styles.js +14 -4
- package/AutoComplete/styles.js.map +1 -1
- package/AutoComplete/types.js +5 -1
- package/AutoComplete/types.js.map +1 -1
- package/AutoComplete/utils.js +19 -4
- package/AutoComplete/utils.js.map +1 -1
- package/Avatar/Avatar.js +30 -15
- package/Avatar/Avatar.js.map +1 -1
- package/Avatar/Avatar.stories.js +19 -10
- package/Avatar/Avatar.stories.js.map +1 -1
- package/Avatar/index.js +18 -1
- package/Avatar/index.js.map +1 -1
- package/Button/Button.js +52 -23
- package/Button/Button.js.map +1 -1
- package/Button/Button.stories.js +42 -29
- package/Button/Button.stories.js.map +1 -1
- package/Button/CopyButton/CopyButton.js +24 -11
- package/Button/CopyButton/CopyButton.js.map +1 -1
- package/Button/CopyButton/CopyButton.stories.js +20 -10
- package/Button/CopyButton/CopyButton.stories.js.map +1 -1
- package/Button/IconButton/IconButton.js +14 -4
- package/Button/IconButton/IconButton.js.map +1 -1
- package/Button/IconButton/IconButton.stories.js +31 -19
- package/Button/IconButton/IconButton.stories.js.map +1 -1
- package/Button/index.js +44 -3
- package/Button/index.js.map +1 -1
- package/Carousel/Carousel.js +34 -21
- package/Carousel/Carousel.js.map +1 -1
- package/Carousel/Carouser.stories.js +27 -17
- package/Carousel/Carouser.stories.js.map +1 -1
- package/Carousel/index.js +15 -1
- package/Carousel/index.js.map +1 -1
- package/Checkbox/Checkbox.js +37 -22
- package/Checkbox/Checkbox.js.map +1 -1
- package/Checkbox/Checkbox.stories.js +27 -16
- package/Checkbox/Checkbox.stories.js.map +1 -1
- package/Checkbox/Checkbox.styles.js +11 -4
- package/Checkbox/Checkbox.styles.js.map +1 -1
- package/Checkbox/CheckboxGroup.js +36 -21
- package/Checkbox/CheckboxGroup.js.map +1 -1
- package/Checkbox/CheckboxGroup.stories.js +29 -18
- package/Checkbox/CheckboxGroup.stories.js.map +1 -1
- package/Checkbox/index.js +23 -2
- package/Checkbox/index.js.map +1 -1
- package/Chips/Chip.js +21 -7
- package/Chips/Chip.js.map +1 -1
- package/Chips/ChipIcon.js +21 -7
- package/Chips/ChipIcon.js.map +1 -1
- package/Chips/Chips.js +29 -12
- package/Chips/Chips.js.map +1 -1
- package/Chips/Chips.stories.js +27 -16
- package/Chips/Chips.stories.js.map +1 -1
- package/Chips/index.js +44 -3
- package/Chips/index.js.map +1 -1
- package/Chips/styles.js +14 -4
- package/Chips/styles.js.map +1 -1
- package/CodeEditor/CodeEditor.js +48 -29
- package/CodeEditor/CodeEditor.js.map +1 -1
- package/CodeEditor/CodeEditor.stories.js +30 -17
- package/CodeEditor/CodeEditor.stories.js.map +1 -1
- package/CodeEditor/index.js +18 -1
- package/CodeEditor/index.js.map +1 -1
- package/ColorPicker/ColorPicker.js +58 -44
- package/ColorPicker/ColorPicker.js.map +1 -1
- package/ColorPicker/ColorPicker.stories.js +26 -15
- package/ColorPicker/ColorPicker.stories.js.map +1 -1
- package/ColorPicker/index.js +18 -1
- package/ColorPicker/index.js.map +1 -1
- package/ConfirmationDialog/ConfirmationDialog.js +51 -42
- package/ConfirmationDialog/ConfirmationDialog.js.map +1 -1
- package/ConfirmationDialog/ConfirmationDialog.stories.js +22 -12
- package/ConfirmationDialog/ConfirmationDialog.stories.js.map +1 -1
- package/ConfirmationDialog/index.js +31 -2
- package/ConfirmationDialog/index.js.map +1 -1
- package/ConfirmationDialog/withConfirmation.js +19 -6
- package/ConfirmationDialog/withConfirmation.js.map +1 -1
- package/Dialog/Dialog.js +68 -37
- package/Dialog/Dialog.js.map +1 -1
- package/Dialog/Dialog.stories.js +26 -16
- package/Dialog/Dialog.stories.js.map +1 -1
- package/Dialog/index.js +18 -1
- package/Dialog/index.js.map +1 -1
- package/Drawer/Drawer.js +20 -6
- package/Drawer/Drawer.js.map +1 -1
- package/Drawer/Drawer.stories.js +26 -15
- package/Drawer/Drawer.stories.js.map +1 -1
- package/Drawer/index.js +18 -1
- package/Drawer/index.js.map +1 -1
- package/DynamicFieldset/Fieldset.js +56 -47
- package/DynamicFieldset/Fieldset.js.map +1 -1
- package/DynamicFieldset/index.js +15 -1
- package/DynamicFieldset/index.js.map +1 -1
- package/Elevation/Elevation.js +17 -6
- package/Elevation/Elevation.js.map +1 -1
- package/Elevation/Elevation.stories.js +27 -16
- package/Elevation/Elevation.stories.js.map +1 -1
- package/Elevation/index.js +18 -1
- package/Elevation/index.js.map +1 -1
- package/FormElementMessage/FormElementMessage.js +15 -5
- package/FormElementMessage/FormElementMessage.js.map +1 -1
- package/FormElementMessage/index.js +13 -1
- package/FormElementMessage/index.js.map +1 -1
- package/FullName/FullName.js +8 -1
- package/FullName/FullName.js.map +1 -1
- package/FullName/index.js +18 -1
- package/FullName/index.js.map +1 -1
- package/Grid/Grid.js +26 -9
- package/Grid/Grid.js.map +1 -1
- package/Grid/Grid.stories.js +21 -12
- package/Grid/Grid.stories.js.map +1 -1
- package/Grid/index.js +18 -1
- package/Grid/index.js.map +1 -1
- package/Helpers/ClassNames.js +16 -7
- package/Helpers/ClassNames.js.map +1 -1
- package/Helpers/index.js +13 -2
- package/Helpers/index.js.map +1 -1
- package/Icon/Icon.js +19 -7
- package/Icon/Icon.js.map +1 -1
- package/Icon/Icon.stories.js +33 -20
- package/Icon/Icon.stories.js.map +1 -1
- package/Icon/index.js +18 -1
- package/Icon/index.js.map +1 -1
- package/Image/Image.js +15 -7
- package/Image/Image.js.map +1 -1
- package/Image/Image.stories.js +21 -11
- package/Image/Image.stories.js.map +1 -1
- package/Image/index.js +18 -1
- package/Image/index.js.map +1 -1
- package/ImageEditor/ImageEditor.js +75 -65
- package/ImageEditor/ImageEditor.js.map +1 -1
- package/ImageEditor/index.js +18 -1
- package/ImageEditor/index.js.map +1 -1
- package/ImageEditor/toolbar/crop.js +30 -13
- package/ImageEditor/toolbar/crop.js.map +1 -1
- package/ImageEditor/toolbar/filter.js +61 -44
- package/ImageEditor/toolbar/filter.js.map +1 -1
- package/ImageEditor/toolbar/flip.js +32 -15
- package/ImageEditor/toolbar/flip.js.map +1 -1
- package/ImageEditor/toolbar/icons/index.js +69 -8
- package/ImageEditor/toolbar/icons/index.js.map +1 -1
- package/ImageEditor/toolbar/index.js +39 -4
- package/ImageEditor/toolbar/index.js.map +1 -1
- package/ImageEditor/toolbar/rotate.js +58 -35
- package/ImageEditor/toolbar/rotate.js.map +1 -1
- package/ImageEditor/toolbar/types.js +5 -1
- package/ImageEditor/toolbar/types.js.map +1 -1
- package/ImageUpload/Image.js +57 -35
- package/ImageUpload/Image.js.map +1 -1
- package/ImageUpload/ImageEditorDialog.js +48 -30
- package/ImageUpload/ImageEditorDialog.js.map +1 -1
- package/ImageUpload/MultiImageUpload.js +88 -70
- package/ImageUpload/MultiImageUpload.js.map +1 -1
- package/ImageUpload/MultiImageUpload.stories.js +26 -15
- package/ImageUpload/MultiImageUpload.stories.js.map +1 -1
- package/ImageUpload/SingleImageUpload.js +68 -45
- package/ImageUpload/SingleImageUpload.js.map +1 -1
- package/ImageUpload/SingleImageUpload.stories.js +27 -16
- package/ImageUpload/SingleImageUpload.stories.js.map +1 -1
- package/ImageUpload/index.js +39 -4
- package/ImageUpload/index.js.map +1 -1
- package/ImageUpload/styled.d.ts +2 -2
- package/ImageUpload/styled.js +29 -15
- package/ImageUpload/styled.js.map +1 -1
- package/Input/Input.js +52 -35
- package/Input/Input.js.map +1 -1
- package/Input/Input.stories.js +62 -46
- package/Input/Input.stories.js.map +1 -1
- package/Input/__tests__/Input.test.js +37 -26
- package/Input/__tests__/Input.test.js.map +1 -1
- package/Input/index.js +18 -1
- package/Input/index.js.map +1 -1
- package/List/CollapsibleList/CollapsibleList.stories.js +27 -16
- package/List/CollapsibleList/CollapsibleList.stories.js.map +1 -1
- package/List/CollapsibleList/index.js +21 -6
- package/List/CollapsibleList/index.js.map +1 -1
- package/List/DataList/DataList.js +89 -60
- package/List/DataList/DataList.js.map +1 -1
- package/List/DataList/DataList.stories.js +37 -25
- package/List/DataList/DataList.stories.js.map +1 -1
- package/List/DataList/DataListModalOverlay/DataListModalOverlay.js +29 -10
- package/List/DataList/DataListModalOverlay/DataListModalOverlay.js.map +1 -1
- package/List/DataList/DataListModalOverlay/DataListModalOverlayAction.js +27 -9
- package/List/DataList/DataListModalOverlay/DataListModalOverlayAction.js.map +1 -1
- package/List/DataList/DataListModalOverlay/DataListModalOverlayContext.js +24 -8
- package/List/DataList/DataListModalOverlay/DataListModalOverlayContext.js.map +1 -1
- package/List/DataList/DataListModalOverlay/index.js +35 -3
- package/List/DataList/DataListModalOverlay/index.js.map +1 -1
- package/List/DataList/Loader.js +25 -13
- package/List/DataList/Loader.js.map +1 -1
- package/List/DataList/NoData.js +19 -6
- package/List/DataList/NoData.js.map +1 -1
- package/List/DataList/icons/index.js +83 -38
- package/List/DataList/icons/index.js.map +1 -1
- package/List/DataList/index.js +48 -3
- package/List/DataList/index.js.map +1 -1
- package/List/DataList/types.js +5 -1
- package/List/DataList/types.js.map +1 -1
- package/List/List.js +92 -49
- package/List/List.js.map +1 -1
- package/List/List.stories.js +52 -37
- package/List/List.stories.js.map +1 -1
- package/List/icons/index.js +23 -3
- package/List/icons/index.js.map +1 -1
- package/List/index.js +60 -3
- package/List/index.js.map +1 -1
- package/Menu/Menu.js +58 -46
- package/Menu/Menu.js.map +1 -1
- package/Menu/Menu.stories.js +24 -14
- package/Menu/Menu.stories.js.map +1 -1
- package/Menu/index.js +18 -1
- package/Menu/index.js.map +1 -1
- package/Mosaic/Mosaic.js +16 -7
- package/Mosaic/Mosaic.js.map +1 -1
- package/Mosaic/Mosaic.stories.js +37 -28
- package/Mosaic/Mosaic.stories.js.map +1 -1
- package/Mosaic/index.js +18 -1
- package/Mosaic/index.js.map +1 -1
- package/Progress/CircularProgress.js +25 -11
- package/Progress/CircularProgress.js.map +1 -1
- package/Progress/index.js +15 -1
- package/Progress/index.js.map +1 -1
- package/Radio/Radio.js +37 -22
- package/Radio/Radio.js.map +1 -1
- package/Radio/Radio.styles.js +11 -4
- package/Radio/Radio.styles.js.map +1 -1
- package/Radio/RadioGroup.js +33 -19
- package/Radio/RadioGroup.js.map +1 -1
- package/Radio/RadioGroup.stories.js +29 -18
- package/Radio/RadioGroup.stories.js.map +1 -1
- package/Radio/index.js +23 -2
- package/Radio/index.js.map +1 -1
- package/RichTextEditor/RichTextEditor.js +56 -32
- package/RichTextEditor/RichTextEditor.js.map +1 -1
- package/RichTextEditor/RichTextEditor.stories.js +21 -10
- package/RichTextEditor/RichTextEditor.stories.js.map +1 -1
- package/RichTextEditor/createPropsFromConfig.js +15 -4
- package/RichTextEditor/createPropsFromConfig.js.map +1 -1
- package/RichTextEditor/index.js +30 -2
- package/RichTextEditor/index.js.map +1 -1
- package/Ripple/Ripple.js +16 -5
- package/Ripple/Ripple.js.map +1 -1
- package/Ripple/Ripple.stories.js +57 -42
- package/Ripple/Ripple.stories.js.map +1 -1
- package/Ripple/index.js +18 -1
- package/Ripple/index.js.map +1 -1
- package/Scrollbar/Scrollbar.js +14 -4
- package/Scrollbar/Scrollbar.js.map +1 -1
- package/Scrollbar/Scrollbar.stories.js +18 -9
- package/Scrollbar/Scrollbar.stories.js.map +1 -1
- package/Scrollbar/index.js +18 -1
- package/Scrollbar/index.js.map +1 -1
- package/Section/Section.stories.js +22 -12
- package/Section/Section.stories.js.map +1 -1
- package/Section/index.js +30 -15
- package/Section/index.js.map +1 -1
- package/Select/Select.js +37 -18
- package/Select/Select.js.map +1 -1
- package/Select/Select.stories.js +36 -25
- package/Select/Select.stories.js.map +1 -1
- package/Select/index.js +18 -1
- package/Select/index.js.map +1 -1
- package/Slider/Slider.js +43 -27
- package/Slider/Slider.js.map +1 -1
- package/Slider/Slider.stories.js +27 -16
- package/Slider/Slider.stories.js.map +1 -1
- package/Slider/index.js +15 -1
- package/Slider/index.js.map +1 -1
- package/Snackbar/Snackbar.js +38 -20
- package/Snackbar/Snackbar.js.map +1 -1
- package/Snackbar/Snackbar.stories.js +44 -30
- package/Snackbar/Snackbar.stories.js.map +1 -1
- package/Snackbar/index.js +19 -1
- package/Snackbar/index.js.map +1 -1
- package/Switch/Switch.js +43 -27
- package/Switch/Switch.js.map +1 -1
- package/Switch/Switch.stories.js +27 -16
- package/Switch/Switch.stories.js.map +1 -1
- package/Switch/index.js +18 -1
- package/Switch/index.js.map +1 -1
- package/Tabs/Tab.js +21 -7
- package/Tabs/Tab.js.map +1 -1
- package/Tabs/Tabs.js +49 -28
- package/Tabs/Tabs.js.map +1 -1
- package/Tabs/Tabs.stories.js +34 -22
- package/Tabs/Tabs.stories.js.map +1 -1
- package/Tabs/index.js +31 -2
- package/Tabs/index.js.map +1 -1
- package/Tags/Tags.js +64 -40
- package/Tags/Tags.js.map +1 -1
- package/Tags/Tags.stories.js +27 -16
- package/Tags/Tags.stories.js.map +1 -1
- package/Tags/index.js +18 -1
- package/Tags/index.js.map +1 -1
- package/Tooltip/Tooltip.js +38 -24
- package/Tooltip/Tooltip.js.map +1 -1
- package/Tooltip/Tooltip.stories.js +20 -11
- package/Tooltip/Tooltip.stories.js.map +1 -1
- package/Tooltip/index.js +18 -1
- package/Tooltip/index.js.map +1 -1
- package/TopAppBar/TopAppBar.js +18 -7
- package/TopAppBar/TopAppBar.js.map +1 -1
- package/TopAppBar/TopAppBar.stories.js +39 -25
- package/TopAppBar/TopAppBar.stories.js.map +1 -1
- package/TopAppBar/TopAppBarActionItem.js +14 -4
- package/TopAppBar/TopAppBarActionItem.js.map +1 -1
- package/TopAppBar/TopAppBarNavigationIcon.js +14 -4
- package/TopAppBar/TopAppBarNavigationIcon.js.map +1 -1
- package/TopAppBar/TopAppBarPrimary.js +18 -7
- package/TopAppBar/TopAppBarPrimary.js.map +1 -1
- package/TopAppBar/TopAppBarSecondary.js +18 -7
- package/TopAppBar/TopAppBarSecondary.js.map +1 -1
- package/TopAppBar/TopAppBarSection.js +18 -7
- package/TopAppBar/TopAppBarSection.js.map +1 -1
- package/TopAppBar/TopAppBarTitle.js +18 -7
- package/TopAppBar/TopAppBarTitle.js.map +1 -1
- package/TopAppBar/index.js +96 -7
- package/TopAppBar/index.js.map +1 -1
- package/TopProgressBar/TopProgressBar.js +20 -7
- package/TopProgressBar/TopProgressBar.js.map +1 -1
- package/TopProgressBar/TopProgressBar.stories.js +22 -12
- package/TopProgressBar/TopProgressBar.stories.js.map +1 -1
- package/TopProgressBar/hoc/index.js +15 -1
- package/TopProgressBar/hoc/index.js.map +1 -1
- package/TopProgressBar/hoc/withTopProgressBar.js +16 -5
- package/TopProgressBar/hoc/withTopProgressBar.js.map +1 -1
- package/TopProgressBar/index.js +18 -1
- package/TopProgressBar/index.js.map +1 -1
- package/Typography/Typography.js +14 -4
- package/Typography/Typography.js.map +1 -1
- package/Typography/Typography.stories.js +43 -34
- package/Typography/Typography.stories.js.map +1 -1
- package/Typography/index.js +18 -1
- package/Typography/index.js.map +1 -1
- package/package.json +8 -8
- package/types.js +5 -1
- package/types.js.map +1 -1
|
@@ -1,71 +1,107 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.MultiAutoComplete = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
+
|
|
14
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
15
|
+
|
|
16
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
17
|
+
|
|
18
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
19
|
+
|
|
20
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
21
|
+
|
|
22
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
23
|
+
|
|
24
|
+
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
25
|
+
|
|
26
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
27
|
+
|
|
28
|
+
var _react = _interopRequireDefault(require("react"));
|
|
29
|
+
|
|
30
|
+
var _downshift = _interopRequireDefault(require("downshift"));
|
|
31
|
+
|
|
32
|
+
var _reactSpinnerMaterial = _interopRequireDefault(require("react-spinner-material"));
|
|
33
|
+
|
|
34
|
+
var _Input = require("../Input");
|
|
35
|
+
|
|
36
|
+
var _Chips = require("../Chips");
|
|
37
|
+
|
|
38
|
+
var _utils = require("./utils");
|
|
39
|
+
|
|
40
|
+
var _List = require("../List");
|
|
41
|
+
|
|
42
|
+
var _Button = require("../Button");
|
|
43
|
+
|
|
44
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
45
|
+
|
|
46
|
+
var _Elevation = require("../Elevation");
|
|
47
|
+
|
|
48
|
+
var _Typography = require("../Typography");
|
|
49
|
+
|
|
50
|
+
var _styles = require("./styles");
|
|
51
|
+
|
|
52
|
+
var _FormElementMessage = require("../FormElementMessage");
|
|
53
|
+
|
|
54
|
+
var _baselineClose24px = require("./icons/baseline-close-24px.svg");
|
|
55
|
+
|
|
56
|
+
var _navigate_before24px = require("./icons/navigate_before-24px.svg");
|
|
57
|
+
|
|
58
|
+
var _navigate_next24px = require("./icons/navigate_next-24px.svg");
|
|
59
|
+
|
|
60
|
+
var _skip_previous24px = require("./icons/skip_previous-24px.svg");
|
|
61
|
+
|
|
62
|
+
var _skip_next24px = require("./icons/skip_next-24px.svg");
|
|
63
|
+
|
|
64
|
+
var _reorder_black_24dp = require("./icons/reorder_black_24dp.svg");
|
|
65
|
+
|
|
66
|
+
var _emotion = require("emotion");
|
|
67
|
+
|
|
10
68
|
var _excluded = ["unique", "value", "onChange", "onInput", "validation", "useMultipleSelectionList", "description"],
|
|
11
69
|
_excluded2 = ["getInputProps", "openMenu"];
|
|
12
|
-
|
|
13
|
-
import Downshift from "downshift";
|
|
14
|
-
import MaterialSpinner from "react-spinner-material";
|
|
15
|
-
import { Input } from "../Input";
|
|
16
|
-
import { Chips, Chip } from "../Chips";
|
|
17
|
-
import { getOptionValue, getOptionText, findInAliases } from "./utils";
|
|
18
|
-
import { List, ListItem, ListItemMeta } from "../List";
|
|
19
|
-
import { IconButton } from "../Button";
|
|
20
|
-
import classNames from "classnames";
|
|
21
|
-
import { Elevation } from "../Elevation";
|
|
22
|
-
import { Typography } from "../Typography";
|
|
23
|
-
import { autoCompleteStyle, suggestionList } from "./styles";
|
|
24
|
-
import { FormElementMessage } from "../FormElementMessage";
|
|
25
|
-
import { ReactComponent as BaselineCloseIcon } from "./icons/baseline-close-24px.svg";
|
|
26
|
-
import { ReactComponent as PrevIcon } from "./icons/navigate_before-24px.svg";
|
|
27
|
-
import { ReactComponent as NextIcon } from "./icons/navigate_next-24px.svg";
|
|
28
|
-
import { ReactComponent as PrevAllIcon } from "./icons/skip_previous-24px.svg";
|
|
29
|
-
import { ReactComponent as NextAllIcon } from "./icons/skip_next-24px.svg";
|
|
30
|
-
import { ReactComponent as DeleteIcon } from "./icons/baseline-close-24px.svg";
|
|
31
|
-
import { ReactComponent as ReorderIcon } from "./icons/reorder_black_24dp.svg";
|
|
32
|
-
import { css } from "emotion";
|
|
33
|
-
import { ListItemGraphic } from "../List";
|
|
34
|
-
var listItemMetaClassName = /*#__PURE__*/css({
|
|
70
|
+
var listItemMetaClassName = /*#__PURE__*/(0, _emotion.css)({
|
|
35
71
|
display: "table"
|
|
36
72
|
}, "label:listItemMetaClassName;");
|
|
37
|
-
var iconButtonClassName = /*#__PURE__*/css({
|
|
73
|
+
var iconButtonClassName = /*#__PURE__*/(0, _emotion.css)({
|
|
38
74
|
display: "table-cell !important"
|
|
39
75
|
}, "label:iconButtonClassName;");
|
|
40
76
|
var style = {
|
|
41
77
|
pagination: {
|
|
42
|
-
bar: /*#__PURE__*/css({
|
|
78
|
+
bar: /*#__PURE__*/(0, _emotion.css)({
|
|
43
79
|
display: "flex",
|
|
44
80
|
justifyContent: "space-between",
|
|
45
81
|
alignItems: "center",
|
|
46
82
|
borderBottom: "2px solid #fa5723",
|
|
47
83
|
padding: "6px 0"
|
|
48
84
|
}, "label:bar;"),
|
|
49
|
-
pages: /*#__PURE__*/css({
|
|
85
|
+
pages: /*#__PURE__*/(0, _emotion.css)({
|
|
50
86
|
display: "flex",
|
|
51
87
|
justifyContent: "space-between",
|
|
52
88
|
alignItems: "center"
|
|
53
89
|
}, "label:pages;"),
|
|
54
|
-
searchInput: /*#__PURE__*/css({
|
|
90
|
+
searchInput: /*#__PURE__*/(0, _emotion.css)({
|
|
55
91
|
height: "42px !important"
|
|
56
92
|
}, "label:searchInput;"),
|
|
57
|
-
list: /*#__PURE__*/css({
|
|
93
|
+
list: /*#__PURE__*/(0, _emotion.css)({
|
|
58
94
|
padding: "0 0 5px 0 !important",
|
|
59
95
|
".mdc-list-item": {
|
|
60
96
|
borderBottom: "1px solid var(--mdc-theme-on-background)"
|
|
61
97
|
}
|
|
62
98
|
}, "label:list;"),
|
|
63
|
-
secondaryText: /*#__PURE__*/css({
|
|
99
|
+
secondaryText: /*#__PURE__*/(0, _emotion.css)({
|
|
64
100
|
color: "var(--mdc-theme-text-secondary-on-background)"
|
|
65
101
|
}, "label:secondaryText;")
|
|
66
102
|
}
|
|
67
103
|
};
|
|
68
|
-
var listStyles = /*#__PURE__*/css({
|
|
104
|
+
var listStyles = /*#__PURE__*/(0, _emotion.css)({
|
|
69
105
|
"&.multi-autocomplete__options-list": {
|
|
70
106
|
listStyle: "none",
|
|
71
107
|
paddingLeft: 0,
|
|
@@ -76,7 +112,7 @@ var listStyles = /*#__PURE__*/css({
|
|
|
76
112
|
}, "label:listStyles;");
|
|
77
113
|
|
|
78
114
|
var Spinner = function Spinner() {
|
|
79
|
-
return /*#__PURE__*/
|
|
115
|
+
return /*#__PURE__*/_react.default.createElement(_reactSpinnerMaterial.default, {
|
|
80
116
|
size: 24,
|
|
81
117
|
spinnerColor: "#fa5723",
|
|
82
118
|
spinnerWidth: 2,
|
|
@@ -87,60 +123,54 @@ var Spinner = function Spinner() {
|
|
|
87
123
|
var OptionsList = function OptionsList(_ref) {
|
|
88
124
|
var getMenuProps = _ref.getMenuProps,
|
|
89
125
|
children = _ref.children;
|
|
90
|
-
return /*#__PURE__*/
|
|
126
|
+
return /*#__PURE__*/_react.default.createElement(_Elevation.Elevation, {
|
|
91
127
|
z: 1
|
|
92
|
-
}, /*#__PURE__*/
|
|
93
|
-
className:
|
|
128
|
+
}, /*#__PURE__*/_react.default.createElement("ul", Object.assign({
|
|
129
|
+
className: (0, _classnames.default)("multi-autocomplete__options-list", listStyles)
|
|
94
130
|
}, getMenuProps()), children));
|
|
95
131
|
};
|
|
96
132
|
|
|
97
|
-
|
|
98
|
-
|
|
133
|
+
var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
|
|
134
|
+
(0, _inherits2.default)(MultiAutoComplete, _React$Component);
|
|
99
135
|
|
|
100
|
-
var _super =
|
|
136
|
+
var _super = (0, _createSuper2.default)(MultiAutoComplete);
|
|
101
137
|
|
|
102
138
|
function MultiAutoComplete() {
|
|
103
139
|
var _this;
|
|
104
140
|
|
|
105
|
-
|
|
141
|
+
(0, _classCallCheck2.default)(this, MultiAutoComplete);
|
|
106
142
|
|
|
107
143
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
108
144
|
args[_key] = arguments[_key];
|
|
109
145
|
}
|
|
110
146
|
|
|
111
147
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
112
|
-
|
|
113
|
-
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
148
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
|
|
114
149
|
inputValue: "",
|
|
115
150
|
multipleSelectionPage: 0,
|
|
116
151
|
multipleSelectionSearch: "",
|
|
117
152
|
reorderFormVisible: "",
|
|
118
153
|
reorderFormValue: ""
|
|
119
154
|
});
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
_defineProperty(_assertThisInitialized(_this), "assignedValueAfterClearing", {
|
|
155
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "downshift", /*#__PURE__*/_react.default.createRef());
|
|
156
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "assignedValueAfterClearing", {
|
|
124
157
|
set: false,
|
|
125
158
|
selection: null
|
|
126
159
|
});
|
|
127
|
-
|
|
128
|
-
_defineProperty(_assertThisInitialized(_this), "setMultipleSelectionPage", function (multipleSelectionPage) {
|
|
160
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setMultipleSelectionPage", function (multipleSelectionPage) {
|
|
129
161
|
_this.setState({
|
|
130
162
|
multipleSelectionPage: multipleSelectionPage
|
|
131
163
|
});
|
|
132
164
|
});
|
|
133
|
-
|
|
134
|
-
_defineProperty(_assertThisInitialized(_this), "setMultipleSelectionSearch", function (multipleSelectionSearch) {
|
|
165
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setMultipleSelectionSearch", function (multipleSelectionSearch) {
|
|
135
166
|
_this.setState({
|
|
136
167
|
multipleSelectionSearch: multipleSelectionSearch
|
|
137
168
|
});
|
|
138
169
|
});
|
|
139
|
-
|
|
140
170
|
return _this;
|
|
141
171
|
}
|
|
142
172
|
|
|
143
|
-
|
|
173
|
+
(0, _createClass2.default)(MultiAutoComplete, [{
|
|
144
174
|
key: "getOptions",
|
|
145
175
|
value: function getOptions() {
|
|
146
176
|
var _this2 = this;
|
|
@@ -151,10 +181,8 @@ export var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
|
|
|
151
181
|
allowFreeInput = _this$props.allowFreeInput,
|
|
152
182
|
useSimpleValues = _this$props.useSimpleValues,
|
|
153
183
|
options = _this$props.options;
|
|
154
|
-
var values = Array.isArray(value) ?
|
|
155
|
-
|
|
156
|
-
var filtered = _toConsumableArray(options); // If free input is allowed, prepend typed value to the list.
|
|
157
|
-
|
|
184
|
+
var values = Array.isArray(value) ? (0, _toConsumableArray2.default)(value) : [];
|
|
185
|
+
var filtered = (0, _toConsumableArray2.default)(options); // If free input is allowed, prepend typed value to the list.
|
|
158
186
|
|
|
159
187
|
if (allowFreeInput && this.state.inputValue) {
|
|
160
188
|
if (useSimpleValues) {
|
|
@@ -165,11 +193,11 @@ export var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
|
|
|
165
193
|
}
|
|
166
194
|
} else {
|
|
167
195
|
var _existingValue = filtered.find(function (item) {
|
|
168
|
-
return _this2.state.inputValue === getOptionText(item, _this2.props);
|
|
196
|
+
return _this2.state.inputValue === (0, _utils.getOptionText)(item, _this2.props);
|
|
169
197
|
});
|
|
170
198
|
|
|
171
199
|
if (!_existingValue) {
|
|
172
|
-
filtered.unshift(
|
|
200
|
+
filtered.unshift((0, _defineProperty2.default)({}, this.props.textProp, this.state.inputValue));
|
|
173
201
|
}
|
|
174
202
|
}
|
|
175
203
|
}
|
|
@@ -180,7 +208,7 @@ export var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
|
|
|
180
208
|
if (unique) {
|
|
181
209
|
if (Array.isArray(values)) {
|
|
182
210
|
if (values.find(function (value) {
|
|
183
|
-
return getOptionValue(value, _this2.props) === getOptionValue(item, _this2.props);
|
|
211
|
+
return (0, _utils.getOptionValue)(value, _this2.props) === (0, _utils.getOptionValue)(item, _this2.props);
|
|
184
212
|
})) {
|
|
185
213
|
return false;
|
|
186
214
|
}
|
|
@@ -193,10 +221,10 @@ export var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
|
|
|
193
221
|
}
|
|
194
222
|
|
|
195
223
|
if (item.aliases) {
|
|
196
|
-
return findInAliases(item, _this2.state.inputValue);
|
|
224
|
+
return (0, _utils.findInAliases)(item, _this2.state.inputValue);
|
|
197
225
|
}
|
|
198
226
|
|
|
199
|
-
return getOptionText(item, _this2.props).toLowerCase().includes(_this2.state.inputValue.toLowerCase());
|
|
227
|
+
return (0, _utils.getOptionText)(item, _this2.props).toLowerCase().includes(_this2.state.inputValue.toLowerCase());
|
|
200
228
|
});
|
|
201
229
|
}
|
|
202
230
|
/**
|
|
@@ -223,41 +251,41 @@ export var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
|
|
|
223
251
|
|
|
224
252
|
|
|
225
253
|
if (!this.state.inputValue && !options.length) {
|
|
226
|
-
return /*#__PURE__*/
|
|
254
|
+
return /*#__PURE__*/_react.default.createElement(OptionsList, {
|
|
227
255
|
getMenuProps: getMenuProps
|
|
228
|
-
}, /*#__PURE__*/
|
|
256
|
+
}, /*#__PURE__*/_react.default.createElement("li", null, /*#__PURE__*/_react.default.createElement(_Typography.Typography, {
|
|
229
257
|
use: "body2"
|
|
230
258
|
}, "Start typing to find entry")));
|
|
231
259
|
}
|
|
232
260
|
|
|
233
261
|
if (!options.length) {
|
|
234
|
-
return /*#__PURE__*/
|
|
262
|
+
return /*#__PURE__*/_react.default.createElement(_Elevation.Elevation, {
|
|
235
263
|
z: 1
|
|
236
|
-
}, /*#__PURE__*/
|
|
237
|
-
className:
|
|
238
|
-
}, getMenuProps()), /*#__PURE__*/
|
|
264
|
+
}, /*#__PURE__*/_react.default.createElement("ul", Object.assign({
|
|
265
|
+
className: (0, _classnames.default)("multi-autocomplete__options-list", listStyles)
|
|
266
|
+
}, getMenuProps()), /*#__PURE__*/_react.default.createElement("li", null, /*#__PURE__*/_react.default.createElement(_Typography.Typography, {
|
|
239
267
|
use: "body2"
|
|
240
268
|
}, "No results."), this.props.noResultFound)));
|
|
241
269
|
}
|
|
242
270
|
|
|
243
271
|
var renderItem = this.props.renderItem;
|
|
244
|
-
return /*#__PURE__*/
|
|
272
|
+
return /*#__PURE__*/_react.default.createElement(_Elevation.Elevation, {
|
|
245
273
|
z: 1
|
|
246
|
-
}, /*#__PURE__*/
|
|
247
|
-
className:
|
|
274
|
+
}, /*#__PURE__*/_react.default.createElement("ul", Object.assign({
|
|
275
|
+
className: (0, _classnames.default)("multi-autocomplete__options-list", listStyles)
|
|
248
276
|
}, getMenuProps()), options.map(function (item, index) {
|
|
249
277
|
var _itemClassNames;
|
|
250
278
|
|
|
251
|
-
var itemValue = getOptionValue(item, _this3.props); // Base classes.
|
|
279
|
+
var itemValue = (0, _utils.getOptionValue)(item, _this3.props); // Base classes.
|
|
252
280
|
|
|
253
|
-
var itemClassNames = (_itemClassNames = {},
|
|
281
|
+
var itemClassNames = (_itemClassNames = {}, (0, _defineProperty2.default)(_itemClassNames, _styles.suggestionList, true), (0, _defineProperty2.default)(_itemClassNames, "highlighted", highlightedIndex === index), (0, _defineProperty2.default)(_itemClassNames, "selected", false), _itemClassNames); // Render the item.
|
|
254
282
|
|
|
255
|
-
return /*#__PURE__*/
|
|
283
|
+
return /*#__PURE__*/_react.default.createElement("li", Object.assign({
|
|
256
284
|
key: itemValue + index
|
|
257
285
|
}, getItemProps({
|
|
258
286
|
index: index,
|
|
259
287
|
item: item,
|
|
260
|
-
className:
|
|
288
|
+
className: (0, _classnames.default)(itemClassNames)
|
|
261
289
|
})), renderItem.call(_this3, item, index));
|
|
262
290
|
})));
|
|
263
291
|
}
|
|
@@ -280,7 +308,7 @@ export var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
|
|
|
280
308
|
|
|
281
309
|
if (search) {
|
|
282
310
|
data = data.filter(function (item) {
|
|
283
|
-
return getOptionText(item.option, _this4.props).toLowerCase().includes(search.toLowerCase());
|
|
311
|
+
return (0, _utils.getOptionText)(item.option, _this4.props).toLowerCase().includes(search.toLowerCase());
|
|
284
312
|
});
|
|
285
313
|
}
|
|
286
314
|
|
|
@@ -336,9 +364,9 @@ export var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
|
|
|
336
364
|
data = _this$paginateMultipl.data,
|
|
337
365
|
meta = _this$paginateMultipl.meta;
|
|
338
366
|
|
|
339
|
-
return /*#__PURE__*/
|
|
367
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
340
368
|
className: style.pagination.bar
|
|
341
|
-
}, /*#__PURE__*/
|
|
369
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Input.Input, {
|
|
342
370
|
className: style.pagination.searchInput,
|
|
343
371
|
placeholder: "Search selected...",
|
|
344
372
|
value: this.state.multipleSelectionSearch,
|
|
@@ -347,46 +375,46 @@ export var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
|
|
|
347
375
|
|
|
348
376
|
_this5.setMultipleSelectionPage(value ? 1 : 0);
|
|
349
377
|
}
|
|
350
|
-
})), /*#__PURE__*/
|
|
378
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
351
379
|
className: style.pagination.pages
|
|
352
|
-
}, /*#__PURE__*/
|
|
380
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
353
381
|
className: meta.hasData ? "" : style.pagination.secondaryText
|
|
354
|
-
}, meta.from, " - ", meta.to, " of ", meta.totalCount), /*#__PURE__*/
|
|
355
|
-
icon: /*#__PURE__*/
|
|
382
|
+
}, meta.from, " - ", meta.to, " of ", meta.totalCount), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Button.IconButton, {
|
|
383
|
+
icon: /*#__PURE__*/_react.default.createElement(_skip_previous24px.ReactComponent, null),
|
|
356
384
|
disabled: !meta.hasData || meta.page === 1,
|
|
357
385
|
onClick: function onClick() {
|
|
358
386
|
return _this5.setMultipleSelectionPage(1);
|
|
359
387
|
}
|
|
360
|
-
}), /*#__PURE__*/
|
|
361
|
-
icon: /*#__PURE__*/
|
|
388
|
+
}), /*#__PURE__*/_react.default.createElement(_Button.IconButton, {
|
|
389
|
+
icon: /*#__PURE__*/_react.default.createElement(_navigate_before24px.ReactComponent, null),
|
|
362
390
|
disabled: !meta.hasData || !meta.hasPrevious,
|
|
363
391
|
onClick: function onClick() {
|
|
364
392
|
return _this5.setMultipleSelectionPage(meta.page - 1);
|
|
365
393
|
}
|
|
366
|
-
}), /*#__PURE__*/
|
|
367
|
-
icon: /*#__PURE__*/
|
|
394
|
+
}), /*#__PURE__*/_react.default.createElement(_Button.IconButton, {
|
|
395
|
+
icon: /*#__PURE__*/_react.default.createElement(_navigate_next24px.ReactComponent, null),
|
|
368
396
|
disabled: !meta.hasData || !meta.hasNext,
|
|
369
397
|
onClick: function onClick() {
|
|
370
398
|
return _this5.setMultipleSelectionPage(meta.page + 1);
|
|
371
399
|
}
|
|
372
|
-
}), /*#__PURE__*/
|
|
373
|
-
icon: /*#__PURE__*/
|
|
400
|
+
}), /*#__PURE__*/_react.default.createElement(_Button.IconButton, {
|
|
401
|
+
icon: /*#__PURE__*/_react.default.createElement(_skip_next24px.ReactComponent, null),
|
|
374
402
|
disabled: !meta.hasData || meta.page === meta.lastPage,
|
|
375
403
|
onClick: function onClick() {
|
|
376
404
|
return _this5.setMultipleSelectionPage(meta.lastPage);
|
|
377
405
|
}
|
|
378
|
-
})))), /*#__PURE__*/
|
|
406
|
+
})))), /*#__PURE__*/_react.default.createElement(_List.List, {
|
|
379
407
|
className: style.pagination.list
|
|
380
408
|
}, meta.hasData ? data.map(function (item, index) {
|
|
381
|
-
var key = "".concat(getOptionValue(item.option, _this5.props), "-").concat(index);
|
|
409
|
+
var key = "".concat((0, _utils.getOptionValue)(item.option, _this5.props), "-").concat(index);
|
|
382
410
|
|
|
383
411
|
if (_this5.state.reorderFormVisible === key) {
|
|
384
|
-
return /*#__PURE__*/
|
|
412
|
+
return /*#__PURE__*/_react.default.createElement(_List.ListItem, {
|
|
385
413
|
key: key
|
|
386
|
-
}, /*#__PURE__*/
|
|
414
|
+
}, /*#__PURE__*/_react.default.createElement(_List.ListItemGraphic, null, /*#__PURE__*/_react.default.createElement(_Button.IconButton, {
|
|
387
415
|
disabled: true,
|
|
388
|
-
icon: /*#__PURE__*/
|
|
389
|
-
})), /*#__PURE__*/
|
|
416
|
+
icon: /*#__PURE__*/_react.default.createElement(_reorder_black_24dp.ReactComponent, null)
|
|
417
|
+
})), /*#__PURE__*/_react.default.createElement(_Input.Input, {
|
|
390
418
|
value: _this5.state.reorderFormValue,
|
|
391
419
|
onKeyDown: function onKeyDown(e) {
|
|
392
420
|
var key = e.key;
|
|
@@ -397,8 +425,7 @@ export var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
|
|
|
397
425
|
|
|
398
426
|
if (key === "Enter") {
|
|
399
427
|
// Reorder the item.
|
|
400
|
-
var newValue =
|
|
401
|
-
|
|
428
|
+
var newValue = (0, _toConsumableArray2.default)(value);
|
|
402
429
|
newValue.splice(e.target.value - 1, 0, newValue.splice(item.index, 1)[0]);
|
|
403
430
|
|
|
404
431
|
if (onChange) {
|
|
@@ -420,43 +447,43 @@ export var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
|
|
|
420
447
|
autoFocus: true,
|
|
421
448
|
className: style.pagination.searchInput,
|
|
422
449
|
placeholder: "Type a new order number and press Enter, or press Esc to cancel."
|
|
423
|
-
}), /*#__PURE__*/
|
|
424
|
-
icon: /*#__PURE__*/
|
|
450
|
+
}), /*#__PURE__*/_react.default.createElement(_List.ListItemMeta, null, /*#__PURE__*/_react.default.createElement(_Button.IconButton, {
|
|
451
|
+
icon: /*#__PURE__*/_react.default.createElement(_baselineClose24px.ReactComponent, null),
|
|
425
452
|
disabled: true
|
|
426
453
|
})));
|
|
427
454
|
}
|
|
428
455
|
|
|
429
|
-
return /*#__PURE__*/
|
|
456
|
+
return /*#__PURE__*/_react.default.createElement(_List.ListItem, {
|
|
430
457
|
key: key
|
|
431
|
-
}, /*#__PURE__*/
|
|
432
|
-
icon: /*#__PURE__*/
|
|
458
|
+
}, /*#__PURE__*/_react.default.createElement(_List.ListItemGraphic, null, /*#__PURE__*/_react.default.createElement(_Button.IconButton, {
|
|
459
|
+
icon: /*#__PURE__*/_react.default.createElement(_reorder_black_24dp.ReactComponent, null),
|
|
433
460
|
onClick: function onClick() {
|
|
434
461
|
_this5.setState({
|
|
435
462
|
reorderFormVisible: key
|
|
436
463
|
});
|
|
437
464
|
}
|
|
438
|
-
})), /*#__PURE__*/
|
|
465
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
439
466
|
style: {
|
|
440
467
|
color: "var(--mdc-theme-text-secondary-on-background)",
|
|
441
468
|
marginRight: 8,
|
|
442
469
|
minWidth: 32
|
|
443
470
|
}
|
|
444
|
-
}, item.index + 1, "."), " ", renderListItemLabel && renderListItemLabel.call(_this5, item.option), /*#__PURE__*/
|
|
471
|
+
}, item.index + 1, "."), " ", renderListItemLabel && renderListItemLabel.call(_this5, item.option), /*#__PURE__*/_react.default.createElement(_List.ListItemMeta, {
|
|
445
472
|
className: listItemMetaClassName
|
|
446
|
-
}, renderListItemOptions && renderListItemOptions.call(_this5, item.option), /*#__PURE__*/
|
|
447
|
-
icon: /*#__PURE__*/
|
|
473
|
+
}, renderListItemOptions && renderListItemOptions.call(_this5, item.option), /*#__PURE__*/_react.default.createElement(_Button.IconButton, {
|
|
474
|
+
icon: /*#__PURE__*/_react.default.createElement(_baselineClose24px.ReactComponent, null),
|
|
448
475
|
className: iconButtonClassName,
|
|
449
476
|
onClick: function onClick() {
|
|
450
477
|
if (!onChange) {
|
|
451
478
|
return;
|
|
452
479
|
}
|
|
453
480
|
|
|
454
|
-
onChange([].concat(
|
|
481
|
+
onChange([].concat((0, _toConsumableArray2.default)(value.slice(0, item.index)), (0, _toConsumableArray2.default)(value.slice(item.index + 1))));
|
|
455
482
|
}
|
|
456
483
|
})));
|
|
457
|
-
}) : /*#__PURE__*/
|
|
484
|
+
}) : /*#__PURE__*/_react.default.createElement(_List.ListItem, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
458
485
|
className: style.pagination.secondaryText
|
|
459
|
-
}, "Nothing to show."))), /*#__PURE__*/
|
|
486
|
+
}, "Nothing to show."))), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_FormElementMessage.FormElementMessage, null, description)));
|
|
460
487
|
}
|
|
461
488
|
|
|
462
489
|
var hasItems = Array.isArray(value) && value.length;
|
|
@@ -465,19 +492,19 @@ export var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
|
|
|
465
492
|
return null;
|
|
466
493
|
}
|
|
467
494
|
|
|
468
|
-
return /*#__PURE__*/
|
|
495
|
+
return /*#__PURE__*/_react.default.createElement(_Chips.Chips, {
|
|
469
496
|
disabled: disabled
|
|
470
497
|
}, value.map(function (item, index) {
|
|
471
|
-
return /*#__PURE__*/
|
|
472
|
-
label: getOptionText(item, _this5.props),
|
|
473
|
-
key: "".concat(getOptionValue(item, _this5.props), "-").concat(index),
|
|
474
|
-
trailingIcon: /*#__PURE__*/
|
|
498
|
+
return /*#__PURE__*/_react.default.createElement(_Chips.Chip, {
|
|
499
|
+
label: (0, _utils.getOptionText)(item, _this5.props),
|
|
500
|
+
key: "".concat((0, _utils.getOptionValue)(item, _this5.props), "-").concat(index),
|
|
501
|
+
trailingIcon: /*#__PURE__*/_react.default.createElement(_baselineClose24px.ReactComponent, null),
|
|
475
502
|
onRemove: function onRemove() {
|
|
476
503
|
if (!onChange) {
|
|
477
504
|
return;
|
|
478
505
|
}
|
|
479
506
|
|
|
480
|
-
onChange([].concat(
|
|
507
|
+
onChange([].concat((0, _toConsumableArray2.default)(value.slice(0, index)), (0, _toConsumableArray2.default)(value.slice(index + 1))));
|
|
481
508
|
}
|
|
482
509
|
});
|
|
483
510
|
}));
|
|
@@ -500,17 +527,16 @@ export var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
|
|
|
500
527
|
} : _this$props3$validati,
|
|
501
528
|
useMultipleSelectionList = _this$props3.useMultipleSelectionList,
|
|
502
529
|
description = _this$props3.description,
|
|
503
|
-
otherInputProps =
|
|
504
|
-
|
|
530
|
+
otherInputProps = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
|
|
505
531
|
var options = this.getOptions();
|
|
506
|
-
return /*#__PURE__*/
|
|
507
|
-
className:
|
|
508
|
-
}, /*#__PURE__*/
|
|
532
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
533
|
+
className: (0, _classnames.default)(_styles.autoCompleteStyle, props.className)
|
|
534
|
+
}, /*#__PURE__*/_react.default.createElement(_downshift.default, {
|
|
509
535
|
defaultSelectedItem: null // @ts-ignore there is no className on Downshift
|
|
510
536
|
,
|
|
511
|
-
className: autoCompleteStyle,
|
|
537
|
+
className: _styles.autoCompleteStyle,
|
|
512
538
|
itemToString: function itemToString(item) {
|
|
513
|
-
return item && getOptionText(item, props);
|
|
539
|
+
return item && (0, _utils.getOptionText)(item, props);
|
|
514
540
|
},
|
|
515
541
|
ref: this.downshift,
|
|
516
542
|
onChange: function onChange(selection) {
|
|
@@ -535,7 +561,7 @@ export var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
|
|
|
535
561
|
_this6.assignedValueAfterClearing.set = false;
|
|
536
562
|
|
|
537
563
|
if (Array.isArray(value)) {
|
|
538
|
-
_onChange && _onChange([].concat(
|
|
564
|
+
_onChange && _onChange([].concat((0, _toConsumableArray2.default)(value), [_this6.assignedValueAfterClearing.selection]));
|
|
539
565
|
} else {
|
|
540
566
|
_onChange && _onChange([_this6.assignedValueAfterClearing.selection]);
|
|
541
567
|
}
|
|
@@ -544,15 +570,14 @@ export var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
|
|
|
544
570
|
}, function (_ref2) {
|
|
545
571
|
var getInputProps = _ref2.getInputProps,
|
|
546
572
|
openMenu = _ref2.openMenu,
|
|
547
|
-
rest =
|
|
548
|
-
|
|
549
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Input, getInputProps(_objectSpread(_objectSpread({}, otherInputProps), {}, {
|
|
573
|
+
rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
|
|
574
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Input.Input, getInputProps((0, _objectSpread2.default)((0, _objectSpread2.default)({}, otherInputProps), {}, {
|
|
550
575
|
// @ts-ignore
|
|
551
576
|
validation: validation,
|
|
552
577
|
// Only pass description if not using "useMultipleSelectionList".
|
|
553
578
|
description: useMultipleSelectionList ? null : description,
|
|
554
579
|
rawOnChange: true,
|
|
555
|
-
trailingIcon: _this6.props.loading && /*#__PURE__*/
|
|
580
|
+
trailingIcon: _this6.props.loading && /*#__PURE__*/_react.default.createElement(Spinner, null),
|
|
556
581
|
onChange: function onChange(e) {
|
|
557
582
|
return e;
|
|
558
583
|
},
|
|
@@ -574,18 +599,18 @@ export var MultiAutoComplete = /*#__PURE__*/function (_React$Component) {
|
|
|
574
599
|
openMenu();
|
|
575
600
|
otherInputProps.onFocus && otherInputProps.onFocus(e);
|
|
576
601
|
}
|
|
577
|
-
}))), _this6.renderOptions(
|
|
602
|
+
}))), _this6.renderOptions((0, _objectSpread2.default)((0, _objectSpread2.default)({}, rest), {}, {
|
|
578
603
|
unique: unique,
|
|
579
604
|
options: options
|
|
580
605
|
})), _this6.renderMultipleSelection());
|
|
581
606
|
}));
|
|
582
607
|
}
|
|
583
608
|
}]);
|
|
584
|
-
|
|
585
609
|
return MultiAutoComplete;
|
|
586
|
-
}(
|
|
610
|
+
}(_react.default.Component);
|
|
587
611
|
|
|
588
|
-
|
|
612
|
+
exports.MultiAutoComplete = MultiAutoComplete;
|
|
613
|
+
(0, _defineProperty2.default)(MultiAutoComplete, "defaultProps", {
|
|
589
614
|
valueProp: "id",
|
|
590
615
|
textProp: "name",
|
|
591
616
|
unique: true,
|
|
@@ -597,15 +622,15 @@ _defineProperty(MultiAutoComplete, "defaultProps", {
|
|
|
597
622
|
* We cast this as MultiAutoComplete because renderItem() is executed via .call() where this is MultiAutoComplete instance.
|
|
598
623
|
*/
|
|
599
624
|
renderItem: function renderItem(item) {
|
|
600
|
-
return /*#__PURE__*/
|
|
625
|
+
return /*#__PURE__*/_react.default.createElement(_Typography.Typography, {
|
|
601
626
|
use: "body2"
|
|
602
|
-
}, getOptionText(item, this.props));
|
|
627
|
+
}, (0, _utils.getOptionText)(item, this.props));
|
|
603
628
|
},
|
|
604
629
|
|
|
605
630
|
/**
|
|
606
631
|
* We cast this as MultiAutoComplete because renderListItemLabel() is executed via .call() where this is MultiAutoComplete instance.
|
|
607
632
|
*/
|
|
608
633
|
renderListItemLabel: function renderListItemLabel(item) {
|
|
609
|
-
return getOptionText(item, this.props);
|
|
634
|
+
return (0, _utils.getOptionText)(item, this.props);
|
|
610
635
|
}
|
|
611
636
|
});
|