@shopgate/pwa-ui-shared 7.30.0-alpha.7 → 7.30.0-alpha.9
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/AccordionContainer/index.js +39 -5
- package/AccordionContainer/spec.js +25 -2
- package/ActionButton/index.js +63 -7
- package/ActionButton/spec.js +63 -2
- package/ActionButton/style.js +22 -1
- package/AddToCartButton/index.js +184 -27
- package/AddToCartButton/mock.js +18 -4
- package/AddToCartButton/spec.js +65 -2
- package/AddToCartButton/style.js +127 -11
- package/Availability/index.js +34 -2
- package/Availability/spec.js +41 -1
- package/Availability/style.js +19 -1
- package/Button/index.js +76 -5
- package/Button/spec.js +33 -1
- package/Button/style.js +130 -21
- package/ButtonLink/connector.js +11 -2
- package/ButtonLink/index.js +44 -6
- package/ButtonLink/spec.js +23 -1
- package/Card/index.js +19 -2
- package/Card/style.js +11 -1
- package/CardList/components/Item/index.js +26 -2
- package/CardList/components/Item/style.js +7 -1
- package/CardList/index.js +34 -3
- package/CartTotalLine/components/Amount/index.js +28 -2
- package/CartTotalLine/components/Amount/style.js +8 -1
- package/CartTotalLine/components/Hint/index.js +23 -2
- package/CartTotalLine/components/Hint/style.js +12 -1
- package/CartTotalLine/components/Label/index.js +36 -2
- package/CartTotalLine/components/Label/style.js +17 -1
- package/CartTotalLine/components/Spacer/index.js +16 -2
- package/CartTotalLine/index.js +39 -2
- package/CartTotalLine/style.js +31 -1
- package/Checkbox/index.js +31 -2
- package/Checkbox/style.js +18 -1
- package/Chip/index.js +61 -2
- package/Chip/spec.js +24 -1
- package/Chip/style.js +71 -3
- package/ContextMenu/ContextMenu.hooks.js +6 -2
- package/ContextMenu/ContextMenuProvider.context.js +9 -3
- package/ContextMenu/ContextMenuProvider.js +21 -2
- package/ContextMenu/components/Item/index.js +67 -5
- package/ContextMenu/components/Item/style.js +32 -3
- package/ContextMenu/components/Position/index.js +61 -10
- package/ContextMenu/components/Position/style.js +11 -1
- package/ContextMenu/index.js +124 -3
- package/ContextMenu/spec.js +101 -2
- package/ContextMenu/style.js +45 -1
- package/Dialog/components/BasicDialog/index.js +5 -1
- package/Dialog/components/HtmlContentDialog/index.js +22 -2
- package/Dialog/components/HtmlContentDialog/spec.js +59 -1
- package/Dialog/components/PipelineErrorDialog/index.js +114 -25
- package/Dialog/components/PipelineErrorDialog/spec.js +92 -12
- package/Dialog/components/TextMessageDialog/index.js +28 -2
- package/Dialog/components/TextMessageDialog/spec.js +59 -1
- package/Dialog/components/VariantSelectModal/connector.js +11 -2
- package/Dialog/components/VariantSelectModal/index.js +65 -6
- package/Dialog/components/VariantSelectModal/spec.js +51 -2
- package/Dialog/constants.js +6 -1
- package/Dialog/index.js +114 -7
- package/Dialog/spec.js +81 -3
- package/DiscountBadge/index.js +30 -2
- package/DiscountBadge/spec.js +19 -1
- package/DiscountBadge/style.js +34 -2
- package/FavoritesButton/connector.js +18 -3
- package/FavoritesButton/index.js +118 -15
- package/FavoritesButton/mock.js +50 -4
- package/FavoritesButton/spec.js +120 -2
- package/FavoritesButton/style.js +26 -1
- package/Form/Builder/builders/buildCountryList.js +40 -6
- package/Form/Builder/builders/buildFormDefaults.js +35 -6
- package/Form/Builder/builders/buildFormElements.js +68 -10
- package/Form/Builder/builders/buildProvinceList.js +19 -2
- package/Form/Builder/builders/buildValidationErrorList.js +7 -2
- package/Form/Builder/classes/ActionListener/constants.js +22 -2
- package/Form/Builder/classes/ActionListener/index.js +441 -93
- package/Form/Builder/classes/ActionListener/spec.js +321 -19
- package/Form/Builder/components/CheckboxElement.js +35 -3
- package/Form/Builder/components/CountryElement.js +40 -3
- package/Form/Builder/components/ProvinceElement.js +40 -3
- package/Form/Builder/components/RadioElement.js +41 -3
- package/Form/Builder/components/SelectElement.js +39 -3
- package/Form/Builder/components/TextElement.js +49 -4
- package/Form/Builder/elementTypes.js +11 -1
- package/Form/Builder/index.js +298 -52
- package/Form/Builder/iso-3166-2.js +4943 -1
- package/Form/Builder/spec.js +308 -16
- package/Form/Checkbox/index.js +66 -4
- package/Form/Checkbox/style.js +25 -2
- package/Form/InfoField/index.js +50 -2
- package/Form/InfoField/spec.js +9 -1
- package/Form/InfoField/style.js +11 -1
- package/Form/Password/index.js +51 -6
- package/Form/Password/spec.js +34 -1
- package/Form/Password/style.js +11 -1
- package/Form/RadioGroup/components/Item/index.js +59 -3
- package/Form/RadioGroup/components/Item/style.js +32 -2
- package/Form/RadioGroup/index.js +101 -9
- package/Form/RadioGroup/spec.js +83 -3
- package/Form/RadioGroup/style.js +18 -2
- package/Form/Select/index.js +158 -10
- package/Form/Select/spec.js +36 -5
- package/Form/Select/style.js +27 -1
- package/Form/SelectContextChoices/index.js +77 -3
- package/Form/SelectContextChoices/spec.js +33 -4
- package/Form/SelectContextChoices/style.js +23 -1
- package/Form/TextField/index.js +92 -8
- package/Form/TextField/spec.js +110 -1
- package/Form/TextField/style.js +66 -8
- package/Form/index.js +54 -13
- package/FormElement/components/ErrorText/index.js +31 -2
- package/FormElement/components/ErrorText/style.js +13 -1
- package/FormElement/components/Label/index.js +35 -2
- package/FormElement/components/Label/style.js +76 -8
- package/FormElement/components/Placeholder/index.js +26 -2
- package/FormElement/components/Placeholder/style.js +48 -6
- package/FormElement/components/Underline/index.js +18 -2
- package/FormElement/components/Underline/style.js +51 -4
- package/FormElement/index.js +91 -6
- package/FormElement/spec.js +67 -2
- package/FormElement/style.js +13 -2
- package/Glow/index.js +90 -7
- package/Glow/spec.js +9 -1
- package/Glow/style.js +18 -1
- package/IndicatorCircle/index.js +33 -3
- package/IndicatorCircle/spec.js +28 -1
- package/IndicatorCircle/style.js +57 -3
- package/LoadingIndicator/index.js +29 -2
- package/LoadingIndicator/style.js +20 -1
- package/Manufacturer/index.js +20 -2
- package/Manufacturer/style.js +5 -1
- package/MessageBar/index.js +36 -2
- package/MessageBar/spec.js +79 -1
- package/MessageBar/style.js +38 -1
- package/NoResults/components/Icon/index.js +130 -2
- package/NoResults/components/Icon/style.js +17 -1
- package/NoResults/index.js +46 -2
- package/NoResults/style.js +31 -1
- package/Placeholder/index.js +25 -3
- package/Placeholder/style.js +11 -1
- package/PlaceholderLabel/index.js +27 -2
- package/PlaceholderLabel/spec.js +19 -1
- package/PlaceholderLabel/style.js +12 -1
- package/PlaceholderParagraph/index.js +36 -2
- package/PlaceholderParagraph/spec.js +19 -1
- package/Price/index.js +88 -7
- package/Price/style.js +22 -1
- package/PriceInfo/index.js +20 -2
- package/PriceInfo/style.js +5 -1
- package/PriceStriked/index.js +83 -12
- package/PriceStriked/style.js +33 -3
- package/ProductProperties/index.js +32 -2
- package/ProgressBar/index.js +101 -13
- package/ProgressBar/spec.js +13 -1
- package/ProgressBar/style.js +83 -2
- package/RadioButton/index.js +18 -2
- package/RadioButton/spec.js +21 -1
- package/RadioButton/style.js +21 -1
- package/RatingNumber/index.js +29 -2
- package/RatingStars/constants.js +2 -1
- package/RatingStars/index.js +130 -12
- package/RatingStars/spec.js +90 -3
- package/RatingStars/style.js +51 -2
- package/Ripple/components/RippleAnimation/index.js +88 -6
- package/Ripple/index.js +218 -40
- package/Ripple/style.js +18 -1
- package/RippleButton/index.js +52 -5
- package/RippleButton/spec.js +45 -1
- package/ScannerOverlay/components/CameraOverlay/index.js +13 -2
- package/ScannerOverlay/components/CameraOverlay/style.js +40 -1
- package/ScannerOverlay/components/ScannerBar/components/FlashlightButton/index.js +34 -2
- package/ScannerOverlay/components/ScannerBar/components/FlashlightButton/style.js +28 -1
- package/ScannerOverlay/components/ScannerBar/components/ScannerInstructions/index.js +11 -2
- package/ScannerOverlay/components/ScannerBar/index.js +31 -2
- package/ScannerOverlay/components/ScannerBar/style.js +20 -1
- package/ScannerOverlay/index.js +47 -7
- package/Sheet/components/Header/components/SearchBar/index.js +46 -2
- package/Sheet/components/Header/components/SearchBar/spec.js +21 -3
- package/Sheet/components/Header/components/SearchBar/style.js +47 -1
- package/Sheet/components/Header/index.js +75 -7
- package/Sheet/components/Header/spec.js +14 -1
- package/Sheet/components/Header/style.js +50 -1
- package/Sheet/index.js +170 -17
- package/Sheet/spec.js +85 -5
- package/Sheet/style.js +143 -2
- package/TaxDisclaimer/index.js +34 -4
- package/TaxDisclaimer/spec.js +31 -3
- package/TaxDisclaimer/style.js +9 -1
- package/TextField/components/ErrorText/index.js +33 -2
- package/TextField/components/ErrorText/style.js +25 -3
- package/TextField/components/FormElement/index.js +19 -2
- package/TextField/components/FormElement/style.js +32 -4
- package/TextField/components/Hint/index.js +21 -2
- package/TextField/components/Hint/style.js +40 -5
- package/TextField/components/Label/index.js +32 -3
- package/TextField/components/Label/style.js +68 -8
- package/TextField/components/Underline/index.js +19 -2
- package/TextField/components/Underline/style.js +51 -4
- package/TextField/index.js +189 -27
- package/TextField/spec.js +128 -3
- package/TextField/style.js +34 -4
- package/ToggleIcon/index.js +58 -8
- package/ToggleIcon/spec.js +35 -1
- package/icons/AccountBoxIcon.js +11 -2
- package/icons/AddMoreIcon.js +11 -2
- package/icons/ArrowDropIcon.js +11 -2
- package/icons/ArrowIcon.js +21 -2
- package/icons/BarcodeScannerIcon.js +11 -2
- package/icons/BoxIcon.js +11 -2
- package/icons/BrowseIcon.js +11 -2
- package/icons/BurgerIcon.js +11 -2
- package/icons/CalendarIcon.js +15 -3
- package/icons/CartCouponIcon.js +72 -2
- package/icons/CartIcon.js +11 -2
- package/icons/CartPlusIcon.js +11 -2
- package/icons/CheckIcon.js +11 -2
- package/icons/CheckedIcon.js +11 -2
- package/icons/ChevronIcon.js +11 -2
- package/icons/CreditCardIcon.js +11 -2
- package/icons/CrossIcon.js +11 -2
- package/icons/DescriptionIcon.js +11 -2
- package/icons/FilterIcon.js +11 -2
- package/icons/FlashDisabledIcon.js +11 -2
- package/icons/FlashEnabledIcon.js +11 -2
- package/icons/GridIcon.js +11 -2
- package/icons/HeartIcon.js +11 -2
- package/icons/HeartOutlineIcon.js +11 -2
- package/icons/HeartPlusIcon.js +12 -2
- package/icons/HeartPlusOutlineIcon.js +12 -2
- package/icons/HomeIcon.js +11 -2
- package/icons/InfoIcon.js +11 -2
- package/icons/InfoOutlineIcon.js +11 -2
- package/icons/ListIcon.js +11 -2
- package/icons/LocalShippingIcon.js +11 -2
- package/icons/LocationIcon.js +13 -3
- package/icons/LocatorIcon.js +11 -2
- package/icons/LockIcon.js +11 -2
- package/icons/LogoutIcon.js +11 -2
- package/icons/MagnifierIcon.js +11 -2
- package/icons/MapMarkerIcon.js +24 -3
- package/icons/MoreIcon.js +11 -2
- package/icons/MoreVertIcon.js +11 -2
- package/icons/NotificationIcon.js +14 -3
- package/icons/PersonIcon.js +12 -2
- package/icons/PhoneIcon.js +13 -3
- package/icons/PlaceholderIcon.js +11 -2
- package/icons/RadioCheckedIcon.js +11 -2
- package/icons/RadioUncheckedIcon.js +11 -2
- package/icons/SecurityIcon.js +11 -2
- package/icons/ShippingMethodIcon.js +18 -3
- package/icons/ShoppingCartIcon.js +11 -2
- package/icons/SortIcon.js +11 -2
- package/icons/StarHalfIcon.js +18 -2
- package/icons/StarIcon.js +18 -2
- package/icons/StarOutlineIcon.js +11 -2
- package/icons/StopIcon.js +11 -2
- package/icons/TickIcon.js +11 -2
- package/icons/TimeIcon.js +14 -3
- package/icons/TrashIcon.js +11 -2
- package/icons/TrashOutlineIcon.js +12 -2
- package/icons/UncheckedIcon.js +11 -2
- package/icons/ViewListIcon.js +11 -2
- package/icons/VisibilityIcon.js +11 -2
- package/icons/VisibilityOffIcon.js +11 -2
- package/icons/WarningIcon.js +11 -2
- package/index.js +13 -1
- package/package.json +5 -5
package/TextField/spec.js
CHANGED
|
@@ -1,5 +1,130 @@
|
|
|
1
|
-
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { mount } from 'enzyme';
|
|
4
|
+
import TextField from "./index";
|
|
5
|
+
const inputProps = {
|
|
6
|
+
name: 'test-input'
|
|
7
|
+
};
|
|
8
|
+
describe('<TextField />', () => {
|
|
9
|
+
it('should render a simple text field', () => {
|
|
10
|
+
const wrapper = mount(/*#__PURE__*/React.createElement(TextField, inputProps));
|
|
11
|
+
expect(wrapper).toMatchSnapshot();
|
|
12
|
+
expect(wrapper.find('input').length).toBe(1);
|
|
13
|
+
});
|
|
14
|
+
it('should render the text field as password', () => {
|
|
15
|
+
const wrapper = mount(/*#__PURE__*/React.createElement(TextField, _extends({}, inputProps, {
|
|
16
|
+
password: true
|
|
17
|
+
})));
|
|
18
|
+
expect(wrapper).toMatchSnapshot();
|
|
19
|
+
expect(wrapper.find('input[type="password"]').length).toBe(1);
|
|
20
|
+
});
|
|
21
|
+
it('should render the text field with a default value', () => {
|
|
22
|
+
const wrapper = mount(/*#__PURE__*/React.createElement(TextField, _extends({}, inputProps, {
|
|
23
|
+
value: "FooBar"
|
|
24
|
+
})));
|
|
25
|
+
expect(wrapper).toMatchSnapshot();
|
|
26
|
+
expect(wrapper.find('input[value="FooBar"]').length).toBe(1);
|
|
27
|
+
});
|
|
28
|
+
it('should trigger the onChange callback', () => {
|
|
29
|
+
const onChangeMock = jest.fn();
|
|
30
|
+
const wrapper = mount(/*#__PURE__*/React.createElement(TextField, _extends({}, inputProps, {
|
|
31
|
+
onChange: onChangeMock
|
|
32
|
+
})));
|
|
33
|
+
wrapper.find('input').simulate('change', {
|
|
34
|
+
target: {
|
|
35
|
+
value: 'a'
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
expect(onChangeMock).toHaveBeenCalledTimes(2);
|
|
39
|
+
expect(wrapper.find('input').props().value).toEqual('a');
|
|
40
|
+
});
|
|
41
|
+
it('should receive the correct value while typing', () => {
|
|
42
|
+
const wrapper = mount(/*#__PURE__*/React.createElement(TextField, inputProps));
|
|
43
|
+
const input = wrapper.find('input');
|
|
44
|
+
input.simulate('change', {
|
|
45
|
+
target: {
|
|
46
|
+
value: 'foobar'
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
expect(wrapper).toMatchSnapshot();
|
|
50
|
+
expect(input.instance().value).toBe('foobar');
|
|
51
|
+
});
|
|
52
|
+
it('should sanitize the input', () => {
|
|
53
|
+
const wrapper = mount(/*#__PURE__*/React.createElement(TextField, _extends({}, inputProps, {
|
|
54
|
+
onSanitize: value => value.toUpperCase()
|
|
55
|
+
})));
|
|
56
|
+
const input = wrapper.find('input');
|
|
57
|
+
input.simulate('change', {
|
|
58
|
+
target: {
|
|
59
|
+
value: 'foobar'
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
expect(wrapper).toMatchSnapshot();
|
|
63
|
+
expect(input.instance().value).toBe('FOOBAR');
|
|
64
|
+
});
|
|
65
|
+
it('should trigger the validation callback', () => {
|
|
66
|
+
const onValidateMock = jest.fn();
|
|
67
|
+
const wrapper = mount(/*#__PURE__*/React.createElement(TextField, _extends({}, inputProps, {
|
|
68
|
+
onValidate: onValidateMock
|
|
69
|
+
})));
|
|
70
|
+
expect(wrapper).toMatchSnapshot();
|
|
71
|
+
expect(onValidateMock).toHaveBeenCalled();
|
|
72
|
+
});
|
|
73
|
+
it('should focus the input', () => {
|
|
74
|
+
const onFocusMock = jest.fn();
|
|
75
|
+
const wrapper = mount(/*#__PURE__*/React.createElement(TextField, _extends({}, inputProps, {
|
|
76
|
+
onFocusChange: onFocusMock
|
|
77
|
+
})));
|
|
78
|
+
const input = wrapper.find('input');
|
|
79
|
+
expect(wrapper).toMatchSnapshot();
|
|
80
|
+
expect(wrapper.instance().isFocused).toBe(false);
|
|
81
|
+
input.simulate('focus');
|
|
82
|
+
expect(wrapper.instance().isFocused).toBe(true);
|
|
83
|
+
input.simulate('blur');
|
|
84
|
+
expect(wrapper.instance().isFocused).toBe(false);
|
|
85
|
+
});
|
|
86
|
+
it('should show the error message', () => {
|
|
87
|
+
const errorText = 'This is an error here';
|
|
88
|
+
const wrapper = mount(/*#__PURE__*/React.createElement(TextField, _extends({}, inputProps, {
|
|
89
|
+
errorText: errorText
|
|
90
|
+
})));
|
|
91
|
+
expect(wrapper).toMatchSnapshot();
|
|
92
|
+
expect(wrapper.find('Translate').at(2).props().string).toEqual(errorText);
|
|
93
|
+
});
|
|
94
|
+
it('should show the label', () => {
|
|
95
|
+
const label = 'This is the label';
|
|
96
|
+
const wrapper = mount(/*#__PURE__*/React.createElement(TextField, _extends({}, inputProps, {
|
|
97
|
+
label: label
|
|
98
|
+
})));
|
|
99
|
+
expect(wrapper).toMatchSnapshot();
|
|
100
|
+
expect(wrapper.find('Label').find('Translate').props().string).toEqual(label);
|
|
101
|
+
});
|
|
102
|
+
it('should show the hint text', () => {
|
|
103
|
+
const hintText = 'This is the hint text';
|
|
104
|
+
const wrapper = mount(/*#__PURE__*/React.createElement(TextField, _extends({}, inputProps, {
|
|
105
|
+
hintText: hintText
|
|
106
|
+
})));
|
|
107
|
+
expect(wrapper).toMatchSnapshot();
|
|
108
|
+
expect(wrapper.find('Hint').find('Translate').at(0).props().string).toEqual(hintText);
|
|
109
|
+
});
|
|
110
|
+
it('should replace the error text with custom validation error', () => {
|
|
111
|
+
/**
|
|
2
112
|
* A custom validation method that always returns an error.
|
|
3
113
|
* @return {string} The error message.
|
|
4
|
-
*/
|
|
5
|
-
|
|
114
|
+
*/
|
|
115
|
+
const onValidate = () => 'Custom validation error';
|
|
116
|
+
const wrapper = mount(/*#__PURE__*/React.createElement(TextField, _extends({}, inputProps, {
|
|
117
|
+
onValidate: onValidate
|
|
118
|
+
})));
|
|
119
|
+
wrapper.find('input').simulate('blur');
|
|
120
|
+
expect(wrapper).toMatchSnapshot();
|
|
121
|
+
// Expect at least one element containing the validation error text.
|
|
122
|
+
expect(wrapper.findWhere(node => {
|
|
123
|
+
try {
|
|
124
|
+
return node.text() === onValidate();
|
|
125
|
+
} catch (e) {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
}).length).toBeGreaterThan(0);
|
|
129
|
+
});
|
|
130
|
+
});
|
package/TextField/style.js
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { css } from 'glamor';
|
|
2
|
+
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
3
|
+
|
|
4
|
+
// Selects a date input that is not focused.
|
|
5
|
+
const bluredDateSelector = 'input[type="date"]:in-range:not(:focus)';
|
|
6
|
+
|
|
7
|
+
/**
|
|
3
8
|
* The styles for the container element.
|
|
4
|
-
*/
|
|
5
|
-
|
|
9
|
+
*/
|
|
10
|
+
const container = {
|
|
11
|
+
input: css({
|
|
12
|
+
position: 'relative',
|
|
13
|
+
paddingBottom: themeConfig.variables.gap.big,
|
|
14
|
+
width: '100%',
|
|
15
|
+
// Fixes layout issue with webkit. Height is 0 in some webkit browsers.
|
|
16
|
+
'& input[type="date"]': {
|
|
17
|
+
minHeight: '1.3rem',
|
|
18
|
+
appearance: 'none',
|
|
19
|
+
paddingLeft: 0,
|
|
20
|
+
marginLeft: 0
|
|
21
|
+
},
|
|
22
|
+
// Removes placeholder texts on chrome when input is not focused.
|
|
23
|
+
[`& ${bluredDateSelector}::-webkit-datetime-edit-year-field, ` + `${bluredDateSelector}::-webkit-datetime-edit-month-field, ` + `${bluredDateSelector}::-webkit-datetime-edit-day-field, ` + `${bluredDateSelector}::-webkit-datetime-edit-text`]: {
|
|
24
|
+
padding: 0,
|
|
25
|
+
color: 'transparent'
|
|
26
|
+
}
|
|
27
|
+
}).toString(),
|
|
28
|
+
multiLine: css({
|
|
29
|
+
position: 'relative',
|
|
30
|
+
width: '100%'
|
|
31
|
+
}).toString()
|
|
32
|
+
};
|
|
33
|
+
export default {
|
|
34
|
+
container
|
|
35
|
+
};
|
package/ToggleIcon/index.js
CHANGED
|
@@ -1,14 +1,64 @@
|
|
|
1
|
-
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
2
5
|
* No operational default handler
|
|
3
|
-
*/
|
|
6
|
+
*/
|
|
7
|
+
const noop = () => {};
|
|
8
|
+
|
|
9
|
+
/**
|
|
4
10
|
* An toggle icon with toggle handlers.
|
|
5
|
-
*/
|
|
11
|
+
*/
|
|
12
|
+
class ToggleIcon extends Component {
|
|
13
|
+
/**
|
|
6
14
|
* @param {Object} props The component properties.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
|
|
15
|
+
*/
|
|
16
|
+
constructor(props) {
|
|
17
|
+
super(props);
|
|
18
|
+
/**
|
|
19
|
+
* Toggle icon
|
|
20
|
+
*/
|
|
21
|
+
this.handleToggle = () => {
|
|
22
|
+
this.setState(({
|
|
23
|
+
on
|
|
24
|
+
}) => ({
|
|
25
|
+
on: !on
|
|
26
|
+
}), () => this.props.toggleHandler(this.state.on));
|
|
27
|
+
};
|
|
28
|
+
this.state = {
|
|
29
|
+
on: props.on
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
10
34
|
* Reset state to received props
|
|
11
35
|
* @param {Object} nextProps next props
|
|
12
|
-
*/
|
|
36
|
+
*/
|
|
37
|
+
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
38
|
+
this.setState({
|
|
39
|
+
on: nextProps.on
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
13
43
|
* @return {*}
|
|
14
|
-
*/
|
|
44
|
+
*/
|
|
45
|
+
render() {
|
|
46
|
+
const {
|
|
47
|
+
onIcon,
|
|
48
|
+
offIcon
|
|
49
|
+
} = this.props;
|
|
50
|
+
const {
|
|
51
|
+
on
|
|
52
|
+
} = this.state;
|
|
53
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
className: "ui-shared__toggle-icon",
|
|
55
|
+
onClick: this.handleToggle,
|
|
56
|
+
"aria-hidden": true
|
|
57
|
+
}, on && onIcon, !on && offIcon);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
ToggleIcon.defaultProps = {
|
|
61
|
+
on: true,
|
|
62
|
+
toggleHandler: noop
|
|
63
|
+
};
|
|
64
|
+
export default ToggleIcon;
|
package/ToggleIcon/spec.js
CHANGED
|
@@ -1 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { mount } from 'enzyme';
|
|
4
|
+
import ToggleIcon from "./index";
|
|
5
|
+
import VisibilityIcon from "../icons/VisibilityIcon";
|
|
6
|
+
import VisibilityOffIcon from "../icons/VisibilityOffIcon";
|
|
7
|
+
const inputProps = {
|
|
8
|
+
onIcon: /*#__PURE__*/React.createElement(VisibilityIcon, null),
|
|
9
|
+
offIcon: /*#__PURE__*/React.createElement(VisibilityOffIcon, null)
|
|
10
|
+
};
|
|
11
|
+
describe('<ToggleIcon>', () => {
|
|
12
|
+
it('should render a toggle icon', () => {
|
|
13
|
+
const wrapper = mount(/*#__PURE__*/React.createElement(ToggleIcon, inputProps));
|
|
14
|
+
expect(wrapper).toMatchSnapshot();
|
|
15
|
+
expect(wrapper.find('VisibilityIcon').length).toBe(1);
|
|
16
|
+
expect(wrapper.find('VisibilityOffIcon').length).toBe(0);
|
|
17
|
+
});
|
|
18
|
+
it('should render a toggle icon with false as default', () => {
|
|
19
|
+
const wrapper = mount(/*#__PURE__*/React.createElement(ToggleIcon, _extends({}, inputProps, {
|
|
20
|
+
on: false
|
|
21
|
+
})));
|
|
22
|
+
expect(wrapper).toMatchSnapshot();
|
|
23
|
+
expect(wrapper.find('VisibilityIcon').length).toBe(0);
|
|
24
|
+
expect(wrapper.find('VisibilityOffIcon').length).toBe(1);
|
|
25
|
+
});
|
|
26
|
+
it('should trigger the toggleHandler callback', () => {
|
|
27
|
+
const mockToggleHandler = jest.fn();
|
|
28
|
+
const wrapper = mount(/*#__PURE__*/React.createElement(ToggleIcon, _extends({}, inputProps, {
|
|
29
|
+
toggleHandler: mockToggleHandler
|
|
30
|
+
})));
|
|
31
|
+
wrapper.find('div').simulate('click');
|
|
32
|
+
expect(wrapper).toMatchSnapshot();
|
|
33
|
+
expect(mockToggleHandler.mock.calls.length).toBe(1);
|
|
34
|
+
});
|
|
35
|
+
});
|
package/icons/AccountBoxIcon.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Icon from '@shopgate/pwa-common/components/Icon';
|
|
4
|
+
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
5
|
+
|
|
6
|
+
/**
|
|
2
7
|
* The description icon component.
|
|
3
8
|
* @param {Object} props The icon component properties.
|
|
4
9
|
* @returns {JSX}
|
|
5
|
-
*/
|
|
10
|
+
*/
|
|
11
|
+
const AccountBox = props => /*#__PURE__*/React.createElement(Icon, _extends({
|
|
12
|
+
content: themeConfig.icons.accountBox
|
|
13
|
+
}, props));
|
|
14
|
+
export default AccountBox;
|
package/icons/AddMoreIcon.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Icon from '@shopgate/pwa-common/components/Icon';
|
|
4
|
+
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
5
|
+
|
|
6
|
+
/**
|
|
2
7
|
* The add more icon component.
|
|
3
8
|
* @param {Object} props The icon component properties.
|
|
4
9
|
* @returns {JSX}
|
|
5
|
-
*/
|
|
10
|
+
*/
|
|
11
|
+
const AddMore = props => /*#__PURE__*/React.createElement(Icon, _extends({
|
|
12
|
+
content: themeConfig.icons.addMore
|
|
13
|
+
}, props));
|
|
14
|
+
export default AddMore;
|
package/icons/ArrowDropIcon.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Icon from '@shopgate/pwa-common/components/Icon';
|
|
4
|
+
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
5
|
+
|
|
6
|
+
/**
|
|
2
7
|
* The arrow-drop icon component.
|
|
3
8
|
* @param {Object} props The icon component properties.
|
|
4
9
|
* @returns {JSX}
|
|
5
|
-
*/
|
|
10
|
+
*/
|
|
11
|
+
const ArrowDrop = props => /*#__PURE__*/React.createElement(Icon, _extends({
|
|
12
|
+
content: themeConfig.icons.arrowDrop
|
|
13
|
+
}, props));
|
|
14
|
+
export default ArrowDrop;
|
package/icons/ArrowIcon.js
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import Icon from '@shopgate/pwa-common/components/Icon';
|
|
5
|
+
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
6
|
+
|
|
7
|
+
/**
|
|
2
8
|
* The arrow icon component.
|
|
3
9
|
* @param {Object} props The icon component properties.
|
|
4
10
|
* @param {boolean} props.shadow Whether to show a shadow under the arrow.
|
|
5
11
|
* @returns {JSX}
|
|
6
|
-
*/
|
|
12
|
+
*/
|
|
13
|
+
const ArrowIcon = ({
|
|
14
|
+
shadow,
|
|
15
|
+
...props
|
|
16
|
+
}) => {
|
|
17
|
+
const content = shadow ? themeConfig.icons.arrowShadowed : themeConfig.icons.arrow;
|
|
18
|
+
return /*#__PURE__*/React.createElement(Icon, _extends({
|
|
19
|
+
content: content
|
|
20
|
+
}, props));
|
|
21
|
+
};
|
|
22
|
+
ArrowIcon.defaultProps = {
|
|
23
|
+
shadow: false
|
|
24
|
+
};
|
|
25
|
+
export default ArrowIcon;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Icon from '@shopgate/pwa-common/components/Icon';
|
|
4
|
+
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
5
|
+
|
|
6
|
+
/**
|
|
2
7
|
* The barcode icon component.
|
|
3
8
|
* @param {Object} props The icon component properties.
|
|
4
9
|
* @returns {JSX}
|
|
5
|
-
*/
|
|
10
|
+
*/
|
|
11
|
+
const BarcodeScanner = props => /*#__PURE__*/React.createElement(Icon, _extends({
|
|
12
|
+
content: themeConfig.icons.barcodeScanner
|
|
13
|
+
}, props));
|
|
14
|
+
export default BarcodeScanner;
|
package/icons/BoxIcon.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Icon from '@shopgate/pwa-common/components/Icon';
|
|
4
|
+
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
5
|
+
|
|
6
|
+
/**
|
|
2
7
|
* The box icon component.
|
|
3
8
|
* @param {Object} props The icon component properties.
|
|
4
9
|
* @returns {JSX}
|
|
5
|
-
*/
|
|
10
|
+
*/
|
|
11
|
+
const Box = props => /*#__PURE__*/React.createElement(Icon, _extends({
|
|
12
|
+
content: themeConfig.icons.box
|
|
13
|
+
}, props));
|
|
14
|
+
export default Box;
|
package/icons/BrowseIcon.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Icon from '@shopgate/pwa-common/components/Icon';
|
|
4
|
+
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
5
|
+
|
|
6
|
+
/**
|
|
2
7
|
* The home icon component.
|
|
3
8
|
* @param {Object} props The icon component properties.
|
|
4
9
|
* @returns {JSX}
|
|
5
|
-
*/
|
|
10
|
+
*/
|
|
11
|
+
const Browse = props => /*#__PURE__*/React.createElement(Icon, _extends({
|
|
12
|
+
content: themeConfig.icons.browse
|
|
13
|
+
}, props));
|
|
14
|
+
export default Browse;
|
package/icons/BurgerIcon.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Icon from '@shopgate/pwa-common/components/Icon';
|
|
4
|
+
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
5
|
+
|
|
6
|
+
/**
|
|
2
7
|
* The burger icon component.
|
|
3
8
|
* @param {Object} props The icon component properties.
|
|
4
9
|
* @returns {JSX}
|
|
5
|
-
*/
|
|
10
|
+
*/
|
|
11
|
+
const Burger = props => /*#__PURE__*/React.createElement(Icon, _extends({
|
|
12
|
+
content: themeConfig.icons.burger
|
|
13
|
+
}, props));
|
|
14
|
+
export default Burger;
|
package/icons/CalendarIcon.js
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Icon from '@shopgate/pwa-common/components/Icon';
|
|
4
|
+
|
|
5
|
+
// SVG Content
|
|
6
|
+
const content = '<path d="M21.706 6.146c1.116 0 2.02-.898 2.02-2.016V2.02c0-1.119-.903-2.02-2.02-2.02s-2.019.9-2.019 2.02v2.111a2.014 2.014 0 002.019 2.015z"/><path d="M28.882 3.494h-4.066v1.027a3.078 3.078 0 01-3.075 3.076 3.076 3.076 0 01-3.074-3.076V3.494h-8.205v1.027c0 1.695-1.379 3.076-3.076 3.076s-3.075-1.38-3.075-3.076V3.494L.208 3.443v25.678h26.656l2.049-.006-.031-25.621zm-2.02 23.582H2.26V10.672h24.604v16.404h-.002z"/><path d="M7.354 6.146A2.016 2.016 0 009.375 4.13V2.02C9.375.9 8.47 0 7.354 0S5.336.9 5.336 2.02v2.111c0 1.117.901 2.015 2.018 2.015zM10.468 12.873h3.231v2.852h-3.231zM15.692 12.873h3.234v2.852h-3.234zM20.537 12.873h3.231v2.852h-3.231zM10.468 17.609h3.231v2.85h-3.231zM15.692 17.609h3.234v2.85h-3.234zM20.537 17.609h3.231v2.85h-3.231zM10.468 22.439h3.231v2.85h-3.231zM5.336 17.609h3.229v2.85H5.336zM5.336 22.439h3.229v2.85H5.336zM15.692 22.439h3.234v2.85h-3.234zM20.537 22.439h3.231v2.85h-3.231z"/>';
|
|
7
|
+
|
|
8
|
+
/**
|
|
3
9
|
* The calendar icon component.
|
|
4
10
|
* @param {Object} props The component properties.
|
|
5
11
|
* @returns {JSX}
|
|
6
|
-
*/
|
|
12
|
+
*/
|
|
13
|
+
const Calendar = props => /*#__PURE__*/React.createElement(Icon, _extends({
|
|
14
|
+
content: content
|
|
15
|
+
}, props, {
|
|
16
|
+
viewBox: "0 0 29.121 29.121"
|
|
17
|
+
}));
|
|
18
|
+
export default Calendar;
|
package/icons/CartCouponIcon.js
CHANGED
|
@@ -1,5 +1,75 @@
|
|
|
1
|
-
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Icon from '@shopgate/pwa-common/components/Icon';
|
|
4
|
+
const content = `
|
|
5
|
+
<defs>
|
|
6
|
+
<style>
|
|
7
|
+
.cls-1, .cls-3 {
|
|
8
|
+
fill: #81c6e5;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.cls-1 {
|
|
12
|
+
opacity: 0.19;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.cls-2 {
|
|
16
|
+
fill: none;
|
|
17
|
+
fill-rule: evenodd;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.cls-4 {
|
|
21
|
+
clip-path: url(#clip-path);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.cls-5, .cls-6 {
|
|
25
|
+
opacity: 0.09;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.cls-5 {
|
|
29
|
+
fill: url(#linear-gradient);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.cls-6 {
|
|
33
|
+
fill: url(#linear-gradient-2);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.cls-7 {
|
|
37
|
+
fill: #fff;
|
|
38
|
+
}
|
|
39
|
+
</style>
|
|
40
|
+
<clipPath id="clip-path">
|
|
41
|
+
<path class="cls-1" d="M39.407,6.8A23.038,23.038,0,0,0,6.6,39.15a23.007,23.007,0,0,0,32.552.2l.1-.1A23.078,23.078,0,0,0,39.407,6.8Z" transform="translate(0 0)"/>
|
|
42
|
+
</clipPath>
|
|
43
|
+
<linearGradient id="linear-gradient" x1="0.273" y1="0.267" x2="0.705" y2="0.641" gradientUnits="objectBoundingBox">
|
|
44
|
+
<stop offset="0"/>
|
|
45
|
+
<stop offset="1" stop-opacity="0.251"/>
|
|
46
|
+
</linearGradient>
|
|
47
|
+
<linearGradient id="linear-gradient-2" x1="0.5" y1="0" x2="0.5" y2="1" xlink:href="#linear-gradient"/>
|
|
48
|
+
</defs>
|
|
49
|
+
<g transform="translate(283 -149)">
|
|
50
|
+
<path class="cls-2" d="M39.474-83.7a22.758,22.758,0,0,0-32.346-.1,23.309,23.309,0,0,0-.1,32.455A22.484,22.484,0,0,0,23.1-44.5a22.282,22.282,0,0,0,16.123-6.644l.1-.1A23.26,23.26,0,0,0,39.474-83.7Z" transform="translate(3265.005 8065.5)"/>
|
|
51
|
+
<path class="cls-3" d="M39.407,6.8A23.038,23.038,0,0,0,6.6,39.15a23.007,23.007,0,0,0,32.552.2l.1-.1A23.078,23.078,0,0,0,39.407,6.8Z" transform="translate(3265 7975)"/>
|
|
52
|
+
<g class="cls-4" transform="translate(3265 7975)">
|
|
53
|
+
<path class="cls-5" d="M3173.978,8072.545l-20.807,21.038,17.736,17.381,20.526-22.043Z" transform="translate(-3140.448 -8060)"/>
|
|
54
|
+
</g>
|
|
55
|
+
<path class="cls-6" d="M3160.986,8075.234l-6.975,6.144,6.15,6.08,6.542-6.665Z" transform="translate(124.137 -86.315)"/>
|
|
56
|
+
<path class="cls-2" d="M5.454-46.5a4.99,4.99,0,0,1,4.954,5.009,4.99,4.99,0,0,1-4.954,5.009A4.99,4.99,0,0,1,.5-41.491,4.99,4.99,0,0,1,5.454-46.5Z" transform="translate(3275.621 8032.744)"/>
|
|
57
|
+
<path class="cls-2" d="M32.454-10.482A4.99,4.99,0,0,1,27.5-15.491,4.99,4.99,0,0,1,32.454-20.5a4.99,4.99,0,0,1,4.954,5.009A4.99,4.99,0,0,1,32.454-10.482Z" transform="translate(3262.269 8020.033)"/>
|
|
58
|
+
<g transform="translate(3276.244 7986.244)">
|
|
59
|
+
<path class="cls-7" d="M5.008,0a5.073,5.073,0,0,1,5.008,5.12,5.073,5.073,0,0,1-5.008,5.12A5.073,5.073,0,0,1,0,5.12,5.073,5.073,0,0,1,5.008,0Z" transform="translate(0 0)"/>
|
|
60
|
+
<path class="cls-7" d="M2.553,23.044a1.533,1.533,0,0,1-1.067.467,1.448,1.448,0,0,1-1.067-.467,1.559,1.559,0,0,1,0-2.127L20.485.428a1.481,1.481,0,0,1,2.083,0,1.614,1.614,0,0,1,.051,2.127Z" transform="translate(0.511 0)"/>
|
|
61
|
+
<path class="cls-7" d="M4.854,9.927A4.918,4.918,0,0,1,0,4.963,4.918,4.918,0,0,1,4.854,0,4.918,4.918,0,0,1,9.709,4.963,4.918,4.918,0,0,1,4.854,9.927Z" transform="translate(13.802 13.584)"/>
|
|
62
|
+
</g>
|
|
63
|
+
</g>
|
|
64
|
+
`;
|
|
65
|
+
|
|
66
|
+
/**
|
|
2
67
|
* Cart discount default icon
|
|
3
68
|
* @param {Object} props .
|
|
4
69
|
* @returns {JSX}
|
|
5
|
-
*/
|
|
70
|
+
*/
|
|
71
|
+
const CartCouponIcon = props => /*#__PURE__*/React.createElement(Icon, _extends({
|
|
72
|
+
content: content,
|
|
73
|
+
viewBox: "3548 7826 45.999 46"
|
|
74
|
+
}, props));
|
|
75
|
+
export default CartCouponIcon;
|
package/icons/CartIcon.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Icon from '@shopgate/pwa-common/components/Icon';
|
|
4
|
+
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
5
|
+
|
|
6
|
+
/**
|
|
2
7
|
* The cart icon component.
|
|
3
8
|
* @param {Object} props The icon component properties.
|
|
4
9
|
* @returns {JSX}
|
|
5
|
-
*/
|
|
10
|
+
*/
|
|
11
|
+
const CartIcon = props => /*#__PURE__*/React.createElement(Icon, _extends({
|
|
12
|
+
content: themeConfig.icons.cart
|
|
13
|
+
}, props));
|
|
14
|
+
export default CartIcon;
|
package/icons/CartPlusIcon.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Icon from '@shopgate/pwa-common/components/Icon';
|
|
4
|
+
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
5
|
+
|
|
6
|
+
/**
|
|
2
7
|
* The cart plus icon component.
|
|
3
8
|
* @param {Object} props The icon component properties.
|
|
4
9
|
* @returns {JSX}
|
|
5
|
-
*/
|
|
10
|
+
*/
|
|
11
|
+
const CartPlus = props => /*#__PURE__*/React.createElement(Icon, _extends({
|
|
12
|
+
content: themeConfig.icons.cartPlus
|
|
13
|
+
}, props));
|
|
14
|
+
export default CartPlus;
|
package/icons/CheckIcon.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Icon from '@shopgate/pwa-common/components/Icon';
|
|
4
|
+
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
5
|
+
|
|
6
|
+
/**
|
|
2
7
|
* The check icon component.
|
|
3
8
|
* @param {Object} props The icon component properties.
|
|
4
9
|
* @returns {JSX}
|
|
5
|
-
*/
|
|
10
|
+
*/
|
|
11
|
+
const Check = props => /*#__PURE__*/React.createElement(Icon, _extends({
|
|
12
|
+
content: themeConfig.icons.check
|
|
13
|
+
}, props));
|
|
14
|
+
export default Check;
|