grommet 2.30.0 → 2.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Accordion/Accordion.js +4 -2
- package/components/Accordion/index.d.ts +1 -0
- package/components/Accordion/propTypes.js +1 -0
- package/components/AccordionPanel/AccordionPanel.js +2 -1
- package/components/Anchor/Anchor.js +3 -2
- package/components/Box/Box.js +14 -4
- package/components/Box/stories/Border.js +15 -1
- package/components/Button/Badge.js +42 -43
- package/components/Button/BusyAnimation.js +51 -0
- package/components/Button/Button.js +78 -15
- package/components/Button/StyledButton.js +7 -3
- package/components/Button/StyledButtonKind.js +12 -6
- package/components/Button/index.d.ts +9 -0
- package/components/Button/propTypes.js +7 -0
- package/components/Button/stories/Busy.js +45 -0
- package/components/Calendar/stories/Dual.js +4 -6
- package/components/CheckBox/index.d.ts +1 -1
- package/components/Data/DataForm.js +45 -35
- package/components/Data/filter.js +9 -1
- package/components/Data/stories/Complex.js +63 -6
- package/components/Data/stories/Inline.js +19 -2
- package/components/DataFilter/DataFilter.js +11 -1
- package/components/DataFilters/DataFilters.js +13 -10
- package/components/DataTable/Body.js +16 -13
- package/components/DataTable/DataTable.js +4 -1
- package/components/DataTable/GroupedBody.js +1 -0
- package/components/DataTable/Header.js +1 -0
- package/components/DataTable/buildState.js +12 -10
- package/components/DataTable/stories/Controlled.js +2 -1
- package/components/DataTable/stories/ControlledGrouped.js +2 -1
- package/components/DataTable/stories/CustomThemed/Custom.js +0 -1
- package/components/DataTable/stories/CustomThemed/Fill.js +2 -1
- package/components/DataTable/stories/GroupedOnSelect.js +2 -1
- package/components/DataTable/stories/NoPrimary.js +0 -1
- package/components/DataTable/stories/OnUpdate.js +2 -1
- package/components/DataTable/stories/Served.js +2 -1
- package/components/DataTable/stories/Tunable.js +2 -1
- package/components/DataTable/stories/rowDetails.js +2 -1
- package/components/DataTableColumns/DataTableColumns.js +5 -0
- package/components/DataTableColumns/stories/Simple.js +4 -3
- package/components/DataTableGroupBy/DataTableGroupBy.js +67 -0
- package/components/DataTableGroupBy/README.md +2 -0
- package/components/DataTableGroupBy/index.d.ts +20 -0
- package/components/DataTableGroupBy/index.js +6 -0
- package/components/DataTableGroupBy/propTypes.js +17 -0
- package/components/DataTableGroupBy/stories/Simple.js +50 -0
- package/components/DataView/DataView.js +1 -1
- package/components/DateInput/DateInput.js +3 -2
- package/components/Drop/DropContainer.js +2 -2
- package/components/DropButton/DropButton.js +2 -2
- package/components/FileInput/FileInput.js +82 -53
- package/components/Form/Form.js +95 -44
- package/components/Form/stories/TriggerValidationUsingFormField.js +109 -0
- package/components/FormField/FormField.js +4 -3
- package/components/FormField/index.d.ts +1 -0
- package/components/FormField/propTypes.js +2 -1
- package/components/Grid/stories/CustomThemed/Responsive.js +0 -1
- package/components/InfiniteScroll/InfiniteScroll.js +1 -0
- package/components/Layer/Layer.js +1 -1
- package/components/Layer/LayerContainer.js +2 -2
- package/components/List/index.d.ts +2 -2
- package/components/MaskedInput/MaskedInput.js +3 -2
- package/components/MaskedInput/StyledMaskedInput.js +2 -1
- package/components/NameValueList/NameValueList.js +1 -1
- package/components/Notification/Notification.js +7 -3
- package/components/PageHeader/PageHeader.js +6 -4
- package/components/Pagination/StyledPageControl.js +3 -1
- package/components/Paragraph/Paragraph.js +2 -2
- package/components/Paragraph/stories/All.js +5 -1
- package/components/SelectMultiple/SelectMultiple.js +24 -20
- package/components/SelectMultiple/SelectMultipleContainer.js +16 -13
- package/components/SelectMultiple/SelectMultipleValue.js +1 -1
- package/components/SelectMultiple/stories/Help.js +49 -0
- package/components/Text/Text.js +2 -2
- package/components/TextInput/StyledTextInput.js +2 -1
- package/components/TextInput/TextInput.js +3 -2
- package/components/Tip/stories/HeaderActions.js +0 -1
- package/components/index.d.ts +1 -0
- package/components/index.js +6 -0
- package/es6/components/Accordion/Accordion.js +4 -2
- package/es6/components/Accordion/index.d.ts +1 -0
- package/es6/components/Accordion/propTypes.js +1 -0
- package/es6/components/AccordionPanel/AccordionPanel.js +2 -1
- package/es6/components/Anchor/Anchor.js +4 -3
- package/es6/components/Box/Box.js +14 -4
- package/es6/components/Box/stories/Border.js +15 -1
- package/es6/components/Button/Badge.js +43 -44
- package/es6/components/Button/BusyAnimation.js +41 -0
- package/es6/components/Button/Button.js +79 -17
- package/es6/components/Button/StyledButton.js +8 -4
- package/es6/components/Button/StyledButtonKind.js +13 -7
- package/es6/components/Button/index.d.ts +9 -0
- package/es6/components/Button/propTypes.js +8 -1
- package/es6/components/Button/stories/Busy.js +37 -0
- package/es6/components/Calendar/stories/Dual.js +4 -6
- package/es6/components/CheckBox/index.d.ts +1 -1
- package/es6/components/Data/DataForm.js +43 -34
- package/es6/components/Data/filter.js +9 -1
- package/es6/components/Data/stories/Complex.js +64 -7
- package/es6/components/Data/stories/Inline.js +20 -3
- package/es6/components/DataFilter/DataFilter.js +11 -1
- package/es6/components/DataFilters/DataFilters.js +13 -10
- package/es6/components/DataTable/Body.js +15 -13
- package/es6/components/DataTable/DataTable.js +4 -1
- package/es6/components/DataTable/GroupedBody.js +1 -0
- package/es6/components/DataTable/buildState.js +12 -10
- package/es6/components/DataTableColumns/DataTableColumns.js +5 -0
- package/es6/components/DataTableColumns/stories/Simple.js +5 -4
- package/es6/components/DataTableGroupBy/DataTableGroupBy.js +60 -0
- package/es6/components/DataTableGroupBy/README.md +2 -0
- package/es6/components/DataTableGroupBy/index.d.ts +20 -0
- package/es6/components/DataTableGroupBy/index.js +1 -0
- package/es6/components/DataTableGroupBy/propTypes.js +11 -0
- package/es6/components/DataTableGroupBy/stories/Simple.js +45 -0
- package/es6/components/DataView/DataView.js +1 -1
- package/es6/components/DateInput/DateInput.js +3 -2
- package/es6/components/Drop/DropContainer.js +2 -2
- package/es6/components/DropButton/DropButton.js +2 -2
- package/es6/components/FileInput/FileInput.js +83 -53
- package/es6/components/Form/Form.js +95 -44
- package/es6/components/Form/stories/TriggerValidationUsingFormField.js +102 -0
- package/es6/components/FormField/FormField.js +4 -3
- package/es6/components/FormField/index.d.ts +1 -0
- package/es6/components/FormField/propTypes.js +2 -1
- package/es6/components/InfiniteScroll/InfiniteScroll.js +1 -0
- package/es6/components/Layer/Layer.js +1 -1
- package/es6/components/Layer/LayerContainer.js +2 -2
- package/es6/components/List/index.d.ts +2 -2
- package/es6/components/MaskedInput/MaskedInput.js +4 -3
- package/es6/components/MaskedInput/StyledMaskedInput.js +2 -1
- package/es6/components/NameValueList/NameValueList.js +1 -1
- package/es6/components/Notification/Notification.js +7 -3
- package/es6/components/PageHeader/PageHeader.js +6 -4
- package/es6/components/Pagination/StyledPageControl.js +3 -1
- package/es6/components/Paragraph/Paragraph.js +2 -2
- package/es6/components/Paragraph/stories/All.js +5 -1
- package/es6/components/SelectMultiple/SelectMultiple.js +24 -20
- package/es6/components/SelectMultiple/SelectMultipleContainer.js +16 -13
- package/es6/components/SelectMultiple/SelectMultipleValue.js +1 -1
- package/es6/components/SelectMultiple/stories/Help.js +42 -0
- package/es6/components/Text/Text.js +2 -2
- package/es6/components/TextInput/StyledTextInput.js +2 -1
- package/es6/components/TextInput/TextInput.js +4 -3
- package/es6/components/index.d.ts +1 -0
- package/es6/components/index.js +1 -0
- package/es6/index.d.ts +1 -0
- package/es6/languages/default.json +15 -2
- package/es6/themes/base.d.ts +3 -0
- package/es6/themes/base.js +7 -1
- package/es6/utils/icon.js +7 -0
- package/es6/utils/index.js +1 -0
- package/es6/utils/styles.js +10 -0
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/index.d.ts +1 -0
- package/languages/default.json +15 -2
- package/package.json +49 -48
- package/themes/base.d.ts +3 -0
- package/themes/base.js +7 -1
- package/utils/icon.js +12 -0
- package/utils/index.js +6 -0
- package/utils/styles.js +12 -1
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StatusGood } from "grommet-icons/es6/icons/StatusGood";
|
|
3
|
+
import { Box, Button, Form, FormField, Heading } from 'grommet';
|
|
4
|
+
export var TriggerValidationUsingFormField = function TriggerValidationUsingFormField() {
|
|
5
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
6
|
+
fill: true,
|
|
7
|
+
align: "center",
|
|
8
|
+
justify: "center"
|
|
9
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
10
|
+
width: "medium"
|
|
11
|
+
}, /*#__PURE__*/React.createElement(Heading, {
|
|
12
|
+
alignSelf: "center",
|
|
13
|
+
level: "2"
|
|
14
|
+
}, "Validate On"), /*#__PURE__*/React.createElement(Form, {
|
|
15
|
+
onReset: function onReset(event) {
|
|
16
|
+
return console.log(event);
|
|
17
|
+
},
|
|
18
|
+
onSubmit: function onSubmit(_ref) {
|
|
19
|
+
var value = _ref.value;
|
|
20
|
+
return console.log('Submit', value);
|
|
21
|
+
}
|
|
22
|
+
}, /*#__PURE__*/React.createElement(FormField, {
|
|
23
|
+
label: "Blur",
|
|
24
|
+
name: "blur",
|
|
25
|
+
"aria-label": "blur",
|
|
26
|
+
required: true,
|
|
27
|
+
validate: [{
|
|
28
|
+
regexp: /^[a-z]/i
|
|
29
|
+
}, function (name) {
|
|
30
|
+
if (name && name.length === 1) return 'must be >1 character';
|
|
31
|
+
return undefined;
|
|
32
|
+
}, function (name) {
|
|
33
|
+
if (name === 'good') return {
|
|
34
|
+
message: /*#__PURE__*/React.createElement(Box, {
|
|
35
|
+
align: "end"
|
|
36
|
+
}, /*#__PURE__*/React.createElement(StatusGood, null)),
|
|
37
|
+
status: 'info'
|
|
38
|
+
};
|
|
39
|
+
return undefined;
|
|
40
|
+
}],
|
|
41
|
+
validateOn: "blur"
|
|
42
|
+
}), /*#__PURE__*/React.createElement(FormField, {
|
|
43
|
+
label: "Submit",
|
|
44
|
+
name: "submit",
|
|
45
|
+
"aria-label": "submit",
|
|
46
|
+
required: true,
|
|
47
|
+
validate: [{
|
|
48
|
+
regexp: /^[a-z]/i
|
|
49
|
+
}, function (name) {
|
|
50
|
+
if (name && name.length === 1) return 'must be >1 character';
|
|
51
|
+
return undefined;
|
|
52
|
+
}, function (name) {
|
|
53
|
+
if (name === 'good') return {
|
|
54
|
+
message: /*#__PURE__*/React.createElement(Box, {
|
|
55
|
+
align: "end"
|
|
56
|
+
}, /*#__PURE__*/React.createElement(StatusGood, null)),
|
|
57
|
+
status: 'info'
|
|
58
|
+
};
|
|
59
|
+
return undefined;
|
|
60
|
+
}],
|
|
61
|
+
validateOn: "submit"
|
|
62
|
+
}), /*#__PURE__*/React.createElement(FormField, {
|
|
63
|
+
label: "Change",
|
|
64
|
+
name: "change",
|
|
65
|
+
"aria-label": "change",
|
|
66
|
+
required: true,
|
|
67
|
+
validate: [{
|
|
68
|
+
regexp: /^[a-z]/i
|
|
69
|
+
}, function (name) {
|
|
70
|
+
if (name && name.length === 1) return 'must be >1 character';
|
|
71
|
+
return undefined;
|
|
72
|
+
}, function (name) {
|
|
73
|
+
if (name === 'good') return {
|
|
74
|
+
message: /*#__PURE__*/React.createElement(Box, {
|
|
75
|
+
align: "end"
|
|
76
|
+
}, /*#__PURE__*/React.createElement(StatusGood, null)),
|
|
77
|
+
status: 'info'
|
|
78
|
+
};
|
|
79
|
+
return undefined;
|
|
80
|
+
}],
|
|
81
|
+
validateOn: "change"
|
|
82
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
83
|
+
direction: "row",
|
|
84
|
+
justify: "between",
|
|
85
|
+
margin: {
|
|
86
|
+
top: 'medium'
|
|
87
|
+
}
|
|
88
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
89
|
+
label: "Cancel"
|
|
90
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
91
|
+
type: "reset",
|
|
92
|
+
label: "Reset"
|
|
93
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
94
|
+
type: "submit",
|
|
95
|
+
label: "Update",
|
|
96
|
+
primary: true
|
|
97
|
+
})))));
|
|
98
|
+
};
|
|
99
|
+
TriggerValidationUsingFormField.storyName = 'Trigger Validation using Form Field';
|
|
100
|
+
export default {
|
|
101
|
+
title: 'Input/Form/Trigger Validation using Form Field'
|
|
102
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _excluded = ["error", "info", "message", "type"],
|
|
2
2
|
_excluded2 = ["component", "disabled", "invalid", "name", "onChange"],
|
|
3
|
-
_excluded3 = ["children", "className", "component", "contentProps", "disabled", "error", "help", "htmlFor", "info", "label", "margin", "name", "onBlur", "onChange", "onFocus", "pad", "required", "style", "validate"];
|
|
3
|
+
_excluded3 = ["children", "className", "component", "contentProps", "disabled", "error", "help", "htmlFor", "info", "label", "margin", "name", "onBlur", "onChange", "onFocus", "pad", "required", "style", "validate", "validateOn"];
|
|
4
4
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
6
|
import React, { Children, cloneElement, forwardRef, useContext, useState, useEffect } from 'react';
|
|
@@ -153,6 +153,7 @@ var FormField = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
153
153
|
required = _ref3.required,
|
|
154
154
|
style = _ref3.style,
|
|
155
155
|
validate = _ref3.validate,
|
|
156
|
+
validateOn = _ref3.validateOn,
|
|
156
157
|
rest = _objectWithoutPropertiesLoose(_ref3, _excluded3);
|
|
157
158
|
var theme = useContext(ThemeContext) || defaultProps.theme;
|
|
158
159
|
var formContext = useContext(FormContext);
|
|
@@ -162,7 +163,8 @@ var FormField = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
162
163
|
info: infoProp,
|
|
163
164
|
name: name,
|
|
164
165
|
required: required,
|
|
165
|
-
validate: validate
|
|
166
|
+
validate: validate,
|
|
167
|
+
validateOn: validateOn
|
|
166
168
|
}),
|
|
167
169
|
error = _formContext$useFormF.error,
|
|
168
170
|
info = _formContext$useFormF.info,
|
|
@@ -332,7 +334,6 @@ var FormField = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
332
334
|
return /*#__PURE__*/React.createElement(FormFieldBox, _extends({
|
|
333
335
|
ref: formFieldRef,
|
|
334
336
|
className: className,
|
|
335
|
-
flex: false,
|
|
336
337
|
background: outerBackground,
|
|
337
338
|
margin: abut ? abutMargin : margin || _extends({}, formFieldTheme.margin)
|
|
338
339
|
}, outerProps, {
|
|
@@ -28,7 +28,8 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
28
28
|
// regular expression
|
|
29
29
|
message: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
30
30
|
status: PropTypes.oneOf(['error', 'info'])
|
|
31
|
-
}), PropTypes.func]))])
|
|
31
|
+
}), PropTypes.func]))]),
|
|
32
|
+
validateOn: PropTypes.oneOf(['blur', 'submit', 'change'])
|
|
32
33
|
};
|
|
33
34
|
}
|
|
34
35
|
export var FormFieldPropTypes = PropType;
|
|
@@ -205,6 +205,7 @@ var InfiniteScroll = function InfiniteScroll(_ref) {
|
|
|
205
205
|
while (replace && i <= lastPage) {
|
|
206
206
|
if (!pageHeights[i] && pageHeights[i] !== pageHeights[0]) {
|
|
207
207
|
if (!nextPageHeights) nextPageHeights = [].concat(pageHeights || []);
|
|
208
|
+
// set to first page height
|
|
208
209
|
var _nextPageHeights = nextPageHeights;
|
|
209
210
|
nextPageHeights[i] = _nextPageHeights[0];
|
|
210
211
|
}
|
|
@@ -54,7 +54,7 @@ var Layer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
54
54
|
}
|
|
55
55
|
setTimeout(function () {
|
|
56
56
|
// we add the id and query here so the unit tests work
|
|
57
|
-
var clone = containerTarget
|
|
57
|
+
var clone = containerTarget.getRootNode().getElementById('layerClone');
|
|
58
58
|
if (clone) {
|
|
59
59
|
containerTarget.removeChild(clone);
|
|
60
60
|
layerContainer.remove();
|
|
@@ -104,8 +104,8 @@ var LayerContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
104
104
|
var onClickDocument = function onClickDocument(event) {
|
|
105
105
|
// determine which portal id the target is in, if any
|
|
106
106
|
var clickedPortalId = null;
|
|
107
|
-
var node =
|
|
108
|
-
while (clickedPortalId === null && node !== document && node
|
|
107
|
+
var node = event.composed && event.composedPath()[0] || event.target;
|
|
108
|
+
while (clickedPortalId === null && node && node !== document && !(node instanceof ShadowRoot)) {
|
|
109
109
|
// check if user click occurred within the layer
|
|
110
110
|
var attr = node.getAttribute('data-g-portal-id');
|
|
111
111
|
if (attr !== null && attr !== '') clickedPortalId = parseInt(attr, 10);
|
|
@@ -43,7 +43,7 @@ export interface ListProps<ListItemType> {
|
|
|
43
43
|
| string[]
|
|
44
44
|
| { light: string | string[]; dark: string | string[] };
|
|
45
45
|
border?: BorderType;
|
|
46
|
-
children?:
|
|
46
|
+
children?: (...args: any[]) => any;
|
|
47
47
|
data?: ListItemType[];
|
|
48
48
|
disabled?: string[];
|
|
49
49
|
gridArea?: GridAreaType;
|
|
@@ -69,7 +69,7 @@ export interface ListProps<ListItemType> {
|
|
|
69
69
|
action?: (item: ListItemType, index: number) => void;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
type ulProps = JSX.IntrinsicElements['ul']
|
|
72
|
+
type ulProps = Omit<JSX.IntrinsicElements['ul'], 'children'>;
|
|
73
73
|
|
|
74
74
|
export interface ListExtendedProps<ListItemType>
|
|
75
75
|
extends ListProps<ListItemType>,
|
|
@@ -9,7 +9,7 @@ import { Button } from '../Button';
|
|
|
9
9
|
import { Drop } from '../Drop';
|
|
10
10
|
import { FormContext } from '../Form/FormContext';
|
|
11
11
|
import { Keyboard } from '../Keyboard';
|
|
12
|
-
import { sizeStyle, useForwardedRef } from '../../utils';
|
|
12
|
+
import { sizeStyle, useForwardedRef, useSizedIcon } from '../../utils';
|
|
13
13
|
import { StyledMaskedInput, StyledMaskedInputContainer, StyledIcon } from './StyledMaskedInput';
|
|
14
14
|
import { MaskedInputPropTypes } from './propTypes';
|
|
15
15
|
var parseValue = function parseValue(mask, value) {
|
|
@@ -320,12 +320,13 @@ var MaskedInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
320
320
|
return item.placeholder || item.fixed;
|
|
321
321
|
}).join('');
|
|
322
322
|
};
|
|
323
|
+
var maskedInputIcon = useSizedIcon(icon, rest.size, theme);
|
|
323
324
|
return /*#__PURE__*/React.createElement(StyledMaskedInputContainer, {
|
|
324
325
|
plain: plain
|
|
325
|
-
},
|
|
326
|
+
}, maskedInputIcon && /*#__PURE__*/React.createElement(StyledIcon, {
|
|
326
327
|
reverse: reverse,
|
|
327
328
|
theme: theme
|
|
328
|
-
},
|
|
329
|
+
}, maskedInputIcon), /*#__PURE__*/React.createElement(Keyboard, {
|
|
329
330
|
onEsc: onEsc,
|
|
330
331
|
onTab: showDrop ? function () {
|
|
331
332
|
return setShowDrop(false);
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
import { disabledStyle, getInputPadBySide, inputStyle, plainInputStyle, textAlignStyle } from '../../utils';
|
|
3
|
+
import { inputPadForIcon } from '../../utils/styles';
|
|
3
4
|
export var StyledMaskedInput = styled.input.withConfig({
|
|
4
5
|
displayName: "StyledMaskedInput",
|
|
5
6
|
componentId: "sc-99vkfa-0"
|
|
6
7
|
})(["", " ", " ", " ", " ", " ", ";"], inputStyle, function (props) {
|
|
7
8
|
return props.plain && plainInputStyle;
|
|
8
9
|
}, function (props) {
|
|
9
|
-
return props.icon &&
|
|
10
|
+
return props.icon && inputPadForIcon;
|
|
10
11
|
}, function (props) {
|
|
11
12
|
return props.disabled && disabledStyle(props.theme.maskedInput.disabled && props.theme.maskedInput.disabled.opacity);
|
|
12
13
|
}, function (props) {
|
|
@@ -47,9 +47,9 @@ var NameValueList = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
47
47
|
}, /*#__PURE__*/React.createElement(Grid, _extends({
|
|
48
48
|
as: "dl",
|
|
49
49
|
ref: ref,
|
|
50
|
+
align: align,
|
|
50
51
|
columns: columns,
|
|
51
52
|
gap: gap,
|
|
52
|
-
fill: layout === 'grid',
|
|
53
53
|
margin: "none" // override browser default margin for dl
|
|
54
54
|
}, rest)));
|
|
55
55
|
});
|
|
@@ -50,7 +50,7 @@ var NotificationAnchor = styled(Anchor).withConfig({
|
|
|
50
50
|
componentId: "sc-1yq09yz-0"
|
|
51
51
|
})(["white-space:nowrap;"]);
|
|
52
52
|
var Notification = function Notification(_ref) {
|
|
53
|
-
var _theme$notification, _theme$notification2, _theme$notification2$, _theme$notification2$2, _theme$notification3, _theme$notification3$, _theme$notification4, _theme$notification4$, _theme$notification4$2
|
|
53
|
+
var _theme$notification, _theme$notification2, _theme$notification2$, _theme$notification2$2, _theme$notification3, _theme$notification3$, _theme$notification4, _theme$notification4$, _theme$notification4$2, _theme$notification5, _theme$notification5$;
|
|
54
54
|
var actionsProp = _ref.actions,
|
|
55
55
|
messageProp = _ref.message,
|
|
56
56
|
onClose = _ref.onClose,
|
|
@@ -133,6 +133,7 @@ var Notification = function Notification(_ref) {
|
|
|
133
133
|
right: 'xsmall'
|
|
134
134
|
}
|
|
135
135
|
}, message), actions) : message;
|
|
136
|
+
var iconDimension = ((_theme$notification5 = theme.notification) == null ? void 0 : (_theme$notification5$ = _theme$notification5.message) == null ? void 0 : _theme$notification5$.size) || 'medium';
|
|
136
137
|
var content = /*#__PURE__*/React.createElement(Box, _extends({}, theme.notification.container, global ? _extends({}, theme.notification.global.container) : {}, toast ? _extends({}, theme.notification.toast.container) : {}, {
|
|
137
138
|
background: background
|
|
138
139
|
// let internal box control pad
|
|
@@ -146,7 +147,8 @@ var Notification = function Notification(_ref) {
|
|
|
146
147
|
pad: textPad,
|
|
147
148
|
flex: true
|
|
148
149
|
}, /*#__PURE__*/React.createElement(Box, theme.notification.iconContainer, icon || /*#__PURE__*/React.createElement(StatusIcon, {
|
|
149
|
-
color: color
|
|
150
|
+
color: color,
|
|
151
|
+
height: iconDimension
|
|
150
152
|
})), /*#__PURE__*/React.createElement(Box, theme.notification.textContainer, /*#__PURE__*/React.createElement(TextWrapper, null, title && /*#__PURE__*/React.createElement(Text, theme.notification.title, title), message && title && direction === 'row' && /*#__PURE__*/React.createElement(React.Fragment, null, "\xA0"), message))), onClose &&
|
|
151
153
|
/*#__PURE__*/
|
|
152
154
|
// theme.notification.container and textContainer may both have pad,
|
|
@@ -155,7 +157,9 @@ var Notification = function Notification(_ref) {
|
|
|
155
157
|
pad: closeButtonPad
|
|
156
158
|
}, /*#__PURE__*/React.createElement(Box, theme.notification.textContainer, /*#__PURE__*/React.createElement(Button, {
|
|
157
159
|
icon: /*#__PURE__*/React.createElement(CloseIcon, {
|
|
158
|
-
color: closeIconColor
|
|
160
|
+
color: closeIconColor,
|
|
161
|
+
height: iconDimension,
|
|
162
|
+
width: iconDimension
|
|
159
163
|
}),
|
|
160
164
|
onClick: close,
|
|
161
165
|
hoverIndicator: true,
|
|
@@ -9,9 +9,11 @@ import { Heading } from '../Heading';
|
|
|
9
9
|
import { Grid } from '../Grid';
|
|
10
10
|
import { Paragraph } from '../Paragraph';
|
|
11
11
|
import { ResponsiveContext } from '../../contexts/ResponsiveContext';
|
|
12
|
-
var sizeStyle = function sizeStyle(size, feature, theme) {
|
|
13
|
-
var _ref, _theme$pageHeader$siz;
|
|
14
|
-
var style = _extends({}, theme.pageHeader[feature], (_ref = size && ((_theme$pageHeader$siz = theme.pageHeader.size[size]) == null ? void 0 : _theme$pageHeader$siz[feature])) != null ? _ref : theme.pageHeader[feature])
|
|
12
|
+
var sizeStyle = function sizeStyle(size, feature, theme, breakpoint) {
|
|
13
|
+
var _ref, _theme$pageHeader$siz, _theme$global$breakpo, _theme$global$breakpo2;
|
|
14
|
+
var style = _extends({}, theme.pageHeader[feature], (_ref = size && ((_theme$pageHeader$siz = theme.pageHeader.size[size]) == null ? void 0 : _theme$pageHeader$siz[feature])) != null ? _ref : theme.pageHeader[feature], (!size || size === 'medium') && feature === 'subtitle' && ((_theme$global$breakpo = theme.global.breakpoints[breakpoint]) == null ? void 0 : _theme$global$breakpo.value) <= ((_theme$global$breakpo2 = theme.global.breakpoints.small) == null ? void 0 : _theme$global$breakpo2.value) && {
|
|
15
|
+
size: 'medium'
|
|
16
|
+
});
|
|
15
17
|
return style;
|
|
16
18
|
};
|
|
17
19
|
var PageHeader = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
@@ -53,7 +55,7 @@ var PageHeader = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
53
55
|
gridArea: "title"
|
|
54
56
|
}, typeof title === 'string' ? /*#__PURE__*/React.createElement(Heading, sizeStyle(size, 'title', theme), title) : title), /*#__PURE__*/React.createElement(Box, {
|
|
55
57
|
gridArea: "subtitle"
|
|
56
|
-
}, typeof subtitle === 'string' ? /*#__PURE__*/React.createElement(Paragraph, sizeStyle(size, 'subtitle', theme), subtitle) : subtitle), /*#__PURE__*/React.createElement(Box, _extends({
|
|
58
|
+
}, typeof subtitle === 'string' ? /*#__PURE__*/React.createElement(Paragraph, sizeStyle(size, 'subtitle', theme, breakpoint), subtitle) : subtitle), /*#__PURE__*/React.createElement(Box, _extends({
|
|
57
59
|
gridArea: "actions"
|
|
58
60
|
}, actionsProps), actions)));
|
|
59
61
|
});
|
|
@@ -6,7 +6,9 @@ var sizeStyle = function sizeStyle(props) {
|
|
|
6
6
|
return style ? {
|
|
7
7
|
content: {
|
|
8
8
|
fontSize: style.font && style.font.size,
|
|
9
|
-
|
|
9
|
+
// fix for safari, apply line-height 0 on next/previous
|
|
10
|
+
// icon-only buttons
|
|
11
|
+
lineHeight: style.font && props.hasLabel ? style.font.height : 0
|
|
10
12
|
},
|
|
11
13
|
container: {
|
|
12
14
|
height: style.height,
|
|
@@ -31,9 +31,9 @@ var Paragraph = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
31
31
|
colorProp: color,
|
|
32
32
|
fillProp: fill,
|
|
33
33
|
size: size
|
|
34
|
-
}, rest), /*#__PURE__*/React.createElement(TextContext.Provider, {
|
|
34
|
+
}, rest), children !== undefined ? /*#__PURE__*/React.createElement(TextContext.Provider, {
|
|
35
35
|
value: textContextValue
|
|
36
|
-
}, children));
|
|
36
|
+
}, children) : undefined);
|
|
37
37
|
});
|
|
38
38
|
Paragraph.displayName = 'Paragraph';
|
|
39
39
|
Paragraph.prototype = ParagraphPropTypes;
|
|
@@ -12,7 +12,11 @@ export var All = function All() {
|
|
|
12
12
|
color: "status-critical"
|
|
13
13
|
}, "This is an error message."), /*#__PURE__*/React.createElement(Paragraph, {
|
|
14
14
|
fill: true
|
|
15
|
-
}, "This is a full-width paragraph, using the \"fill\" property:", ' ', paragraphFiller)
|
|
15
|
+
}, "This is a full-width paragraph, using the \"fill\" property:", ' ', paragraphFiller), /*#__PURE__*/React.createElement(Paragraph, {
|
|
16
|
+
dangerouslySetInnerHTML: {
|
|
17
|
+
__html: 'This is a dangerouslySetInnerHTML!'
|
|
18
|
+
}
|
|
19
|
+
}));
|
|
16
20
|
};
|
|
17
21
|
export default {
|
|
18
22
|
title: 'Type/Paragraph/All'
|
|
@@ -38,7 +38,7 @@ var SelectMultiple = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
38
38
|
defaultValue = _ref.defaultValue,
|
|
39
39
|
disabled = _ref.disabled,
|
|
40
40
|
disabledKey = _ref.disabledKey,
|
|
41
|
-
|
|
41
|
+
dropAlignProp = _ref.dropAlign,
|
|
42
42
|
dropHeight = _ref.dropHeight,
|
|
43
43
|
dropProps = _ref.dropProps,
|
|
44
44
|
dropTarget = _ref.dropTarget,
|
|
@@ -86,6 +86,16 @@ var SelectMultiple = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
86
86
|
var selectBoxRef = useRef();
|
|
87
87
|
var dropButtonRef = useForwardedRef(ref);
|
|
88
88
|
var usingKeyboard = useKeyboard();
|
|
89
|
+
var dropAlign = useMemo(function () {
|
|
90
|
+
return dropAlignProp || (showSelectedInline ? {
|
|
91
|
+
top: 'top',
|
|
92
|
+
right: 'right',
|
|
93
|
+
left: 'left'
|
|
94
|
+
} : {
|
|
95
|
+
top: 'bottom',
|
|
96
|
+
left: 'left'
|
|
97
|
+
});
|
|
98
|
+
}, [dropAlignProp, showSelectedInline]);
|
|
89
99
|
|
|
90
100
|
// value is used for what we receive in valueProp and the basis for
|
|
91
101
|
// what we send with onChange
|
|
@@ -270,6 +280,16 @@ var SelectMultiple = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
270
280
|
return undefined;
|
|
271
281
|
}, [labelKey, messages, format, optionIndexesInValue, allOptions, selectValue]);
|
|
272
282
|
var iconColor = getIconColor(theme);
|
|
283
|
+
var displaySelectIcon = SelectIcon && /*#__PURE__*/React.createElement(Box, {
|
|
284
|
+
alignSelf: "center",
|
|
285
|
+
margin: theme.select.icons.margin,
|
|
286
|
+
width: {
|
|
287
|
+
min: 'auto'
|
|
288
|
+
}
|
|
289
|
+
}, /*#__PURE__*/isValidElement(SelectIcon) ? SelectIcon : /*#__PURE__*/React.createElement(SelectIcon, {
|
|
290
|
+
color: iconColor,
|
|
291
|
+
size: size
|
|
292
|
+
}));
|
|
273
293
|
var dropContent = /*#__PURE__*/React.createElement(SelectMultipleContainer, {
|
|
274
294
|
allOptions: allOptions,
|
|
275
295
|
disabled: disabled,
|
|
@@ -277,6 +297,7 @@ var SelectMultiple = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
277
297
|
dropHeight: dropHeight,
|
|
278
298
|
emptySearchMessage: emptySearchMessage,
|
|
279
299
|
help: help,
|
|
300
|
+
icon: displaySelectIcon,
|
|
280
301
|
id: id,
|
|
281
302
|
labelKey: labelKey,
|
|
282
303
|
limit: limit,
|
|
@@ -319,16 +340,6 @@ var SelectMultiple = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
319
340
|
dropContent: dropContent,
|
|
320
341
|
theme: theme
|
|
321
342
|
};
|
|
322
|
-
var displaySelectIcon = SelectIcon && /*#__PURE__*/React.createElement(Box, {
|
|
323
|
-
alignSelf: "center",
|
|
324
|
-
margin: theme.select.icons.margin,
|
|
325
|
-
width: {
|
|
326
|
-
min: 'auto'
|
|
327
|
-
}
|
|
328
|
-
}, /*#__PURE__*/isValidElement(SelectIcon) ? SelectIcon : /*#__PURE__*/React.createElement(SelectIcon, {
|
|
329
|
-
color: iconColor,
|
|
330
|
-
size: size
|
|
331
|
-
}));
|
|
332
343
|
return /*#__PURE__*/React.createElement(Keyboard, {
|
|
333
344
|
onDown: onRequestOpen,
|
|
334
345
|
onUp: onRequestOpen
|
|
@@ -348,11 +359,7 @@ var SelectMultiple = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
348
359
|
fill: "horizontal",
|
|
349
360
|
alignSelf: "start"
|
|
350
361
|
}, dropButtonProps, {
|
|
351
|
-
dropAlign: dropAlign
|
|
352
|
-
top: 'top',
|
|
353
|
-
right: 'right',
|
|
354
|
-
left: 'left'
|
|
355
|
-
},
|
|
362
|
+
dropAlign: dropAlign,
|
|
356
363
|
dropTarget: dropTarget || selectBoxRef.current
|
|
357
364
|
}), selectValue || displayLabelKey ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, {
|
|
358
365
|
direction: "row"
|
|
@@ -395,10 +402,7 @@ var SelectMultiple = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
395
402
|
}, rest)), displaySelectIcon)), !open && (value == null ? void 0 : value.length) > 0 && (selectValue || displayLabelKey))) : /*#__PURE__*/React.createElement(Box, {
|
|
396
403
|
width: width
|
|
397
404
|
}, /*#__PURE__*/React.createElement(StyledSelectDropButton, _extends({}, dropButtonProps, {
|
|
398
|
-
dropAlign: dropAlign
|
|
399
|
-
top: 'bottom',
|
|
400
|
-
left: 'left'
|
|
401
|
-
},
|
|
405
|
+
dropAlign: dropAlign,
|
|
402
406
|
dropTarget: dropTarget,
|
|
403
407
|
alignSelf: alignSelf,
|
|
404
408
|
tabIndex: "0"
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
import React, { forwardRef, useCallback, useContext, useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { ThemeContext } from 'styled-components';
|
|
4
|
-
import { FormUp } from 'grommet-icons/icons/FormUp';
|
|
5
4
|
import { setFocusWithoutScroll } from '../../utils';
|
|
6
5
|
import { defaultProps } from '../../default-props';
|
|
7
6
|
import { Box } from '../Box';
|
|
@@ -26,6 +25,7 @@ var SelectMultipleContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
26
25
|
_ref$emptySearchMessa = _ref.emptySearchMessage,
|
|
27
26
|
emptySearchMessage = _ref$emptySearchMessa === void 0 ? 'No matches found' : _ref$emptySearchMessa,
|
|
28
27
|
help = _ref.help,
|
|
28
|
+
icon = _ref.icon,
|
|
29
29
|
id = _ref.id,
|
|
30
30
|
labelKey = _ref.labelKey,
|
|
31
31
|
limit = _ref.limit,
|
|
@@ -258,21 +258,26 @@ var SelectMultipleContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
258
258
|
value: value,
|
|
259
259
|
valueKey: valueKey
|
|
260
260
|
});
|
|
261
|
+
var helpContent;
|
|
262
|
+
if (help) {
|
|
263
|
+
if (typeof help === 'string') helpContent = /*#__PURE__*/React.createElement(Box, {
|
|
264
|
+
flex: false,
|
|
265
|
+
pad: "xsmall"
|
|
266
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
267
|
+
size: "small"
|
|
268
|
+
}, help));else helpContent = /*#__PURE__*/React.createElement(Box, {
|
|
269
|
+
flex: false
|
|
270
|
+
}, help);
|
|
271
|
+
}
|
|
261
272
|
if (showSelectedInline) summaryContent = /*#__PURE__*/React.createElement(Box, {
|
|
262
273
|
direction: "row",
|
|
263
274
|
justify: "between",
|
|
264
275
|
flex: false
|
|
265
|
-
}, summaryContent, /*#__PURE__*/React.createElement(Button, {
|
|
276
|
+
}, summaryContent, /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Button, {
|
|
277
|
+
fill: "vertical",
|
|
266
278
|
onClick: onClose,
|
|
267
279
|
a11yTitle: "Close Select"
|
|
268
|
-
},
|
|
269
|
-
fill: true,
|
|
270
|
-
alignSelf: "start",
|
|
271
|
-
pad: {
|
|
272
|
-
right: 'small',
|
|
273
|
-
top: 'small'
|
|
274
|
-
}
|
|
275
|
-
}, /*#__PURE__*/React.createElement(FormUp, null))));
|
|
280
|
+
}, icon)));
|
|
276
281
|
return /*#__PURE__*/React.createElement(Keyboard, {
|
|
277
282
|
onEnter: onSelectOption,
|
|
278
283
|
onSpace: onSelectOption,
|
|
@@ -307,9 +312,7 @@ var SelectMultipleContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
307
312
|
setActiveIndex(-1);
|
|
308
313
|
onSearch(nextSearch);
|
|
309
314
|
}
|
|
310
|
-
}))), /*#__PURE__*/React.createElement(
|
|
311
|
-
flex: false
|
|
312
|
-
}, help), /*#__PURE__*/React.createElement(OptionsContainer, {
|
|
315
|
+
}))), helpContent, /*#__PURE__*/React.createElement(OptionsContainer, {
|
|
313
316
|
role: "listbox",
|
|
314
317
|
tabIndex: "0",
|
|
315
318
|
ref: optionsRef,
|
|
@@ -54,7 +54,7 @@ var SelectMultipleValue = function SelectMultipleValue(_ref) {
|
|
|
54
54
|
onSelectChange(event, {
|
|
55
55
|
option: optionValue,
|
|
56
56
|
value: intermediate.filter(function (v) {
|
|
57
|
-
return typeof v === 'object' ? applyKey(v, valueKey || labelKey)
|
|
57
|
+
return typeof v === 'object' ? applyKey(v, valueKey || labelKey) !== applyKey(optionValue, valueKey || labelKey) : v !== optionValue;
|
|
58
58
|
})
|
|
59
59
|
});
|
|
60
60
|
if (valueIndex !== intermediate.length - 1) {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Box } from 'grommet';
|
|
3
|
+
import { SelectMultiple } from '../SelectMultiple';
|
|
4
|
+
var options = ['Apple', 'Orange', 'Banana', 'Grape', 'Melon', 'Strawberry', 'Kiwi', 'Mango', 'Raspberry', 'Rhubarb'];
|
|
5
|
+
export var Help = function Help() {
|
|
6
|
+
var _useState = useState([]),
|
|
7
|
+
valueMultiple = _useState[0],
|
|
8
|
+
setValueMultiple = _useState[1];
|
|
9
|
+
return (
|
|
10
|
+
/*#__PURE__*/
|
|
11
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
12
|
+
// <Grommet theme={...}>
|
|
13
|
+
React.createElement(Box, {
|
|
14
|
+
fill: true,
|
|
15
|
+
align: "center",
|
|
16
|
+
pad: "large",
|
|
17
|
+
gap: "large"
|
|
18
|
+
}, /*#__PURE__*/React.createElement(SelectMultiple, {
|
|
19
|
+
value: valueMultiple,
|
|
20
|
+
placeholder: "Select",
|
|
21
|
+
options: options,
|
|
22
|
+
help: "something helpful",
|
|
23
|
+
onChange: function onChange(_ref) {
|
|
24
|
+
var value = _ref.value;
|
|
25
|
+
return setValueMultiple(value);
|
|
26
|
+
}
|
|
27
|
+
}))
|
|
28
|
+
// </Grommet>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
Help.parameters = {
|
|
33
|
+
chromatic: {
|
|
34
|
+
disable: true
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
Help.args = {
|
|
38
|
+
full: true
|
|
39
|
+
};
|
|
40
|
+
export default {
|
|
41
|
+
title: 'Input/SelectMultiple/Help'
|
|
42
|
+
};
|
|
@@ -60,9 +60,9 @@ var Text = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
60
60
|
size: size
|
|
61
61
|
}, rest, {
|
|
62
62
|
ref: textRef
|
|
63
|
-
}), /*#__PURE__*/React.createElement(TextContext.Provider, {
|
|
63
|
+
}), children !== undefined ? /*#__PURE__*/React.createElement(TextContext.Provider, {
|
|
64
64
|
value: textContextValue
|
|
65
|
-
}, children));
|
|
65
|
+
}, children) : undefined);
|
|
66
66
|
if (tipProp || textTruncated) {
|
|
67
67
|
// place the text content in a tip if truncate === 'tip'
|
|
68
68
|
// and the text has been truncated
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
import { disabledStyle, getInputPadBySide, inputStyle, parseMetricToNum, plainInputStyle, textAlignStyle, widthStyle } from '../../utils';
|
|
3
3
|
import { defaultProps } from '../../default-props';
|
|
4
|
+
import { inputPadForIcon } from '../../utils/styles';
|
|
4
5
|
var getPlainStyle = function getPlainStyle(plain) {
|
|
5
6
|
if (plain === 'full') {
|
|
6
7
|
return css(["", " padding:0;"], plainInputStyle);
|
|
@@ -13,7 +14,7 @@ var StyledTextInput = styled.input.withConfig({
|
|
|
13
14
|
})(["", " ", " ", " ", " ", " ", " ", ";"], inputStyle, function (props) {
|
|
14
15
|
return getPlainStyle(props.plain);
|
|
15
16
|
}, function (props) {
|
|
16
|
-
return props.icon &&
|
|
17
|
+
return props.icon && inputPadForIcon;
|
|
17
18
|
}, function (props) {
|
|
18
19
|
return props.disabled && disabledStyle(props.theme.textInput.disabled && props.theme.textInput.disabled.opacity);
|
|
19
20
|
}, function (props) {
|
|
@@ -11,7 +11,7 @@ import { InfiniteScroll } from '../InfiniteScroll';
|
|
|
11
11
|
import { Keyboard } from '../Keyboard';
|
|
12
12
|
import { FormContext } from '../Form/FormContext';
|
|
13
13
|
import { AnnounceContext } from '../../contexts';
|
|
14
|
-
import { isNodeAfterScroll, isNodeBeforeScroll, sizeStyle, useForwardedRef } from '../../utils';
|
|
14
|
+
import { isNodeAfterScroll, isNodeBeforeScroll, sizeStyle, useForwardedRef, useSizedIcon } from '../../utils';
|
|
15
15
|
import { StyledTextInput, StyledTextInputContainer, StyledPlaceholder, StyledIcon, StyledSuggestions } from './StyledTextInput';
|
|
16
16
|
import { MessageContext } from '../../contexts/MessageContext';
|
|
17
17
|
import { TextInputPropTypes } from './propTypes';
|
|
@@ -345,12 +345,13 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
345
345
|
// otherwise we only listen to onDown on the input element itself,
|
|
346
346
|
// primarily for tests.
|
|
347
347
|
|
|
348
|
+
var textInputIcon = useSizedIcon(icon, rest.size, theme);
|
|
348
349
|
return /*#__PURE__*/React.createElement(StyledTextInputContainer, {
|
|
349
350
|
plain: plain
|
|
350
|
-
}, showStyledPlaceholder && /*#__PURE__*/React.createElement(StyledPlaceholder, null, placeholder),
|
|
351
|
+
}, showStyledPlaceholder && /*#__PURE__*/React.createElement(StyledPlaceholder, null, placeholder), textInputIcon && /*#__PURE__*/React.createElement(StyledIcon, {
|
|
351
352
|
reverse: reverse,
|
|
352
353
|
theme: theme
|
|
353
|
-
},
|
|
354
|
+
}, textInputIcon), /*#__PURE__*/React.createElement(Keyboard, _extends({
|
|
354
355
|
target: focus ? 'document' : undefined
|
|
355
356
|
}, keyboardProps), /*#__PURE__*/React.createElement(StyledTextInput, _extends({
|
|
356
357
|
"aria-label": a11yTitle,
|
|
@@ -25,6 +25,7 @@ export * from './DataSort';
|
|
|
25
25
|
export * from './DataSummary';
|
|
26
26
|
export * from './DataTable';
|
|
27
27
|
export * from './DataTableColumns';
|
|
28
|
+
export * from './DataTableGroupBy';
|
|
28
29
|
export * from './DataView';
|
|
29
30
|
export * from './DateInput';
|
|
30
31
|
export * from './Diagram';
|
package/es6/components/index.js
CHANGED
|
@@ -25,6 +25,7 @@ export * from './DataSort';
|
|
|
25
25
|
export * from './DataSummary';
|
|
26
26
|
export * from './DataTable';
|
|
27
27
|
export * from './DataTableColumns';
|
|
28
|
+
export * from './DataTableGroupBy';
|
|
28
29
|
export * from './DataView';
|
|
29
30
|
export * from './DateInput';
|
|
30
31
|
export * from './Diagram';
|