@spothero/ui 15.10.9 → 16.0.0-beta.1
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/.eslintignore +1 -1
- package/babel.config.js +1 -0
- package/dex.config.js +1 -1
- package/jest.config.json +4 -2
- package/package.json +11 -26
- package/v2/index.js +1 -1
- package/v2/index.js.map +1 -1
- package/backlog/Alert/Alert.js +0 -37
- package/backlog/AutoSuggestInput/AutoSuggestInput.js +0 -474
- package/backlog/AutoSuggestInput/AutoSuggestItem.js +0 -99
- package/backlog/AutoSuggestInput/AutoSuggestList.js +0 -126
- package/backlog/Badge/Badge.js +0 -28
- package/backlog/Chart/Chart.js +0 -211
- package/backlog/Checkbox/Checkbox.js +0 -167
- package/backlog/DateTime/DatePicker.js +0 -279
- package/backlog/DateTime/DatePickerCalendar.js +0 -199
- package/backlog/DateTime/DatePickerCalendarNavigation.js +0 -102
- package/backlog/DateTime/DatePickerCalendarWithRange.js +0 -241
- package/backlog/DateTime/DateTimePicker.js +0 -216
- package/backlog/DateTime/DateTimeRangePicker.js +0 -530
- package/backlog/DateTime/TimePicker.js +0 -180
- package/backlog/DateTime/date-time-assertions.js +0 -66
- package/backlog/DateTime/index.js +0 -55
- package/backlog/ErrorBoundary/ErrorBoundary.js +0 -125
- package/backlog/Flyout/Flyout.js +0 -198
- package/backlog/Form/Form.js +0 -193
- package/backlog/Form/FormElementError.js +0 -24
- package/backlog/Form/FormGroup.js +0 -30
- package/backlog/Form/FormGroupError.js +0 -28
- package/backlog/Form/index.js +0 -39
- package/backlog/GooglePlacesSearchInput/GooglePlacesSearchInput.js +0 -253
- package/backlog/GooglePlacesSearchInput/PoweredByGoogle.js +0 -38
- package/backlog/GooglePlacesSearchInput/index.js +0 -23
- package/backlog/HorizontalRule/HorizontalRule.js +0 -30
- package/backlog/Label/Label.js +0 -31
- package/backlog/Notification/Notification.js +0 -178
- package/backlog/Notification/NotificationContainer.js +0 -131
- package/backlog/Notification/NotificationPropTypes.js +0 -37
- package/backlog/Notification/index.js +0 -23
- package/backlog/PasswordControl/PasswordControl.js +0 -201
- package/backlog/Portal/Portal.js +0 -110
- package/backlog/PulseLoader/PulseLoader.js +0 -62
- package/backlog/Radio/Radio.js +0 -135
- package/backlog/Radio/RadioGroup.js +0 -123
- package/backlog/Radio/index.js +0 -23
- package/backlog/RenderInBody/RenderInBody.js +0 -103
- package/backlog/Select/Select.js +0 -275
- package/backlog/Select/SelectItemPropTypes.js +0 -32
- package/backlog/Select/index.js +0 -23
- package/backlog/SelectControlled/SelectControlled.js +0 -270
- package/backlog/SelectControlled/index.js +0 -15
- package/backlog/Sprite/Sprite.js +0 -24
- package/backlog/Tabs/Tab.js +0 -94
- package/backlog/Tabs/TabContent.js +0 -56
- package/backlog/Tabs/TabNavigation.js +0 -108
- package/backlog/Tabs/TabPanel.js +0 -29
- package/backlog/Tabs/Tabs.js +0 -126
- package/backlog/Tabs/index.js +0 -47
- package/backlog/TextArea/TextArea.js +0 -155
- package/backlog/TextInput/TextInput.js +0 -230
- package/backlog/TextInput/TextInputPropTypes.js +0 -114
- package/backlog/TextInput/index.js +0 -23
- package/backlog/Tooltip/Tooltip.js +0 -249
- package/backlog/index.js +0 -393
- package/backlog/v1/components/Button/Button.js +0 -64
- package/backlog/v1/components/Button/button-props.js +0 -48
- package/backlog/v1/components/Image/Image.js +0 -193
- package/backlog/v1/components/Loader/Loader.js +0 -51
- package/backlog/v1/components/Modal/Modal.js +0 -325
- package/backlog/v1/components/Modal/ModalContent.js +0 -154
- package/backlog/v1/components/Modal/ModalFooter.js +0 -89
- package/backlog/v1/components/Modal/index.js +0 -31
- package/backlog/v1/components/Panel/Panel.js +0 -209
- package/backlog/v1/components/Table/Table.js +0 -336
- package/backlog/v1/components/Table/TableCell.js +0 -28
- package/backlog/v1/components/Table/TableCellPropTypes.js +0 -22
- package/backlog/v1/components/Table/TableControls.js +0 -56
- package/backlog/v1/components/Table/TableFooter.js +0 -63
- package/backlog/v1/components/Table/TableHeading.js +0 -126
- package/backlog/v1/components/Table/TableHeadingPropTypes.js +0 -35
- package/backlog/v1/components/Table/TableSortSelector.js +0 -125
- package/backlog/v1/components/Table/TableSortType.js +0 -11
- package/backlog/v1/components/Table/index.js +0 -47
- package/backlog/v1/components/TextButton/TextButton.js +0 -74
- package/backlog/v1/components/index.js +0 -75
- package/backlog/v1/utils/deprecate.js +0 -61
- package/styles/Alert/_Alert.scss +0 -51
- package/styles/AutoSuggestInput/_AutoSuggestInput.scss +0 -116
- package/styles/Badge/_Badge.scss +0 -33
- package/styles/Chart/_Chart.scss +0 -105
- package/styles/Chart/_chartist-settings.scss +0 -131
- package/styles/Chart/_chartist.scss +0 -295
- package/styles/Checkbox/_Checkbox.scss +0 -173
- package/styles/DateTime/_DatePicker.scss +0 -61
- package/styles/DateTime/_DatePickerCalendar.scss +0 -159
- package/styles/DateTime/_DateTime.scss +0 -4
- package/styles/DateTime/_DateTimePicker.scss +0 -46
- package/styles/DateTime/_TimePicker.scss +0 -30
- package/styles/ErrorBoundary/_ErrorBoundary.scss +0 -18
- package/styles/Flyout/_Flyout.scss +0 -73
- package/styles/Form/_Form.scss +0 -53
- package/styles/GooglePlacesSearchInput/_GooglePlacesSearchInput.scss +0 -3
- package/styles/GooglePlacesSearchInput/_PoweredByGoogle.scss +0 -21
- package/styles/HorizontalRule/_HorizontalRule.scss +0 -48
- package/styles/Label/_Label.scss +0 -6
- package/styles/Notification/_Notification.scss +0 -113
- package/styles/PasswordControl/_PasswordControl.scss +0 -86
- package/styles/PulseLoader/_PulseLoader.scss +0 -60
- package/styles/Radio/_Radio.scss +0 -93
- package/styles/Select/_Select.scss +0 -94
- package/styles/Tabs/_Tabs.scss +0 -57
- package/styles/TextArea/_TextArea.scss +0 -26
- package/styles/TextInput/_TextInput.scss +0 -43
- package/styles/Tooltip/_Tooltip.scss +0 -108
- package/styles/_index.scss +0 -34
- package/styles/common/sass/_control-sizing.scss +0 -5
- package/styles/common/sass/_disable-scrolling.scss +0 -7
- package/styles/common/sass/_forms.scss +0 -72
- package/styles/index.js +0 -50
- package/styles/v1/components/Button/Button.jsx +0 -48
- package/styles/v1/components/Button/Button.spec.js +0 -76
- package/styles/v1/components/Button/_Button.scss +0 -178
- package/styles/v1/components/Button/button-props.js +0 -30
- package/styles/v1/components/Button/stories/button.js +0 -20
- package/styles/v1/components/Button/stories/index.stories.js +0 -92
- package/styles/v1/components/Button/stories/overview.js +0 -87
- package/styles/v1/components/Button/stories/types.js +0 -31
- package/styles/v1/components/Image/Image.jsx +0 -175
- package/styles/v1/components/Image/Image.spec.js +0 -113
- package/styles/v1/components/Image/_Image.scss +0 -24
- package/styles/v1/components/Image/stories/Cloudinary.stories.js +0 -39
- package/styles/v1/components/Image/stories/Display.stories.js +0 -92
- package/styles/v1/components/Loader/Loader.jsx +0 -54
- package/styles/v1/components/Loader/Loader.spec.js +0 -67
- package/styles/v1/components/Loader/_Loader.scss +0 -18
- package/styles/v1/components/Loader/stories/Display.stories.js +0 -55
- package/styles/v1/components/Modal/Modal.jsx +0 -315
- package/styles/v1/components/Modal/Modal.spec.js +0 -293
- package/styles/v1/components/Modal/ModalContent.jsx +0 -126
- package/styles/v1/components/Modal/ModalFooter.jsx +0 -53
- package/styles/v1/components/Modal/_Modal.scss +0 -262
- package/styles/v1/components/Modal/index.js +0 -3
- package/styles/v1/components/Modal/stories/Content.stories.js +0 -314
- package/styles/v1/components/Modal/stories/Display.stories.js +0 -208
- package/styles/v1/components/Modal/stories/Methods.stories.js +0 -44
- package/styles/v1/components/Modal/stories/Width.stories.js +0 -82
- package/styles/v1/components/Modal/stories/helpers/ReduxConsumer.jsx +0 -21
- package/styles/v1/components/Panel/Panel.jsx +0 -202
- package/styles/v1/components/Panel/Panel.spec.js +0 -196
- package/styles/v1/components/Panel/_Panel.scss +0 -55
- package/styles/v1/components/Panel/stories/Display.stories.js +0 -82
- package/styles/v1/components/Panel/stories/Methods.stories.js +0 -76
- package/styles/v1/components/Table/Table.jsx +0 -367
- package/styles/v1/components/Table/Table.spec.js +0 -526
- package/styles/v1/components/Table/TableCell.jsx +0 -17
- package/styles/v1/components/Table/TableCellPropTypes.js +0 -10
- package/styles/v1/components/Table/TableControls.jsx +0 -61
- package/styles/v1/components/Table/TableFooter.jsx +0 -72
- package/styles/v1/components/Table/TableHeading.jsx +0 -58
- package/styles/v1/components/Table/TableHeadingPropTypes.js +0 -20
- package/styles/v1/components/Table/TableSortSelector.jsx +0 -63
- package/styles/v1/components/Table/TableSortType.js +0 -4
- package/styles/v1/components/Table/_Table.scss +0 -263
- package/styles/v1/components/Table/index.js +0 -5
- package/styles/v1/components/Table/stories/Display.stories.js +0 -194
- package/styles/v1/components/Table/stories/Methods.stories.js +0 -141
- package/styles/v1/components/Table/stories/helpers/TableCellEmail.jsx +0 -25
- package/styles/v1/components/Table/stories/helpers/TableCustomRow.jsx +0 -35
- package/styles/v1/components/Table/stories/helpers/TableHeadingEmail.jsx +0 -20
- package/styles/v1/components/Table/stories/helpers/table-data.js +0 -26
- package/styles/v1/components/Table/stories/helpers/table-headers.js +0 -14
- package/styles/v1/components/TextButton/TextButton.jsx +0 -78
- package/styles/v1/components/TextButton/TextButton.spec.js +0 -95
- package/styles/v1/components/TextButton/_TextButton.scss +0 -114
- package/styles/v1/components/TextButton/stories/Display.stories.js +0 -46
- package/styles/v1/components/index.js +0 -7
- package/styles/v1/utils/deprecate.js +0 -45
- package/styles/v2/components/Accordion/Accordion.jsx +0 -1
- package/styles/v2/components/Accordion/Accordion.stories.js +0 -103
- package/styles/v2/components/Accordion/index.js +0 -7
- package/styles/v2/components/Accordion/styles/button.js +0 -16
- package/styles/v2/components/Accordion/styles/container.js +0 -9
- package/styles/v2/components/Accordion/styles/index.js +0 -19
- package/styles/v2/components/Accordion/styles/panel.js +0 -7
- package/styles/v2/components/Alert/Alert.jsx +0 -121
- package/styles/v2/components/Alert/Alert.stories.js +0 -50
- package/styles/v2/components/Alert/index.js +0 -1
- package/styles/v2/components/Alert/styles/index.js +0 -166
- package/styles/v2/components/AutoSuggestSelect/AutoSuggestSelect.jsx +0 -187
- package/styles/v2/components/AutoSuggestSelect/index.js +0 -1
- package/styles/v2/components/Badge/Badge.jsx +0 -1
- package/styles/v2/components/Badge/Badge.stories.js +0 -32
- package/styles/v2/components/Badge/styles/index.js +0 -29
- package/styles/v2/components/Button/Button.jsx +0 -31
- package/styles/v2/components/Button/Button.spec.js +0 -29
- package/styles/v2/components/Button/Button.styles.js +0 -156
- package/styles/v2/components/Button/button-props.js +0 -66
- package/styles/v2/components/Button/index.js +0 -2
- package/styles/v2/components/Button/stories/button.js +0 -59
- package/styles/v2/components/Button/stories/index.stories.js +0 -82
- package/styles/v2/components/Button/stories/overview.js +0 -73
- package/styles/v2/components/Card/Card.jsx +0 -16
- package/styles/v2/components/Card/Card.stories.js +0 -33
- package/styles/v2/components/Checkbox/Checkbox.jsx +0 -1
- package/styles/v2/components/Checkbox/Checkbox.stories.js +0 -41
- package/styles/v2/components/Checkbox/index.js +0 -1
- package/styles/v2/components/Checkbox/styles/index.js +0 -31
- package/styles/v2/components/Container/Container.jsx +0 -10
- package/styles/v2/components/Container/Container.stories.js +0 -52
- package/styles/v2/components/Container/Container.styles.js +0 -11
- package/styles/v2/components/Divider/Divider.jsx +0 -31
- package/styles/v2/components/Divider/Divider.stories.js +0 -41
- package/styles/v2/components/Divider/Divider.styles.js +0 -15
- package/styles/v2/components/FormControl/FormControl.jsx +0 -77
- package/styles/v2/components/Grid/Grid.jsx +0 -25
- package/styles/v2/components/Grid/Grid.stories.js +0 -128
- package/styles/v2/components/Grid/Grid.styles.js +0 -12
- package/styles/v2/components/Grid/GridItem.jsx +0 -10
- package/styles/v2/components/Grid/GridItem.styles.js +0 -8
- package/styles/v2/components/Grid/index.js +0 -2
- package/styles/v2/components/Heading/Heading.jsx +0 -23
- package/styles/v2/components/Heading/Heading.stories.js +0 -40
- package/styles/v2/components/Heading/Heading.styles.js +0 -61
- package/styles/v2/components/Icon/Icon.jsx +0 -1
- package/styles/v2/components/Icon/Icon.stories.js +0 -38
- package/styles/v2/components/Image/Image.jsx +0 -97
- package/styles/v2/components/Image/Image.spec.js +0 -100
- package/styles/v2/components/Image/Image.stories.js +0 -142
- package/styles/v2/components/Input/Input.jsx +0 -51
- package/styles/v2/components/Input/Input.stories.js +0 -60
- package/styles/v2/components/Input/index.js +0 -1
- package/styles/v2/components/Input/styles/index.js +0 -49
- package/styles/v2/components/Link/Link.jsx +0 -1
- package/styles/v2/components/Link/Link.stories.js +0 -82
- package/styles/v2/components/Link/Link.styles.js +0 -38
- package/styles/v2/components/List/List.jsx +0 -57
- package/styles/v2/components/List/List.stories.js +0 -96
- package/styles/v2/components/List/index.js +0 -2
- package/styles/v2/components/List/styles/index.js +0 -12
- package/styles/v2/components/List/styles/item.styles.js +0 -5
- package/styles/v2/components/Loader/Loader.jsx +0 -75
- package/styles/v2/components/Loader/Loader.stories.js +0 -145
- package/styles/v2/components/Modal/Modal.jsx +0 -71
- package/styles/v2/components/Modal/Modal.stories.js +0 -278
- package/styles/v2/components/Modal/index.js +0 -1
- package/styles/v2/components/Modal/styles/body.js +0 -24
- package/styles/v2/components/Modal/styles/closeButton.js +0 -17
- package/styles/v2/components/Modal/styles/dialog.js +0 -10
- package/styles/v2/components/Modal/styles/dialogContainer.js +0 -10
- package/styles/v2/components/Modal/styles/footer.js +0 -5
- package/styles/v2/components/Modal/styles/header.js +0 -7
- package/styles/v2/components/Modal/styles/index.js +0 -47
- package/styles/v2/components/Modal/styles/overlay.js +0 -4
- package/styles/v2/components/Popover/Popover.jsx +0 -28
- package/styles/v2/components/Popover/Popover.stories.js +0 -113
- package/styles/v2/components/Popover/PopoverArrow.jsx +0 -10
- package/styles/v2/components/Popover/PopoverCloseButton.jsx +0 -10
- package/styles/v2/components/Popover/PopoverContent.jsx +0 -41
- package/styles/v2/components/Popover/index.js +0 -3
- package/styles/v2/components/Popover/styles/index.js +0 -21
- package/styles/v2/components/Popover/styles/popover-arrow.js +0 -5
- package/styles/v2/components/Popover/styles/popover-body.js +0 -5
- package/styles/v2/components/Popover/styles/popover-close-button.js +0 -17
- package/styles/v2/components/Popover/styles/popover-content.js +0 -16
- package/styles/v2/components/Popover/styles/popover-header.js +0 -6
- package/styles/v2/components/Popover/styles/popper.js +0 -5
- package/styles/v2/components/Radio/Radio.jsx +0 -50
- package/styles/v2/components/Radio/Radio.stories.js +0 -155
- package/styles/v2/components/Radio/RadioGroup.jsx +0 -69
- package/styles/v2/components/Radio/index.js +0 -2
- package/styles/v2/components/Radio/styles/index.js +0 -52
- package/styles/v2/components/Select/Select.jsx +0 -62
- package/styles/v2/components/Select/Select.stories.js +0 -60
- package/styles/v2/components/Select/index.js +0 -1
- package/styles/v2/components/Select/styles/index.js +0 -29
- package/styles/v2/components/Skeleton/Skeleton.stories.jsx +0 -34
- package/styles/v2/components/Skeleton/Skeleton.styles.js +0 -3
- package/styles/v2/components/Skeleton/index.js +0 -1
- package/styles/v2/components/Spinner/Spinner.jsx +0 -40
- package/styles/v2/components/Spinner/Spinner.stories.js +0 -98
- package/styles/v2/components/Spinner/Spinner.styles.js +0 -57
- package/styles/v2/components/Switch/Switch.jsx +0 -52
- package/styles/v2/components/Switch/Switch.stories.js +0 -88
- package/styles/v2/components/Switch/index.js +0 -1
- package/styles/v2/components/Switch/styles/index.js +0 -17
- package/styles/v2/components/Table/Table.jsx +0 -1
- package/styles/v2/components/Table/Table.stories.js +0 -90
- package/styles/v2/components/Table/Table.styles.js +0 -66
- package/styles/v2/components/Table/index.js +0 -2
- package/styles/v2/components/Tabs/Tabs.jsx +0 -39
- package/styles/v2/components/Tabs/Tabs.stories.js +0 -47
- package/styles/v2/components/Tabs/combineSizeWithVariant.js +0 -29
- package/styles/v2/components/Tabs/index.js +0 -2
- package/styles/v2/components/Tabs/styles/index.js +0 -40
- package/styles/v2/components/Text/Text.jsx +0 -35
- package/styles/v2/components/Text/Text.stories.js +0 -47
- package/styles/v2/components/Text/Text.styles.js +0 -33
- package/styles/v2/components/Text/combineAsWithVariant.js +0 -106
- package/styles/v2/components/Text/options.js +0 -92
- package/styles/v2/components/ThemeProvider/ThemeProvider.jsx +0 -39
- package/styles/v2/components/ThemeProvider/ThemeProvider.stories.js +0 -85
- package/styles/v2/components/index.js +0 -70
- package/styles/v2/components/styles.js +0 -21
- package/styles/v2/theme/base/breakpoints.js +0 -16
- package/styles/v2/theme/base/colors.js +0 -136
- package/styles/v2/theme/base/index.js +0 -5
- package/styles/v2/theme/base/sizes.js +0 -48
- package/styles/v2/theme/base/typography.js +0 -24
- package/styles/v2/theme/base/zindices.js +0 -17
- package/styles/v2/theme/global.js +0 -118
- package/styles/v2/theme/index.js +0 -27
- package/styles/v2/utils/Spaces.js +0 -16
- package/v1/assets-manifest.json +0 -5
- package/v1/index.html +0 -1
- package/v1/index.js +0 -3
- package/v1/index.js.LICENSE.txt +0 -23
- package/v1/index.js.map +0 -1
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _typeof = require("@babel/runtime-corejs3/helpers/typeof");
|
|
4
|
-
|
|
5
|
-
var _Reflect$construct = require("@babel/runtime-corejs3/core-js-stable/reflect/construct");
|
|
6
|
-
|
|
7
|
-
var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
|
|
8
|
-
|
|
9
|
-
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
10
|
-
|
|
11
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
12
|
-
|
|
13
|
-
Object.defineProperty(exports, "__esModule", {
|
|
14
|
-
value: true
|
|
15
|
-
});
|
|
16
|
-
exports.default = void 0;
|
|
17
|
-
|
|
18
|
-
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
19
|
-
|
|
20
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
21
|
-
|
|
22
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
23
|
-
|
|
24
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
25
|
-
|
|
26
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
|
|
27
|
-
|
|
28
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
29
|
-
|
|
30
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
31
|
-
|
|
32
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
33
|
-
|
|
34
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
35
|
-
|
|
36
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
37
|
-
|
|
38
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
39
|
-
|
|
40
|
-
var _reactInputMask = _interopRequireDefault(require("react-input-mask"));
|
|
41
|
-
|
|
42
|
-
var _Loader = _interopRequireDefault(require("../v1/components/Loader/Loader"));
|
|
43
|
-
|
|
44
|
-
var _TextInputPropTypes = _interopRequireDefault(require("./TextInputPropTypes"));
|
|
45
|
-
|
|
46
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
47
|
-
|
|
48
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
49
|
-
|
|
50
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
51
|
-
|
|
52
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
53
|
-
|
|
54
|
-
var TextInput = /*#__PURE__*/function (_Component) {
|
|
55
|
-
(0, _inherits2.default)(TextInput, _Component);
|
|
56
|
-
|
|
57
|
-
var _super = _createSuper(TextInput);
|
|
58
|
-
|
|
59
|
-
function TextInput() {
|
|
60
|
-
var _context;
|
|
61
|
-
|
|
62
|
-
var _this;
|
|
63
|
-
|
|
64
|
-
(0, _classCallCheck2.default)(this, TextInput);
|
|
65
|
-
|
|
66
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
67
|
-
args[_key] = arguments[_key];
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
_this = _super.call.apply(_super, (0, _concat.default)(_context = [this]).call(_context, args));
|
|
71
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
|
|
72
|
-
validationState: null
|
|
73
|
-
});
|
|
74
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_onInvalid", function (evt) {
|
|
75
|
-
evt.preventDefault();
|
|
76
|
-
var onInvalid = _this.props.onInvalid;
|
|
77
|
-
var validationState = evt.currentTarget.validity;
|
|
78
|
-
|
|
79
|
-
_this.setState({
|
|
80
|
-
validationState: validationState
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
if (onInvalid) {
|
|
84
|
-
onInvalid(validationState);
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_onChange", function (evt) {
|
|
88
|
-
var onChange = _this.props.onChange;
|
|
89
|
-
|
|
90
|
-
_this.setState({
|
|
91
|
-
validationState: null
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
if (onChange) {
|
|
95
|
-
onChange(evt);
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
return _this;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
(0, _createClass2.default)(TextInput, [{
|
|
102
|
-
key: "componentDidMount",
|
|
103
|
-
value: function componentDidMount() {
|
|
104
|
-
var _this$_input, _this$_input$getInput;
|
|
105
|
-
|
|
106
|
-
(_this$_input = this._input) === null || _this$_input === void 0 ? void 0 : (_this$_input$getInput = _this$_input.getInputDOMNode()) === null || _this$_input$getInput === void 0 ? void 0 : _this$_input$getInput.addEventListener('invalid', this._onInvalid);
|
|
107
|
-
}
|
|
108
|
-
}, {
|
|
109
|
-
key: "componentDidUpdate",
|
|
110
|
-
value: function componentDidUpdate(prevProps, prevState) {
|
|
111
|
-
if (prevProps.focus !== this.props.focus) {
|
|
112
|
-
this._checkFocus();
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}, {
|
|
116
|
-
key: "componentWillUnmount",
|
|
117
|
-
value: function componentWillUnmount() {
|
|
118
|
-
var _this$_input2, _this$_input2$getInpu;
|
|
119
|
-
|
|
120
|
-
(_this$_input2 = this._input) === null || _this$_input2 === void 0 ? void 0 : (_this$_input2$getInpu = _this$_input2.getInputDOMNode()) === null || _this$_input2$getInpu === void 0 ? void 0 : _this$_input2$getInpu.removeEventListener('invalid', this._onInvalid);
|
|
121
|
-
}
|
|
122
|
-
}, {
|
|
123
|
-
key: "_checkFocus",
|
|
124
|
-
value: function _checkFocus() {
|
|
125
|
-
if (this.props.focus) {
|
|
126
|
-
var _this$_input3, _this$_input3$getInpu;
|
|
127
|
-
|
|
128
|
-
(_this$_input3 = this._input) === null || _this$_input3 === void 0 ? void 0 : (_this$_input3$getInpu = _this$_input3.getInputDOMNode()) === null || _this$_input3$getInpu === void 0 ? void 0 : _this$_input3$getInpu.focus();
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Getter for the input DOM element.
|
|
133
|
-
*
|
|
134
|
-
* @public
|
|
135
|
-
* @returns {Element} - The input element.
|
|
136
|
-
*/
|
|
137
|
-
|
|
138
|
-
}, {
|
|
139
|
-
key: "node",
|
|
140
|
-
get: function get() {
|
|
141
|
-
var _this$_input4;
|
|
142
|
-
|
|
143
|
-
return (_this$_input4 = this._input) === null || _this$_input4 === void 0 ? void 0 : _this$_input4.getInputDOMNode();
|
|
144
|
-
}
|
|
145
|
-
}, {
|
|
146
|
-
key: "render",
|
|
147
|
-
value: function render() {
|
|
148
|
-
var _this2 = this;
|
|
149
|
-
|
|
150
|
-
var _this$props = this.props,
|
|
151
|
-
className = _this$props.className,
|
|
152
|
-
name = _this$props.name,
|
|
153
|
-
type = _this$props.type,
|
|
154
|
-
label = _this$props.label,
|
|
155
|
-
placeholder = _this$props.placeholder,
|
|
156
|
-
pattern = _this$props.pattern,
|
|
157
|
-
required = _this$props.required,
|
|
158
|
-
disabled = _this$props.disabled,
|
|
159
|
-
loading = _this$props.loading,
|
|
160
|
-
autoFocus = _this$props.autoFocus,
|
|
161
|
-
error = _this$props.error,
|
|
162
|
-
defaultValue = _this$props.defaultValue,
|
|
163
|
-
icon = _this$props.icon,
|
|
164
|
-
iconPosition = _this$props.iconPosition,
|
|
165
|
-
helpNode = _this$props.helpNode,
|
|
166
|
-
inline = _this$props.inline,
|
|
167
|
-
readOnly = _this$props.readOnly,
|
|
168
|
-
maxLength = _this$props.maxLength,
|
|
169
|
-
min = _this$props.min,
|
|
170
|
-
max = _this$props.max,
|
|
171
|
-
mask = _this$props.mask,
|
|
172
|
-
maskChar = _this$props.maskChar,
|
|
173
|
-
additionalInputProps = _this$props.additionalInputProps,
|
|
174
|
-
onFocus = _this$props.onFocus,
|
|
175
|
-
onBlur = _this$props.onBlur;
|
|
176
|
-
var validationState = this.state.validationState;
|
|
177
|
-
var isValid = validationState ? validationState.valid : true;
|
|
178
|
-
var classes = (0, _classnames.default)('TextInput', 'FormElement', {
|
|
179
|
-
'FormElement-inline': inline
|
|
180
|
-
}, {
|
|
181
|
-
'FormElement-with-icon': icon
|
|
182
|
-
}, {
|
|
183
|
-
'FormElement-loading': loading
|
|
184
|
-
}, (0, _defineProperty2.default)({}, "FormElement-with-icon-".concat(iconPosition), icon), {
|
|
185
|
-
'FormElement-contains-error': !isValid
|
|
186
|
-
}, className);
|
|
187
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
188
|
-
className: classes
|
|
189
|
-
}, label, /*#__PURE__*/_react.default.createElement("div", {
|
|
190
|
-
className: "FormElement-control"
|
|
191
|
-
}, /*#__PURE__*/_react.default.createElement(_reactInputMask.default, (0, _extends2.default)({
|
|
192
|
-
ref: function ref(node) {
|
|
193
|
-
_this2._input = node;
|
|
194
|
-
},
|
|
195
|
-
className: "FormElement-item",
|
|
196
|
-
name: name,
|
|
197
|
-
type: type,
|
|
198
|
-
placeholder: placeholder,
|
|
199
|
-
disabled: disabled,
|
|
200
|
-
autoFocus: autoFocus,
|
|
201
|
-
required: required,
|
|
202
|
-
pattern: pattern,
|
|
203
|
-
maxLength: maxLength,
|
|
204
|
-
min: min,
|
|
205
|
-
max: max,
|
|
206
|
-
onChange: this._onChange,
|
|
207
|
-
onFocus: onFocus,
|
|
208
|
-
onBlur: onBlur,
|
|
209
|
-
mask: mask,
|
|
210
|
-
maskChar: maskChar,
|
|
211
|
-
alwaysShowMask: false,
|
|
212
|
-
readOnly: readOnly,
|
|
213
|
-
defaultValue: defaultValue
|
|
214
|
-
}, additionalInputProps)), icon, loading && /*#__PURE__*/_react.default.createElement(_Loader.default, {
|
|
215
|
-
size: 16,
|
|
216
|
-
borderWidth: 2
|
|
217
|
-
})), helpNode && /*#__PURE__*/_react.default.createElement("div", {
|
|
218
|
-
className: "FormElement-help-text"
|
|
219
|
-
}, helpNode), !isValid && error);
|
|
220
|
-
}
|
|
221
|
-
}]);
|
|
222
|
-
return TextInput;
|
|
223
|
-
}(_react.Component);
|
|
224
|
-
|
|
225
|
-
exports.default = TextInput;
|
|
226
|
-
(0, _defineProperty2.default)(TextInput, "defaultProps", {
|
|
227
|
-
type: 'text',
|
|
228
|
-
maskChar: null,
|
|
229
|
-
iconPosition: 'left'
|
|
230
|
-
});
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
|
-
var TextInputPropTypes = {
|
|
13
|
-
/** Additional class(es) to add to the component. */
|
|
14
|
-
className: _propTypes.default.string,
|
|
15
|
-
|
|
16
|
-
/** A unique name which is used to identify this element. If belonging to a form this is used as the key for serialization and is required. */
|
|
17
|
-
name: _propTypes.default.string,
|
|
18
|
-
|
|
19
|
-
/** What HTML input type the underlying input should be set to. */
|
|
20
|
-
type: _propTypes.default.oneOf(['text', 'password', 'date', 'email', 'time', 'tel', 'search', 'number', 'hidden']),
|
|
21
|
-
|
|
22
|
-
/** Text to display in the field before a user starts to type in the input. */
|
|
23
|
-
placeholder: _propTypes.default.string,
|
|
24
|
-
|
|
25
|
-
/** A custom label (typically a Label component) to display above the input. */
|
|
26
|
-
label: _propTypes.default.element,
|
|
27
|
-
|
|
28
|
-
/** A regular expression that the input value is checked against for validation. */
|
|
29
|
-
pattern: _propTypes.default.string,
|
|
30
|
-
|
|
31
|
-
/** Whether this field is required during validation. */
|
|
32
|
-
required: _propTypes.default.bool,
|
|
33
|
-
|
|
34
|
-
/** Disallows user interaction. */
|
|
35
|
-
disabled: _propTypes.default.bool,
|
|
36
|
-
|
|
37
|
-
/** Whether to show a loading animation inside of the component. */
|
|
38
|
-
loading: _propTypes.default.bool,
|
|
39
|
-
|
|
40
|
-
/** Whether the field should be auto focused when mounted. */
|
|
41
|
-
autoFocus: _propTypes.default.bool,
|
|
42
|
-
|
|
43
|
-
/** Whether the field should be focused when the component receives new props. */
|
|
44
|
-
focus: _propTypes.default.bool,
|
|
45
|
-
|
|
46
|
-
/** A custom validation error (typically a FormElementError component) to display when this component is part of a form and is invalid. */
|
|
47
|
-
error: _propTypes.default.element,
|
|
48
|
-
|
|
49
|
-
/** The default value to display in the input when mounted. */
|
|
50
|
-
defaultValue: _propTypes.default.string,
|
|
51
|
-
|
|
52
|
-
/** A custom icon (typically an Icon component) to show in the input field. */
|
|
53
|
-
icon: _propTypes.default.element,
|
|
54
|
-
|
|
55
|
-
/** If an icon is provided, whether it should appear on the left or right side of the input field. */
|
|
56
|
-
iconPosition: _propTypes.default.oneOf(['left', 'right']),
|
|
57
|
-
|
|
58
|
-
/** A custom help element to place below the input. */
|
|
59
|
-
helpNode: _propTypes.default.node,
|
|
60
|
-
|
|
61
|
-
/** Applies proper styling to display this field inline in a form. */
|
|
62
|
-
inline: _propTypes.default.bool,
|
|
63
|
-
|
|
64
|
-
/** Specifies that the input field is read-only. */
|
|
65
|
-
readOnly: _propTypes.default.bool,
|
|
66
|
-
|
|
67
|
-
/** Specifies the maximum number of characters allowed. */
|
|
68
|
-
maxLength: _propTypes.default.number,
|
|
69
|
-
|
|
70
|
-
/** Specifies the minimum value when type is `date` or `number`. */
|
|
71
|
-
min: _propTypes.default.number,
|
|
72
|
-
|
|
73
|
-
/** Specifies the maximum value when type is `date` or `number`. */
|
|
74
|
-
max: _propTypes.default.number,
|
|
75
|
-
|
|
76
|
-
/** A string to use as a mask. See <a href="https://github.com/sanniassin/react-input-mask#mask--string" target="_blank">react-input-mask</a>. */
|
|
77
|
-
mask: _propTypes.default.string,
|
|
78
|
-
|
|
79
|
-
/** Character to cover unfilled editable parts of mask. See <a href="https://github.com/sanniassin/react-input-mask#maskchar--string" target="_blank">react-input-mask</a>. */
|
|
80
|
-
maskChar: _propTypes.default.string,
|
|
81
|
-
|
|
82
|
-
/** Additional props to pass to the input element */
|
|
83
|
-
additionalInputProps: _propTypes.default.object,
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Function to execute when the input changes.
|
|
87
|
-
*
|
|
88
|
-
* @param {SyntheticEvent} evt - The React `SyntheticEvent`.
|
|
89
|
-
*/
|
|
90
|
-
onChange: _propTypes.default.func,
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Function to execute when the input is focused.
|
|
94
|
-
*
|
|
95
|
-
* @param {SyntheticEvent} evt - The React `SyntheticEvent`.
|
|
96
|
-
*/
|
|
97
|
-
onFocus: _propTypes.default.func,
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Function to execute when the input loses focused.
|
|
101
|
-
*
|
|
102
|
-
* @param {SyntheticEvent} evt - The React `SyntheticEvent`.
|
|
103
|
-
*/
|
|
104
|
-
onBlur: _propTypes.default.func,
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Function to execute when the element is marked as invalid by a validation check.
|
|
108
|
-
*
|
|
109
|
-
* @param {ValidityState} validationState - ValidityState object for more fine grained control over error handling in a parent component if desired.
|
|
110
|
-
*/
|
|
111
|
-
onInvalid: _propTypes.default.func
|
|
112
|
-
};
|
|
113
|
-
var _default = TextInputPropTypes;
|
|
114
|
-
exports.default = _default;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
Object.defineProperty(exports, "TextInput", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function get() {
|
|
11
|
-
return _TextInput.default;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
Object.defineProperty(exports, "TextInputPropTypes", {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function get() {
|
|
17
|
-
return _TextInputPropTypes.default;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
var _TextInput = _interopRequireDefault(require("./TextInput"));
|
|
22
|
-
|
|
23
|
-
var _TextInputPropTypes = _interopRequireDefault(require("./TextInputPropTypes"));
|
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _typeof = require("@babel/runtime-corejs3/helpers/typeof");
|
|
4
|
-
|
|
5
|
-
var _Reflect$construct = require("@babel/runtime-corejs3/core-js-stable/reflect/construct");
|
|
6
|
-
|
|
7
|
-
var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
|
|
8
|
-
|
|
9
|
-
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
10
|
-
|
|
11
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
12
|
-
|
|
13
|
-
Object.defineProperty(exports, "__esModule", {
|
|
14
|
-
value: true
|
|
15
|
-
});
|
|
16
|
-
exports.default = void 0;
|
|
17
|
-
|
|
18
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
19
|
-
|
|
20
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
21
|
-
|
|
22
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
|
|
23
|
-
|
|
24
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
25
|
-
|
|
26
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
27
|
-
|
|
28
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
29
|
-
|
|
30
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
31
|
-
|
|
32
|
-
var _bind = _interopRequireDefault(require("lodash/bind"));
|
|
33
|
-
|
|
34
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
35
|
-
|
|
36
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
37
|
-
|
|
38
|
-
var _times = _interopRequireDefault(require("@spothero/icons/times"));
|
|
39
|
-
|
|
40
|
-
var _dom = _interopRequireDefault(require("@spothero/utils/dom"));
|
|
41
|
-
|
|
42
|
-
var _Button = _interopRequireDefault(require("../v1/components/Button/Button"));
|
|
43
|
-
|
|
44
|
-
var _Portal = _interopRequireDefault(require("../Portal/Portal"));
|
|
45
|
-
|
|
46
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
47
|
-
|
|
48
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
49
|
-
|
|
50
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
51
|
-
|
|
52
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
53
|
-
|
|
54
|
-
var Tooltip = /*#__PURE__*/function (_Component) {
|
|
55
|
-
(0, _inherits2.default)(Tooltip, _Component);
|
|
56
|
-
|
|
57
|
-
var _super = _createSuper(Tooltip);
|
|
58
|
-
|
|
59
|
-
function Tooltip(props) {
|
|
60
|
-
var _this;
|
|
61
|
-
|
|
62
|
-
(0, _classCallCheck2.default)(this, Tooltip);
|
|
63
|
-
_this = _super.call(this, props);
|
|
64
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_onCloseClick", function (evt) {
|
|
65
|
-
_this.hide();
|
|
66
|
-
});
|
|
67
|
-
_this._isArrowAdjusted = false;
|
|
68
|
-
return _this;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
(0, _createClass2.default)(Tooltip, [{
|
|
72
|
-
key: "componentDidMount",
|
|
73
|
-
value: function componentDidMount() {
|
|
74
|
-
var _this$props = this.props,
|
|
75
|
-
triggerSelector = _this$props.triggerSelector,
|
|
76
|
-
updateOnMove = _this$props.updateOnMove,
|
|
77
|
-
closeOnBodyClick = _this$props.closeOnBodyClick;
|
|
78
|
-
this._trigger = _dom.default.el(triggerSelector);
|
|
79
|
-
|
|
80
|
-
this._positionTooltip();
|
|
81
|
-
|
|
82
|
-
_dom.default.addClass(this._container, 'Tooltip-showing');
|
|
83
|
-
|
|
84
|
-
if (updateOnMove) {
|
|
85
|
-
this._container.style.position = 'fixed';
|
|
86
|
-
this._scrollInterval = setInterval((0, _bind.default)(this._positionTooltip, this), 100);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
if (closeOnBodyClick) {
|
|
90
|
-
document.addEventListener('click', this._onCloseClick, {
|
|
91
|
-
capture: true
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}, {
|
|
96
|
-
key: "componentWillUnmount",
|
|
97
|
-
value: function componentWillUnmount() {
|
|
98
|
-
var _this$props2 = this.props,
|
|
99
|
-
updateOnMove = _this$props2.updateOnMove,
|
|
100
|
-
closeOnBodyClick = _this$props2.closeOnBodyClick;
|
|
101
|
-
|
|
102
|
-
if (updateOnMove) {
|
|
103
|
-
clearInterval(this._scrollInterval);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
if (closeOnBodyClick) {
|
|
107
|
-
document.removeEventListener('click', this._onCloseClick);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}, {
|
|
111
|
-
key: "_positionTooltip",
|
|
112
|
-
value: function _positionTooltip() {
|
|
113
|
-
if (!this._trigger) {
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
var _this$props3 = this.props,
|
|
118
|
-
position = _this$props3.position,
|
|
119
|
-
tipOffset = _this$props3.tipOffset,
|
|
120
|
-
updateOnMove = _this$props3.updateOnMove,
|
|
121
|
-
adjustArrow = _this$props3.adjustArrow;
|
|
122
|
-
|
|
123
|
-
var _this$_trigger$getBou = this._trigger.getBoundingClientRect(),
|
|
124
|
-
clientTop = _this$_trigger$getBou.top,
|
|
125
|
-
clientLeft = _this$_trigger$getBou.left,
|
|
126
|
-
clientRight = _this$_trigger$getBou.right,
|
|
127
|
-
clientBottom = _this$_trigger$getBou.bottom,
|
|
128
|
-
width = _this$_trigger$getBou.width,
|
|
129
|
-
height = _this$_trigger$getBou.height;
|
|
130
|
-
|
|
131
|
-
var tooltipWidth = this._container.offsetWidth;
|
|
132
|
-
var tooltipHeight = this._container.offsetHeight;
|
|
133
|
-
|
|
134
|
-
var _DOMUtils$getDocument = _dom.default.getDocumentOffset(this._trigger),
|
|
135
|
-
documentTop = _DOMUtils$getDocument.top,
|
|
136
|
-
documentLeft = _DOMUtils$getDocument.left;
|
|
137
|
-
|
|
138
|
-
var top = updateOnMove ? clientTop : documentTop;
|
|
139
|
-
var right = updateOnMove ? clientRight : documentLeft + width;
|
|
140
|
-
var bottom = updateOnMove ? clientBottom : documentTop + height;
|
|
141
|
-
var left = updateOnMove ? clientLeft : documentLeft;
|
|
142
|
-
var containerMid = position === 'top' || position === 'bottom' ? tooltipWidth / 2 : tooltipHeight / 2;
|
|
143
|
-
var bodyWidth = document.body.clientWidth;
|
|
144
|
-
var adjuster = 5;
|
|
145
|
-
var newTop = 0;
|
|
146
|
-
var newLeft = 0;
|
|
147
|
-
|
|
148
|
-
switch (position) {
|
|
149
|
-
case 'top':
|
|
150
|
-
newTop = top - tooltipHeight - tipOffset;
|
|
151
|
-
newLeft = left + width / 2 - containerMid;
|
|
152
|
-
break;
|
|
153
|
-
|
|
154
|
-
case 'right':
|
|
155
|
-
newTop = top + height / 2 - containerMid;
|
|
156
|
-
newLeft = right + tipOffset;
|
|
157
|
-
break;
|
|
158
|
-
|
|
159
|
-
case 'bottom':
|
|
160
|
-
newTop = bottom + tipOffset;
|
|
161
|
-
newLeft = left + width / 2 - containerMid;
|
|
162
|
-
break;
|
|
163
|
-
|
|
164
|
-
case 'left':
|
|
165
|
-
newTop = top + height / 2 - containerMid;
|
|
166
|
-
newLeft = left - tooltipWidth - tipOffset;
|
|
167
|
-
break;
|
|
168
|
-
} // adjust tooltip position if off the left side of the screen
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
var adjustedLeft = newLeft < 0 ? adjuster : newLeft; // adjust tooltip position if off the right side of the screen
|
|
172
|
-
|
|
173
|
-
if (tooltipWidth > bodyWidth - adjustedLeft) {
|
|
174
|
-
adjustedLeft = bodyWidth - tooltipWidth - adjuster;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
this._container.style.top = "".concat(newTop, "px");
|
|
178
|
-
this._container.style.left = "".concat(adjustedLeft, "px");
|
|
179
|
-
|
|
180
|
-
if (adjustArrow && !this._isArrowAdjusted && adjustedLeft !== newLeft && (position === 'top' || position === 'bottom')) {
|
|
181
|
-
this._arrow.style.left = "".concat(this._arrow.getBoundingClientRect().left + (newLeft - adjustedLeft), "px");
|
|
182
|
-
this._isArrowAdjusted = true;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Hides the Tooltip programmatically and fires the `onHidden` callback when done.
|
|
187
|
-
*
|
|
188
|
-
* @public
|
|
189
|
-
* @returns {void}
|
|
190
|
-
*/
|
|
191
|
-
|
|
192
|
-
}, {
|
|
193
|
-
key: "hide",
|
|
194
|
-
value: function hide() {
|
|
195
|
-
var _this2 = this;
|
|
196
|
-
|
|
197
|
-
if (_dom.default.hasClass(this._container, 'Tooltip-showing')) {
|
|
198
|
-
_dom.default.removeClass(this._container, 'Tooltip-showing');
|
|
199
|
-
|
|
200
|
-
setTimeout(function () {
|
|
201
|
-
_this2.props.onHidden();
|
|
202
|
-
}, 250);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}, {
|
|
206
|
-
key: "render",
|
|
207
|
-
value: function render() {
|
|
208
|
-
var _this3 = this;
|
|
209
|
-
|
|
210
|
-
var _this$props4 = this.props,
|
|
211
|
-
className = _this$props4.className,
|
|
212
|
-
containerClassName = _this$props4.containerClassName,
|
|
213
|
-
position = _this$props4.position,
|
|
214
|
-
showClose = _this$props4.showClose,
|
|
215
|
-
children = _this$props4.children;
|
|
216
|
-
var classes = (0, _classnames.default)('Tooltip', "Tooltip-".concat(position), {
|
|
217
|
-
'Tooltip-no-close': !showClose
|
|
218
|
-
}, className);
|
|
219
|
-
return /*#__PURE__*/_react.default.createElement(_Portal.default, {
|
|
220
|
-
className: containerClassName
|
|
221
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
222
|
-
ref: function ref(node) {
|
|
223
|
-
_this3._container = node;
|
|
224
|
-
},
|
|
225
|
-
className: classes,
|
|
226
|
-
role: "tooltip"
|
|
227
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
228
|
-
ref: function ref(node) {
|
|
229
|
-
_this3._arrow = node;
|
|
230
|
-
},
|
|
231
|
-
className: "Tooltip-arrow"
|
|
232
|
-
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
233
|
-
className: "Tooltip-content"
|
|
234
|
-
}, children, showClose && /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
235
|
-
className: "Tooltip-close",
|
|
236
|
-
onClick: this._onCloseClick
|
|
237
|
-
}, /*#__PURE__*/_react.default.createElement(_times.default, null)))));
|
|
238
|
-
}
|
|
239
|
-
}]);
|
|
240
|
-
return Tooltip;
|
|
241
|
-
}(_react.Component);
|
|
242
|
-
|
|
243
|
-
exports.default = Tooltip;
|
|
244
|
-
(0, _defineProperty2.default)(Tooltip, "defaultProps", {
|
|
245
|
-
position: 'top',
|
|
246
|
-
showClose: true,
|
|
247
|
-
tipOffset: 0,
|
|
248
|
-
adjustArrow: true
|
|
249
|
-
});
|