@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
package/backlog/Form/Form.js
DELETED
|
@@ -1,193 +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 _react = _interopRequireWildcard(require("react"));
|
|
33
|
-
|
|
34
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
35
|
-
|
|
36
|
-
var _formSerialize = _interopRequireDefault(require("form-serialize"));
|
|
37
|
-
|
|
38
|
-
var _animation = _interopRequireDefault(require("@spothero/utils/animation"));
|
|
39
|
-
|
|
40
|
-
var _dom = _interopRequireDefault(require("@spothero/utils/dom"));
|
|
41
|
-
|
|
42
|
-
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); }
|
|
43
|
-
|
|
44
|
-
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; }
|
|
45
|
-
|
|
46
|
-
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); }; }
|
|
47
|
-
|
|
48
|
-
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; } }
|
|
49
|
-
|
|
50
|
-
var Form = /*#__PURE__*/function (_Component) {
|
|
51
|
-
(0, _inherits2.default)(Form, _Component);
|
|
52
|
-
|
|
53
|
-
var _super = _createSuper(Form);
|
|
54
|
-
|
|
55
|
-
function Form(props) {
|
|
56
|
-
var _this;
|
|
57
|
-
|
|
58
|
-
(0, _classCallCheck2.default)(this, Form);
|
|
59
|
-
_this = _super.call(this, props);
|
|
60
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_onSubmit", function (evt) {
|
|
61
|
-
evt.preventDefault();
|
|
62
|
-
var onSubmit = _this.props.onSubmit;
|
|
63
|
-
var form = evt.currentTarget; // for browsers that don't run validation checks on submit
|
|
64
|
-
|
|
65
|
-
if (form.checkValidity && !form.checkValidity()) {
|
|
66
|
-
return;
|
|
67
|
-
} else {
|
|
68
|
-
if (onSubmit) {
|
|
69
|
-
onSubmit(evt);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
if (!props.id) {
|
|
75
|
-
throw new Error("The prop 'id' is required to make Form accessible for users using assistive technologies such as screen readers. Check the render method of Form.");
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return _this;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
(0, _createClass2.default)(Form, [{
|
|
82
|
-
key: "animateToInvalid",
|
|
83
|
-
value:
|
|
84
|
-
/**
|
|
85
|
-
* Animates the Form component to the first invalid field.
|
|
86
|
-
*
|
|
87
|
-
* @public
|
|
88
|
-
* @returns {void}
|
|
89
|
-
*/
|
|
90
|
-
function animateToInvalid() {
|
|
91
|
-
if (this._form.checkValidity && !this._form.checkValidity()) {
|
|
92
|
-
var _this$props = this.props,
|
|
93
|
-
id = _this$props.id,
|
|
94
|
-
invalidElementToScroll = _this$props.invalidElementToScroll,
|
|
95
|
-
invalidElementScrollOffset = _this$props.invalidElementScrollOffset; // setTimeout to ensure elements are rendered
|
|
96
|
-
|
|
97
|
-
setTimeout(function () {
|
|
98
|
-
var errorField = _dom.default.el("#Form-".concat(id, " .FormElement-contains-error"));
|
|
99
|
-
|
|
100
|
-
var firstInvalid = errorField.length > 0 ? errorField[0] : errorField;
|
|
101
|
-
var yPos = firstInvalid.offsetTop + invalidElementScrollOffset;
|
|
102
|
-
var elToScroll = invalidElementToScroll || document.scrollingElement;
|
|
103
|
-
|
|
104
|
-
_animation.default.scrollTo(elToScroll, yPos);
|
|
105
|
-
}, 0);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Checks if the form is valid and ready for submission.
|
|
110
|
-
*
|
|
111
|
-
* @public
|
|
112
|
-
* @returns {Boolean} - Whether the form is valid or not.
|
|
113
|
-
*/
|
|
114
|
-
|
|
115
|
-
}, {
|
|
116
|
-
key: "isValid",
|
|
117
|
-
value: function isValid() {
|
|
118
|
-
return this._form.checkValidity ? this._form.checkValidity() : true;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Resets user input from the form fields.
|
|
122
|
-
*
|
|
123
|
-
* @public
|
|
124
|
-
* @returns {void}
|
|
125
|
-
*/
|
|
126
|
-
|
|
127
|
-
}, {
|
|
128
|
-
key: "reset",
|
|
129
|
-
value: function reset() {
|
|
130
|
-
this._form.reset();
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Provides the form data as an object for submission.
|
|
134
|
-
*
|
|
135
|
-
* @public
|
|
136
|
-
* @param {Boolean} [withEmpty=false] - Whether to serialize the empty fields.
|
|
137
|
-
* @returns {Object} - The form data to submit.
|
|
138
|
-
*/
|
|
139
|
-
|
|
140
|
-
}, {
|
|
141
|
-
key: "submit",
|
|
142
|
-
value: function submit() {
|
|
143
|
-
var withEmpty = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
144
|
-
|
|
145
|
-
if (!this.isValid()) {
|
|
146
|
-
return null;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
return (0, _formSerialize.default)(this._form, {
|
|
150
|
-
hash: true,
|
|
151
|
-
empty: withEmpty
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Getter for the form DOM element.
|
|
156
|
-
*
|
|
157
|
-
* @public
|
|
158
|
-
* @returns {Element} - The form element.
|
|
159
|
-
*/
|
|
160
|
-
|
|
161
|
-
}, {
|
|
162
|
-
key: "node",
|
|
163
|
-
get: function get() {
|
|
164
|
-
return this._form;
|
|
165
|
-
}
|
|
166
|
-
}, {
|
|
167
|
-
key: "render",
|
|
168
|
-
value: function render() {
|
|
169
|
-
var _this2 = this;
|
|
170
|
-
|
|
171
|
-
var _this$props2 = this.props,
|
|
172
|
-
className = _this$props2.className,
|
|
173
|
-
id = _this$props2.id,
|
|
174
|
-
children = _this$props2.children;
|
|
175
|
-
var classes = (0, _classnames.default)('Form', className);
|
|
176
|
-
return /*#__PURE__*/_react.default.createElement("form", {
|
|
177
|
-
ref: function ref(node) {
|
|
178
|
-
_this2._form = node;
|
|
179
|
-
},
|
|
180
|
-
className: classes,
|
|
181
|
-
id: "Form-".concat(id),
|
|
182
|
-
onSubmit: this._onSubmit,
|
|
183
|
-
action: ""
|
|
184
|
-
}, children);
|
|
185
|
-
}
|
|
186
|
-
}]);
|
|
187
|
-
return Form;
|
|
188
|
-
}(_react.Component);
|
|
189
|
-
|
|
190
|
-
exports.default = Form;
|
|
191
|
-
(0, _defineProperty2.default)(Form, "defaultProps", {
|
|
192
|
-
invalidElementScrollOffset: 0
|
|
193
|
-
});
|
|
@@ -1,24 +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 _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
|
-
var FormElementError = function FormElementError(_ref) {
|
|
15
|
-
var className = _ref.className,
|
|
16
|
-
children = _ref.children;
|
|
17
|
-
var classes = (0, _classnames.default)('FormElementError', className);
|
|
18
|
-
return /*#__PURE__*/_react.default.createElement("label", {
|
|
19
|
-
className: classes
|
|
20
|
-
}, children);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
var _default = FormElementError;
|
|
24
|
-
exports.default = _default;
|
|
@@ -1,30 +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 _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
|
-
var FormGroup = function FormGroup(_ref) {
|
|
15
|
-
var className = _ref.className,
|
|
16
|
-
children = _ref.children,
|
|
17
|
-
inline = _ref.inline,
|
|
18
|
-
error = _ref.error;
|
|
19
|
-
var classes = (0, _classnames.default)('FormGroup', {
|
|
20
|
-
'FormGroup-inline': inline
|
|
21
|
-
}, {
|
|
22
|
-
'FormGroup-contains-error': error
|
|
23
|
-
}, className);
|
|
24
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
25
|
-
className: classes
|
|
26
|
-
}, children, error);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
var _default = FormGroup;
|
|
30
|
-
exports.default = _default;
|
|
@@ -1,28 +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 _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
|
-
var _exclamationCircle = _interopRequireDefault(require("@spothero/icons/exclamation-circle"));
|
|
15
|
-
|
|
16
|
-
var FormGroupError = function FormGroupError(_ref) {
|
|
17
|
-
var className = _ref.className,
|
|
18
|
-
children = _ref.children;
|
|
19
|
-
var classes = (0, _classnames.default)('FormGroupError', className);
|
|
20
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
21
|
-
className: classes
|
|
22
|
-
}, /*#__PURE__*/_react.default.createElement(_exclamationCircle.default, null), /*#__PURE__*/_react.default.createElement("div", {
|
|
23
|
-
className: "FormGroupError-content"
|
|
24
|
-
}, children));
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
var _default = FormGroupError;
|
|
28
|
-
exports.default = _default;
|
package/backlog/Form/index.js
DELETED
|
@@ -1,39 +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, "Form", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function get() {
|
|
11
|
-
return _Form.default;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
Object.defineProperty(exports, "FormElementError", {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function get() {
|
|
17
|
-
return _FormElementError.default;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
Object.defineProperty(exports, "FormGroup", {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
get: function get() {
|
|
23
|
-
return _FormGroup.default;
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
Object.defineProperty(exports, "FormGroupError", {
|
|
27
|
-
enumerable: true,
|
|
28
|
-
get: function get() {
|
|
29
|
-
return _FormGroupError.default;
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
var _Form = _interopRequireDefault(require("./Form"));
|
|
34
|
-
|
|
35
|
-
var _FormGroup = _interopRequireDefault(require("./FormGroup"));
|
|
36
|
-
|
|
37
|
-
var _FormGroupError = _interopRequireDefault(require("./FormGroupError"));
|
|
38
|
-
|
|
39
|
-
var _FormElementError = _interopRequireDefault(require("./FormElementError"));
|
|
@@ -1,253 +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 _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
|
8
|
-
|
|
9
|
-
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
|
|
10
|
-
|
|
11
|
-
var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
|
|
12
|
-
|
|
13
|
-
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
14
|
-
|
|
15
|
-
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
|
|
16
|
-
|
|
17
|
-
var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
|
|
18
|
-
|
|
19
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
20
|
-
|
|
21
|
-
Object.defineProperty(exports, "__esModule", {
|
|
22
|
-
value: true
|
|
23
|
-
});
|
|
24
|
-
exports.default = void 0;
|
|
25
|
-
|
|
26
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
27
|
-
|
|
28
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
|
|
29
|
-
|
|
30
|
-
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
31
|
-
|
|
32
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
33
|
-
|
|
34
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
35
|
-
|
|
36
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/assertThisInitialized"));
|
|
37
|
-
|
|
38
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
39
|
-
|
|
40
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
41
|
-
|
|
42
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
43
|
-
|
|
44
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
45
|
-
|
|
46
|
-
var _throttle = _interopRequireDefault(require("lodash/throttle"));
|
|
47
|
-
|
|
48
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
49
|
-
|
|
50
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
51
|
-
|
|
52
|
-
var _search = _interopRequireDefault(require("@spothero/icons/search"));
|
|
53
|
-
|
|
54
|
-
var _environment = _interopRequireDefault(require("@spothero/utils/environment"));
|
|
55
|
-
|
|
56
|
-
var _AutoSuggestInput = _interopRequireDefault(require("../AutoSuggestInput/AutoSuggestInput"));
|
|
57
|
-
|
|
58
|
-
var _TextInputPropTypes = _interopRequireDefault(require("../TextInput/TextInputPropTypes"));
|
|
59
|
-
|
|
60
|
-
var _excluded = ["className", "poweredByGoogleFooter", "types", "country", "onClear"];
|
|
61
|
-
|
|
62
|
-
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); }
|
|
63
|
-
|
|
64
|
-
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; }
|
|
65
|
-
|
|
66
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
67
|
-
|
|
68
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? Object.defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
69
|
-
|
|
70
|
-
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); }; }
|
|
71
|
-
|
|
72
|
-
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; } }
|
|
73
|
-
|
|
74
|
-
var GooglePlacesSearchInput = /*#__PURE__*/function (_Component) {
|
|
75
|
-
(0, _inherits2.default)(GooglePlacesSearchInput, _Component);
|
|
76
|
-
|
|
77
|
-
var _super = _createSuper(GooglePlacesSearchInput);
|
|
78
|
-
|
|
79
|
-
function GooglePlacesSearchInput(props) {
|
|
80
|
-
var _this;
|
|
81
|
-
|
|
82
|
-
(0, _classCallCheck2.default)(this, GooglePlacesSearchInput);
|
|
83
|
-
_this = _super.call(this, props);
|
|
84
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_onChange", function (evt) {
|
|
85
|
-
var onChange = _this.props.onChange;
|
|
86
|
-
var autocompleteSessionToken = _this.state.autocompleteSessionToken;
|
|
87
|
-
var value = evt.target.value;
|
|
88
|
-
|
|
89
|
-
if (!autocompleteSessionToken) {
|
|
90
|
-
_this.setState({
|
|
91
|
-
autocompleteSessionToken: new _this._gmaps.places.AutocompleteSessionToken()
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
if (!value || value.length < 3) {
|
|
96
|
-
_this.setState({
|
|
97
|
-
suggestions: []
|
|
98
|
-
});
|
|
99
|
-
} else {
|
|
100
|
-
_this._suggestionFetch(value);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
if (onChange) {
|
|
104
|
-
onChange(evt);
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_onSuggestionSelect", function (suggestion) {
|
|
108
|
-
var onSuggestionSelect = _this.props.onSuggestionSelect;
|
|
109
|
-
var placeId = suggestion.place_id,
|
|
110
|
-
description = suggestion.description;
|
|
111
|
-
|
|
112
|
-
if (suggestion.location) {
|
|
113
|
-
onSuggestionSelect(suggestion);
|
|
114
|
-
} else {
|
|
115
|
-
_this._geocoder.geocode(placeId ? {
|
|
116
|
-
placeId: placeId
|
|
117
|
-
} : {
|
|
118
|
-
address: description
|
|
119
|
-
}, function (results, status) {
|
|
120
|
-
if (status !== _this._gmaps.GeocoderStatus.OK) {
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
var gmaps = results[0];
|
|
125
|
-
var geoCodedLocation = gmaps.geometry.location;
|
|
126
|
-
suggestion.label = description;
|
|
127
|
-
suggestion.gmaps = gmaps;
|
|
128
|
-
suggestion.location = {
|
|
129
|
-
lat: geoCodedLocation.lat(),
|
|
130
|
-
lng: geoCodedLocation.lng()
|
|
131
|
-
};
|
|
132
|
-
onSuggestionSelect(suggestion);
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
_this.setState({
|
|
137
|
-
autocompleteSessionToken: null
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_searchSuggestions", function (value) {
|
|
141
|
-
var _biasOptions$location, _biasOptions$location2, _biasOptions$location3, _biasOptions$location4;
|
|
142
|
-
|
|
143
|
-
var _this$props = _this.props,
|
|
144
|
-
country = _this$props.country,
|
|
145
|
-
types = _this$props.types,
|
|
146
|
-
bounds = _this$props.bounds,
|
|
147
|
-
biasOptions = _this$props.biasOptions;
|
|
148
|
-
var autocompleteSessionToken = _this.state.autocompleteSessionToken;
|
|
149
|
-
|
|
150
|
-
var options = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
151
|
-
input: value
|
|
152
|
-
}, bounds && {
|
|
153
|
-
bounds: bounds
|
|
154
|
-
}), country && {
|
|
155
|
-
componentRestrictions: {
|
|
156
|
-
country: country
|
|
157
|
-
}
|
|
158
|
-
}), types && {
|
|
159
|
-
types: types
|
|
160
|
-
}), biasOptions && {
|
|
161
|
-
location: new _this._gmaps.LatLng(biasOptions === null || biasOptions === void 0 ? void 0 : (_biasOptions$location = biasOptions.location) === null || _biasOptions$location === void 0 ? void 0 : _biasOptions$location.latitude, biasOptions === null || biasOptions === void 0 ? void 0 : (_biasOptions$location2 = biasOptions.location) === null || _biasOptions$location2 === void 0 ? void 0 : _biasOptions$location2.longitude),
|
|
162
|
-
radius: biasOptions === null || biasOptions === void 0 ? void 0 : biasOptions.radius,
|
|
163
|
-
origin: new _this._gmaps.LatLng(biasOptions === null || biasOptions === void 0 ? void 0 : (_biasOptions$location3 = biasOptions.location) === null || _biasOptions$location3 === void 0 ? void 0 : _biasOptions$location3.latitude, biasOptions === null || biasOptions === void 0 ? void 0 : (_biasOptions$location4 = biasOptions.location) === null || _biasOptions$location4 === void 0 ? void 0 : _biasOptions$location4.longitude)
|
|
164
|
-
}), {}, {
|
|
165
|
-
sessionToken: autocompleteSessionToken
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
_this._autocompleteService.getPlacePredictions(options, function (suggestions) {
|
|
169
|
-
if (suggestions) {
|
|
170
|
-
(0, _map.default)(suggestions).call(suggestions, function (suggestion) {
|
|
171
|
-
suggestion.label = suggestion.description;
|
|
172
|
-
|
|
173
|
-
if (!suggestion.id) {
|
|
174
|
-
suggestion.id = suggestion.place_id;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
return suggestion;
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
_this.setState({
|
|
182
|
-
suggestions: suggestions
|
|
183
|
-
});
|
|
184
|
-
});
|
|
185
|
-
});
|
|
186
|
-
var googleMaps = props.googleMaps;
|
|
187
|
-
|
|
188
|
-
var isBrowser = _environment.default.isBrowser();
|
|
189
|
-
|
|
190
|
-
_this._suggestionFetch = (0, _throttle.default)(_this._searchSuggestions, 500);
|
|
191
|
-
_this._gmaps = googleMaps;
|
|
192
|
-
_this._autocompleteService = isBrowser ? new _this._gmaps.places.AutocompleteService() : null;
|
|
193
|
-
_this._geocoder = isBrowser ? new _this._gmaps.Geocoder() : null;
|
|
194
|
-
_this.state = {
|
|
195
|
-
suggestions: [],
|
|
196
|
-
autocompleteSessionToken: isBrowser ? new _this._gmaps.places.AutocompleteSessionToken() : null
|
|
197
|
-
};
|
|
198
|
-
return _this;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
(0, _createClass2.default)(GooglePlacesSearchInput, [{
|
|
202
|
-
key: "node",
|
|
203
|
-
get:
|
|
204
|
-
/**
|
|
205
|
-
* Getter for the input DOM element.
|
|
206
|
-
*
|
|
207
|
-
* @public
|
|
208
|
-
* @returns {Element} - The input element.
|
|
209
|
-
*/
|
|
210
|
-
function get() {
|
|
211
|
-
return this._autosuggest.node;
|
|
212
|
-
}
|
|
213
|
-
}, {
|
|
214
|
-
key: "render",
|
|
215
|
-
value: function render() {
|
|
216
|
-
var _this2 = this;
|
|
217
|
-
|
|
218
|
-
var _this$props2 = this.props,
|
|
219
|
-
className = _this$props2.className,
|
|
220
|
-
poweredByGoogleFooter = _this$props2.poweredByGoogleFooter,
|
|
221
|
-
types = _this$props2.types,
|
|
222
|
-
country = _this$props2.country,
|
|
223
|
-
onClear = _this$props2.onClear,
|
|
224
|
-
textInputProps = (0, _objectWithoutProperties2.default)(_this$props2, _excluded);
|
|
225
|
-
var suggestions = this.state.suggestions;
|
|
226
|
-
var classes = (0, _classnames.default)('GooglePlacesSearchInput', className);
|
|
227
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
228
|
-
className: classes
|
|
229
|
-
}, /*#__PURE__*/_react.default.createElement(_AutoSuggestInput.default, (0, _extends2.default)({
|
|
230
|
-
ref: function ref(node) {
|
|
231
|
-
_this2._autosuggest = node;
|
|
232
|
-
}
|
|
233
|
-
}, textInputProps, {
|
|
234
|
-
onChange: this._onChange,
|
|
235
|
-
suggestions: suggestions,
|
|
236
|
-
types: types,
|
|
237
|
-
country: country,
|
|
238
|
-
suggestionBoxFooter: poweredByGoogleFooter,
|
|
239
|
-
onClear: onClear,
|
|
240
|
-
onSuggestionSelect: this._onSuggestionSelect,
|
|
241
|
-
autoActivateFirstSuggest: true
|
|
242
|
-
})));
|
|
243
|
-
}
|
|
244
|
-
}]);
|
|
245
|
-
return GooglePlacesSearchInput;
|
|
246
|
-
}(_react.Component);
|
|
247
|
-
|
|
248
|
-
exports.default = GooglePlacesSearchInput;
|
|
249
|
-
(0, _defineProperty2.default)(GooglePlacesSearchInput, "defaultProps", {
|
|
250
|
-
placeholder: 'Search Address or Venue',
|
|
251
|
-
country: 'us',
|
|
252
|
-
icon: /*#__PURE__*/_react.default.createElement(_search.default, null)
|
|
253
|
-
});
|
|
@@ -1,38 +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 _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
|
-
var _Image = _interopRequireDefault(require("../v1/components/Image/Image"));
|
|
15
|
-
|
|
16
|
-
var PoweredByGoogle = function PoweredByGoogle(_ref) {
|
|
17
|
-
var className = _ref.className,
|
|
18
|
-
cloudinaryImageId = _ref.cloudinaryImageId,
|
|
19
|
-
imageWidth = _ref.imageWidth,
|
|
20
|
-
imageHeight = _ref.imageHeight;
|
|
21
|
-
var classes = (0, _classnames.default)('PoweredByGoogle', className);
|
|
22
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
23
|
-
className: classes
|
|
24
|
-
}, /*#__PURE__*/_react.default.createElement(_Image.default, {
|
|
25
|
-
className: "PoweredByGoogleImage",
|
|
26
|
-
cloudinaryImageId: cloudinaryImageId,
|
|
27
|
-
width: imageWidth,
|
|
28
|
-
height: imageHeight
|
|
29
|
-
}));
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
PoweredByGoogle.defaultProps = {
|
|
33
|
-
cloudinaryImageId: 'front-end/powered-by-google',
|
|
34
|
-
imageWidth: 144,
|
|
35
|
-
imageHeight: 18
|
|
36
|
-
};
|
|
37
|
-
var _default = PoweredByGoogle;
|
|
38
|
-
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, "GooglePlacesSearchInput", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function get() {
|
|
11
|
-
return _GooglePlacesSearchInput.default;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
Object.defineProperty(exports, "PoweredByGoogle", {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function get() {
|
|
17
|
-
return _PoweredByGoogle.default;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
var _PoweredByGoogle = _interopRequireDefault(require("./PoweredByGoogle"));
|
|
22
|
-
|
|
23
|
-
var _GooglePlacesSearchInput = _interopRequireDefault(require("./GooglePlacesSearchInput"));
|
|
@@ -1,30 +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 _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
|
-
var HorizontalRule = function HorizontalRule(_ref) {
|
|
15
|
-
var className = _ref.className,
|
|
16
|
-
children = _ref.children,
|
|
17
|
-
lineStyle = _ref.lineStyle,
|
|
18
|
-
position = _ref.position;
|
|
19
|
-
var classes = (0, _classnames.default)('HorizontalRule', "HorizontalRule-".concat(lineStyle), "HorizontalRule-".concat(position), className);
|
|
20
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
21
|
-
className: classes
|
|
22
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, children));
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
HorizontalRule.defaultProps = {
|
|
26
|
-
lineStyle: 'solid',
|
|
27
|
-
position: 'center'
|
|
28
|
-
};
|
|
29
|
-
var _default = HorizontalRule;
|
|
30
|
-
exports.default = _default;
|