grommet 2.32.0 → 2.32.2
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/Chart/Chart.js +113 -57
- package/components/Chart/index.d.ts +3 -0
- package/components/Chart/propTypes.js +1 -0
- package/components/Chart/stories/Layout.js +6 -3
- package/components/Chart/stories/Pattern.js +1 -0
- package/components/Chart/stories/Vertical.js +41 -0
- package/components/Chart/utils.js +57 -10
- package/components/CheckBox/StyledCheckBox.js +2 -2
- package/components/Data/Data.js +2 -1
- package/components/Data/filter.js +10 -7
- package/components/DataFilter/DataFilter.js +26 -21
- package/components/DataTable/GroupedBody.js +1 -1
- package/components/DataTable/buildState.js +1 -1
- package/components/Drop/DropContainer.js +3 -2
- package/components/Layer/LayerContainer.js +1 -1
- package/components/Meter/Bar.js +5 -2
- package/components/Meter/Meter.js +11 -3
- package/components/Meter/StyledMeter.js +3 -1
- package/components/Meter/index.d.ts +1 -0
- package/components/Meter/propTypes.js +1 -0
- package/components/Meter/stories/ReverseBar.js +29 -0
- package/components/Pagination/Pagination.js +3 -1
- package/components/RadioButtonGroup/RadioButtonGroup.js +19 -4
- package/components/RadioButtonGroup/stories/typescript/Simple.tsx +6 -4
- package/components/Select/EmptySearchOption.js +3 -9
- package/components/Select/SelectContainer.js +4 -4
- package/components/Select/index.d.ts +1 -1
- package/components/Select/propTypes.js +1 -1
- package/components/SelectMultiple/SelectMultipleContainer.js +4 -4
- package/components/Text/Text.js +3 -1
- package/components/index.d.ts +2 -1
- package/contexts/DataContext.js +2 -1
- package/es6/components/Chart/Chart.js +113 -57
- package/es6/components/Chart/index.d.ts +3 -0
- package/es6/components/Chart/propTypes.js +1 -0
- package/es6/components/Chart/stories/Layout.js +6 -3
- package/es6/components/Chart/stories/Pattern.js +1 -0
- package/es6/components/Chart/stories/Vertical.js +35 -0
- package/es6/components/Chart/utils.js +57 -10
- package/es6/components/CheckBox/StyledCheckBox.js +2 -2
- package/es6/components/Data/Data.js +2 -1
- package/es6/components/Data/filter.js +10 -7
- package/es6/components/DataFilter/DataFilter.js +26 -21
- package/es6/components/DataTable/GroupedBody.js +1 -1
- package/es6/components/DataTable/buildState.js +1 -1
- package/es6/components/Drop/DropContainer.js +3 -2
- package/es6/components/Layer/LayerContainer.js +1 -1
- package/es6/components/Meter/Bar.js +5 -2
- package/es6/components/Meter/Meter.js +12 -4
- package/es6/components/Meter/StyledMeter.js +3 -1
- package/es6/components/Meter/index.d.ts +1 -0
- package/es6/components/Meter/propTypes.js +1 -0
- package/es6/components/Meter/stories/ReverseBar.js +23 -0
- package/es6/components/Pagination/Pagination.js +3 -1
- package/es6/components/RadioButtonGroup/RadioButtonGroup.js +19 -4
- package/es6/components/RadioButtonGroup/stories/typescript/Simple.tsx +6 -4
- package/es6/components/Select/EmptySearchOption.js +3 -9
- package/es6/components/Select/SelectContainer.js +4 -4
- package/es6/components/Select/index.d.ts +1 -1
- package/es6/components/Select/propTypes.js +1 -1
- package/es6/components/SelectMultiple/SelectMultipleContainer.js +4 -4
- package/es6/components/Text/Text.js +3 -1
- package/es6/components/index.d.ts +2 -1
- package/es6/contexts/DataContext.js +2 -1
- package/es6/index.d.ts +11 -0
- package/es6/index.js +2 -0
- package/es6/themes/base.d.ts +4 -0
- package/es6/themes/base.js +4 -0
- package/es6/utils/index.d.ts +1 -1
- package/es6/utils/refs.js +1 -1
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/index.d.ts +11 -0
- package/index.js +1 -0
- package/package.json +36 -36
- package/themes/base.d.ts +4 -0
- package/themes/base.js +4 -0
- package/utils/index.d.ts +1 -1
- package/utils/refs.js +1 -1
|
@@ -224,7 +224,7 @@ export var buildGroupState = function buildGroupState(groups, groupBy) {
|
|
|
224
224
|
if (groups) {
|
|
225
225
|
groups.forEach(function (_ref) {
|
|
226
226
|
var key = _ref.key;
|
|
227
|
-
if (key) result[key] = {
|
|
227
|
+
if (key !== undefined) result[key] = {
|
|
228
228
|
expanded: false
|
|
229
229
|
};
|
|
230
230
|
});
|
|
@@ -81,8 +81,9 @@ var DropContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
81
81
|
}, [onClickOutside, containerTarget, portalContext]);
|
|
82
82
|
useEffect(function () {
|
|
83
83
|
var notifyAlign = function notifyAlign() {
|
|
84
|
-
var
|
|
85
|
-
var
|
|
84
|
+
var _dropRef$current;
|
|
85
|
+
var styleCurrent = dropRef == null ? void 0 : (_dropRef$current = dropRef.current) == null ? void 0 : _dropRef$current.style;
|
|
86
|
+
var alignControl = (styleCurrent == null ? void 0 : styleCurrent.top) !== '' ? 'top' : 'bottom';
|
|
86
87
|
onAlign(alignControl);
|
|
87
88
|
};
|
|
88
89
|
|
|
@@ -250,7 +250,7 @@ var LayerContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
250
250
|
// restricting scroll could inhibit the user's
|
|
251
251
|
// ability to scroll the page while the layer is open.
|
|
252
252
|
,
|
|
253
|
-
restrictScroll: !layerTarget && hitResponsiveBreakpoint ? true : undefined,
|
|
253
|
+
restrictScroll: !layerTarget && (modal || hitResponsiveBreakpoint) ? true : undefined,
|
|
254
254
|
trapFocus: true
|
|
255
255
|
}, content);
|
|
256
256
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["background", "max", "round", "size", "thickness", "direction", "values"],
|
|
1
|
+
var _excluded = ["background", "max", "round", "size", "thickness", "direction", "values", "reverse"],
|
|
2
2
|
_excluded2 = ["color", "highlight", "label", "onHover", "value"];
|
|
3
3
|
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); }
|
|
4
4
|
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; }
|
|
@@ -16,6 +16,7 @@ var Bar = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
16
16
|
thicknessProp = props.thickness,
|
|
17
17
|
direction = props.direction,
|
|
18
18
|
values = props.values,
|
|
19
|
+
reverse = props.reverse,
|
|
19
20
|
rest = _objectWithoutPropertiesLoose(props, _excluded);
|
|
20
21
|
var theme = useContext(ThemeContext) || defaultProps.theme;
|
|
21
22
|
var length = size === 'full' ? 288 : parseMetricToNum(theme.global.size[size] || size);
|
|
@@ -84,7 +85,9 @@ var Bar = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
84
85
|
round: round ? {
|
|
85
86
|
size: thicknessProp
|
|
86
87
|
} : undefined
|
|
87
|
-
}, rest
|
|
88
|
+
}, rest, {
|
|
89
|
+
reverse: reverse
|
|
90
|
+
}), /*#__PURE__*/React.createElement("path", _extends({
|
|
88
91
|
d: backgroundPath,
|
|
89
92
|
fill: "none"
|
|
90
93
|
}, strokeProps(background, theme), {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
var _excluded = ["background", "color", "direction", "size", "thickness", "type", "value", "values"];
|
|
1
|
+
var _excluded = ["background", "color", "direction", "size", "thickness", "type", "reverse", "value", "values"];
|
|
2
2
|
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); }
|
|
3
3
|
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; }
|
|
4
|
-
import React, { forwardRef, useMemo } from 'react';
|
|
4
|
+
import React, { forwardRef, useMemo, useContext } from 'react';
|
|
5
|
+
import { ThemeContext } from 'styled-components';
|
|
6
|
+
import { defaultProps } from '../../default-props';
|
|
5
7
|
import { Bar } from './Bar';
|
|
6
8
|
import { Circle } from './Circle';
|
|
7
9
|
import { MeterPropTypes } from './propTypes';
|
|
@@ -30,9 +32,12 @@ var Meter = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
30
32
|
thickness = _ref$thickness === void 0 ? 'medium' : _ref$thickness,
|
|
31
33
|
_ref$type = _ref.type,
|
|
32
34
|
type = _ref$type === void 0 ? 'bar' : _ref$type,
|
|
35
|
+
reverseProp = _ref.reverse,
|
|
33
36
|
value = _ref.value,
|
|
34
37
|
valuesProp = _ref.values,
|
|
35
38
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
39
|
+
var theme = useContext(ThemeContext) || defaultProps.theme;
|
|
40
|
+
|
|
36
41
|
// normalize values to an array of objects
|
|
37
42
|
var values = useMemo(function () {
|
|
38
43
|
if (valuesProp) return valuesProp;
|
|
@@ -42,6 +47,7 @@ var Meter = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
42
47
|
}];
|
|
43
48
|
return [];
|
|
44
49
|
}, [color, value, valuesProp]);
|
|
50
|
+
var reverse = direction === 'horizontal' && (theme.dir === 'rtl' || reverseProp) && !(theme.dir === 'rtl' && reverseProp);
|
|
45
51
|
var memoizedMax = useMemo(function () {
|
|
46
52
|
return deriveMax(values);
|
|
47
53
|
}, [values]);
|
|
@@ -54,7 +60,8 @@ var Meter = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
54
60
|
size: size,
|
|
55
61
|
thickness: thickness,
|
|
56
62
|
background: background,
|
|
57
|
-
direction: direction
|
|
63
|
+
direction: direction,
|
|
64
|
+
reverse: reverse
|
|
58
65
|
}, rest));
|
|
59
66
|
} else if (type === 'circle' || type === 'pie' || type === 'semicircle') {
|
|
60
67
|
content = /*#__PURE__*/React.createElement(Circle, _extends({
|
|
@@ -64,7 +71,8 @@ var Meter = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
64
71
|
size: size,
|
|
65
72
|
thickness: thickness,
|
|
66
73
|
type: type,
|
|
67
|
-
background: background
|
|
74
|
+
background: background,
|
|
75
|
+
reverse: reverse
|
|
68
76
|
}, rest));
|
|
69
77
|
}
|
|
70
78
|
return content;
|
|
@@ -9,7 +9,9 @@ var roundStyle = css(["border-radius:", ";"], function (props) {
|
|
|
9
9
|
var StyledMeter = styled.svg.withConfig({
|
|
10
10
|
displayName: "StyledMeter",
|
|
11
11
|
componentId: "sc-nsxarx-0"
|
|
12
|
-
})(["max-width:100%;overflow:hidden;", " ", " path{transition:stroke 0.3s,stroke-width 0.3s;}", ";"],
|
|
12
|
+
})(["max-width:100%;overflow:hidden;", " ", " ", " path{transition:stroke 0.3s,stroke-width 0.3s;}", ";"], function (props) {
|
|
13
|
+
return props.reverse && css(["transform:scale(-1,1);"]);
|
|
14
|
+
}, genericStyles, function (props) {
|
|
13
15
|
return props.round && roundStyle;
|
|
14
16
|
}, function (props) {
|
|
15
17
|
return props.theme.meter && props.theme.meter.extend;
|
|
@@ -16,6 +16,7 @@ export interface MeterProps {
|
|
|
16
16
|
gridArea?: GridAreaType;
|
|
17
17
|
margin?: MarginType;
|
|
18
18
|
max?: number;
|
|
19
|
+
reverse?: boolean;
|
|
19
20
|
round?: boolean;
|
|
20
21
|
size?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'full' | string;
|
|
21
22
|
thickness?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | string;
|
|
@@ -10,6 +10,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
10
10
|
})]),
|
|
11
11
|
color: PropTypes.string,
|
|
12
12
|
max: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
13
|
+
reverse: PropTypes.bool,
|
|
13
14
|
round: PropTypes.bool,
|
|
14
15
|
size: PropTypes.oneOfType([PropTypes.oneOf(['xsmall', 'small', 'medium', 'large', 'xlarge', 'full']), PropTypes.string]),
|
|
15
16
|
thickness: PropTypes.oneOfType([PropTypes.oneOf(['xsmall', 'small', 'medium', 'large', 'xlarge']), PropTypes.string]),
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Meter } from 'grommet';
|
|
3
|
+
export var ReverseBar = function ReverseBar() {
|
|
4
|
+
var value = 30;
|
|
5
|
+
return (
|
|
6
|
+
/*#__PURE__*/
|
|
7
|
+
// Uncomment <Grommet> lines when using outside of storybook
|
|
8
|
+
// <Grommet theme={grommet}>
|
|
9
|
+
React.createElement(Box, {
|
|
10
|
+
align: "center",
|
|
11
|
+
pad: "large"
|
|
12
|
+
}, /*#__PURE__*/React.createElement(Meter, {
|
|
13
|
+
type: "bar",
|
|
14
|
+
reverse: true,
|
|
15
|
+
value: value
|
|
16
|
+
}))
|
|
17
|
+
// </Grommet>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
title: 'Visualizations/Meter/ReverseBar'
|
|
23
|
+
};
|
|
@@ -51,7 +51,9 @@ var Pagination = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
51
51
|
activePage = _useState[0],
|
|
52
52
|
setActivePage = _useState[1];
|
|
53
53
|
useEffect(function () {
|
|
54
|
-
|
|
54
|
+
setActivePage(page);
|
|
55
|
+
var pageEvent = new Event('pagechange');
|
|
56
|
+
window.dispatchEvent(pageEvent);
|
|
55
57
|
}, [page]);
|
|
56
58
|
useEffect(function () {
|
|
57
59
|
// if we are getting the step or page from outside the view,
|
|
@@ -17,7 +17,7 @@ var RadioButtonGroup = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
17
17
|
_ref$focusIndicator = _ref.focusIndicator,
|
|
18
18
|
focusIndicator = _ref$focusIndicator === void 0 ? true : _ref$focusIndicator,
|
|
19
19
|
name = _ref.name,
|
|
20
|
-
|
|
20
|
+
onChange = _ref.onChange,
|
|
21
21
|
optionsProp = _ref.options,
|
|
22
22
|
valueProp = _ref.value,
|
|
23
23
|
gap = _ref.gap,
|
|
@@ -40,7 +40,7 @@ var RadioButtonGroup = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
40
40
|
var _formContext$useFormI = formContext.useFormInput({
|
|
41
41
|
name: name,
|
|
42
42
|
value: valueProp,
|
|
43
|
-
initialValue: defaultValue
|
|
43
|
+
initialValue: defaultValue != null ? defaultValue : ''
|
|
44
44
|
}),
|
|
45
45
|
value = _formContext$useFormI[0],
|
|
46
46
|
setValue = _formContext$useFormI[1];
|
|
@@ -90,6 +90,18 @@ var RadioButtonGroup = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
90
90
|
setFocus(true);
|
|
91
91
|
}, 1);
|
|
92
92
|
};
|
|
93
|
+
var onRadioButtonChange = function onRadioButtonChange(event, optionValue) {
|
|
94
|
+
setValue(optionValue);
|
|
95
|
+
if (onChange) {
|
|
96
|
+
event.persist(); // extract from React synthetic event pool
|
|
97
|
+
// event.target.value gives value as a string which needs to be
|
|
98
|
+
// manually typecasted according to the type of original option value.
|
|
99
|
+
// return the original option value attached with the event.
|
|
100
|
+
var adjustedEvent = event;
|
|
101
|
+
adjustedEvent.value = optionValue;
|
|
102
|
+
onChange(adjustedEvent);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
93
105
|
var onBlur = function onBlur() {
|
|
94
106
|
return setFocus(false);
|
|
95
107
|
};
|
|
@@ -116,6 +128,10 @@ var RadioButtonGroup = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
116
128
|
// when nothing has been selected, show focus
|
|
117
129
|
// on the first radiobutton
|
|
118
130
|
value === '' && index === 0;
|
|
131
|
+
if (optionRest.checked) {
|
|
132
|
+
console.warn( // eslint-disable-next-line max-len
|
|
133
|
+
"'checked' prop of an individual RadioButton shouldn't be used in a RadioButtonGroup component. Use the RadioButtonGroup 'value' prop instead.");
|
|
134
|
+
}
|
|
119
135
|
return /*#__PURE__*/React.createElement(RadioButton, _extends({
|
|
120
136
|
ref: function ref(aRef) {
|
|
121
137
|
optionRefs.current[index] = aRef;
|
|
@@ -138,8 +154,7 @@ var RadioButtonGroup = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
138
154
|
onFocus: onFocus,
|
|
139
155
|
onBlur: onBlur,
|
|
140
156
|
onChange: function onChange(event) {
|
|
141
|
-
|
|
142
|
-
if (_onChange) _onChange(event);
|
|
157
|
+
return onRadioButtonChange(event, optionValue);
|
|
143
158
|
},
|
|
144
159
|
tabIndex: focusable ? '0' : '-1' // necessary for Firefox
|
|
145
160
|
}, optionRest), children ? function (state) {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
1
|
+
import React, { ChangeEvent, useState } from 'react';
|
|
2
2
|
|
|
3
3
|
import { Box, RadioButtonGroup } from 'grommet';
|
|
4
4
|
|
|
5
|
+
type EventWithValueProp = ChangeEvent<HTMLInputElement> & {value: string | number};
|
|
6
|
+
|
|
5
7
|
export const Simple = () => {
|
|
6
8
|
const postMethods = [
|
|
7
9
|
{ label: 'FTP', value: 'FTP' },
|
|
@@ -16,8 +18,8 @@ export const Simple = () => {
|
|
|
16
18
|
];
|
|
17
19
|
|
|
18
20
|
// Type arguments can only be used in TypeScript files.
|
|
19
|
-
// Remove <string |
|
|
20
|
-
const [value, setValue] = useState<string |
|
|
21
|
+
// Remove <string | number> if you are not using Typescript.
|
|
22
|
+
const [value, setValue] = useState<string | number>(postMethods[0].value);
|
|
21
23
|
|
|
22
24
|
return (
|
|
23
25
|
<Box align="center" pad="large">
|
|
@@ -25,7 +27,7 @@ export const Simple = () => {
|
|
|
25
27
|
name="radio"
|
|
26
28
|
options={postMethods}
|
|
27
29
|
value={value}
|
|
28
|
-
onChange={(event) => setValue(event.
|
|
30
|
+
onChange={(event: EventWithValueProp) => setValue(event.value)}
|
|
29
31
|
/>
|
|
30
32
|
</Box>
|
|
31
33
|
);
|
|
@@ -2,19 +2,13 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Box } from '../Box';
|
|
4
4
|
import { Text } from '../Text';
|
|
5
|
-
import { SelectOption } from './StyledSelect';
|
|
6
5
|
export var EmptySearchOption = function EmptySearchOption(_ref) {
|
|
6
|
+
var _theme$select, _theme$select$emptySe, _theme$select2, _theme$select2$emptyS, _theme$select3, _theme$select3$option;
|
|
7
7
|
var emptySearchMessage = _ref.emptySearchMessage,
|
|
8
8
|
selectOptionsStyle = _ref.selectOptionsStyle,
|
|
9
9
|
theme = _ref.theme;
|
|
10
|
-
return /*#__PURE__*/React.createElement(
|
|
11
|
-
key: "search_empty",
|
|
12
|
-
tabIndex: "0",
|
|
13
|
-
role: "menuitem",
|
|
14
|
-
hoverIndicator: "background",
|
|
15
|
-
disabled: true
|
|
16
|
-
}, /*#__PURE__*/React.createElement(Box, selectOptionsStyle, /*#__PURE__*/React.createElement(Text, _extends({
|
|
10
|
+
return /*#__PURE__*/React.createElement(Box, (theme == null ? void 0 : (_theme$select = theme.select) == null ? void 0 : (_theme$select$emptySe = _theme$select.emptySearchMessage) == null ? void 0 : _theme$select$emptySe.container) || selectOptionsStyle, /*#__PURE__*/React.createElement(Text, _extends({
|
|
17
11
|
"aria-live": "polite",
|
|
18
12
|
role: "alert"
|
|
19
|
-
}, theme.select.
|
|
13
|
+
}, (theme == null ? void 0 : (_theme$select2 = theme.select) == null ? void 0 : (_theme$select2$emptyS = _theme$select2.emptySearchMessage) == null ? void 0 : _theme$select2$emptyS.text) || ((_theme$select3 = theme.select) == null ? void 0 : (_theme$select3$option = _theme$select3.options) == null ? void 0 : _theme$select3$option.text)), emptySearchMessage));
|
|
20
14
|
};
|
|
@@ -296,7 +296,7 @@ var SelectContainer = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
296
296
|
return setActiveIndex(-1);
|
|
297
297
|
},
|
|
298
298
|
theme: theme
|
|
299
|
-
}), /*#__PURE__*/React.createElement(OptionsContainer, {
|
|
299
|
+
}), options.length > 0 ? /*#__PURE__*/React.createElement(OptionsContainer, {
|
|
300
300
|
role: "listbox",
|
|
301
301
|
tabIndex: "-1",
|
|
302
302
|
ref: optionsRef,
|
|
@@ -304,7 +304,7 @@ var SelectContainer = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
304
304
|
onMouseMove: function onMouseMove() {
|
|
305
305
|
return setKeyboardNavigation(false);
|
|
306
306
|
}
|
|
307
|
-
},
|
|
307
|
+
}, /*#__PURE__*/React.createElement(InfiniteScroll, {
|
|
308
308
|
items: options,
|
|
309
309
|
step: theme.select.step,
|
|
310
310
|
onMore: onMore,
|
|
@@ -366,11 +366,11 @@ var SelectContainer = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
366
366
|
onClick: !optionDisabled ? selectOption(index) : undefined,
|
|
367
367
|
textComponent: textComponent
|
|
368
368
|
}, child);
|
|
369
|
-
}) : /*#__PURE__*/React.createElement(EmptySearchOption, {
|
|
369
|
+
})) : /*#__PURE__*/React.createElement(EmptySearchOption, {
|
|
370
370
|
emptySearchMessage: emptySearchMessage,
|
|
371
371
|
selectOptionsStyle: selectOptionsStyle,
|
|
372
372
|
theme: theme
|
|
373
|
-
})
|
|
373
|
+
}), shouldShowClearButton('bottom') && /*#__PURE__*/React.createElement(ClearButton, {
|
|
374
374
|
ref: clearRef,
|
|
375
375
|
clear: clear,
|
|
376
376
|
name: name,
|
|
@@ -42,7 +42,7 @@ export interface BasicSelectProps {
|
|
|
42
42
|
placeholder?: PlaceHolderType;
|
|
43
43
|
plain?: boolean;
|
|
44
44
|
replace?: boolean;
|
|
45
|
-
searchPlaceholder?:
|
|
45
|
+
searchPlaceholder?: PlaceHolderType;
|
|
46
46
|
size?: 'small' | 'medium' | 'large' | 'xlarge' | string;
|
|
47
47
|
valueKey?:
|
|
48
48
|
| string
|
|
@@ -32,7 +32,7 @@ export var genericSelectProps = _extends({}, genericProps, {
|
|
|
32
32
|
placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.node]),
|
|
33
33
|
plain: PropTypes.bool,
|
|
34
34
|
replace: PropTypes.bool,
|
|
35
|
-
searchPlaceholder: PropTypes.string,
|
|
35
|
+
searchPlaceholder: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.node]),
|
|
36
36
|
size: PropTypes.oneOfType([PropTypes.oneOf(['small', 'medium', 'large', 'xlarge']), PropTypes.string]),
|
|
37
37
|
valueLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
38
38
|
valueKey: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.shape({
|
|
@@ -312,7 +312,7 @@ var SelectMultipleContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
312
312
|
setActiveIndex(-1);
|
|
313
313
|
onSearch(nextSearch);
|
|
314
314
|
}
|
|
315
|
-
}))), helpContent, /*#__PURE__*/React.createElement(OptionsContainer, {
|
|
315
|
+
}))), helpContent, options.length > 0 ? /*#__PURE__*/React.createElement(OptionsContainer, {
|
|
316
316
|
role: "listbox",
|
|
317
317
|
tabIndex: "0",
|
|
318
318
|
ref: optionsRef,
|
|
@@ -321,7 +321,7 @@ var SelectMultipleContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
321
321
|
return setKeyboardNavigation(false);
|
|
322
322
|
},
|
|
323
323
|
"aria-activedescendant": optionsRef == null ? void 0 : (_optionsRef$current = optionsRef.current) == null ? void 0 : _optionsRef$current.children[activeIndex]
|
|
324
|
-
},
|
|
324
|
+
}, /*#__PURE__*/React.createElement(InfiniteScroll, {
|
|
325
325
|
items: options,
|
|
326
326
|
step: theme.select.step,
|
|
327
327
|
onMore: onMore,
|
|
@@ -414,11 +414,11 @@ var SelectMultipleContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
414
414
|
},
|
|
415
415
|
textComponent: textComponent
|
|
416
416
|
}, child);
|
|
417
|
-
}) : /*#__PURE__*/React.createElement(EmptySearchOption, {
|
|
417
|
+
})) : /*#__PURE__*/React.createElement(EmptySearchOption, {
|
|
418
418
|
emptySearchMessage: emptySearchMessage,
|
|
419
419
|
selectOptionsStyle: selectOptionsStyle,
|
|
420
420
|
theme: theme
|
|
421
|
-
})
|
|
421
|
+
}), usingKeyboard && showA11yLimit && /*#__PURE__*/React.createElement(Box, {
|
|
422
422
|
height: "0px",
|
|
423
423
|
width: "0px",
|
|
424
424
|
overflow: "hidden"
|
|
@@ -40,9 +40,11 @@ var Text = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
window.addEventListener('resize', updateTip);
|
|
43
|
+
window.addEventListener('pagechange', updateTip);
|
|
43
44
|
updateTip();
|
|
44
45
|
return function () {
|
|
45
|
-
|
|
46
|
+
window.removeEventListener('resize', updateTip);
|
|
47
|
+
window.removeEventListener('pagechange', updateTip);
|
|
46
48
|
};
|
|
47
49
|
}, [textRef, truncate]);
|
|
48
50
|
if (skeleton) {
|
|
@@ -85,7 +85,8 @@ export * from './Tag';
|
|
|
85
85
|
export * from './Text';
|
|
86
86
|
export * from './TextArea';
|
|
87
87
|
export * from './TextInput';
|
|
88
|
-
export * from './Tip';
|
|
89
88
|
export * from './ThumbsRating';
|
|
89
|
+
export * from './Tip';
|
|
90
|
+
export * from './Toolbar';
|
|
90
91
|
export * from './Video';
|
|
91
92
|
export * from './WorldMap';
|
package/es6/index.d.ts
CHANGED
|
@@ -10,13 +10,23 @@ export * from './components/Card';
|
|
|
10
10
|
export * from './components/CardBody';
|
|
11
11
|
export * from './components/CardFooter';
|
|
12
12
|
export * from './components/CardHeader';
|
|
13
|
+
export * from './components/Cards';
|
|
13
14
|
export * from './components/Chart';
|
|
14
15
|
export * from './components/CheckBox';
|
|
15
16
|
export * from './components/CheckBoxGroup';
|
|
16
17
|
export * from './components/Clock';
|
|
17
18
|
export * from './components/Collapsible';
|
|
19
|
+
export * from './components/Data';
|
|
18
20
|
export * from './components/DataChart';
|
|
21
|
+
export * from './components/DataFilter';
|
|
22
|
+
export * from './components/DataFilters';
|
|
23
|
+
export * from './components/DataSearch';
|
|
24
|
+
export * from './components/DataSort';
|
|
25
|
+
export * from './components/DataSummary';
|
|
19
26
|
export * from './components/DataTable';
|
|
27
|
+
export * from './components/DataTableColumns';
|
|
28
|
+
export * from './components/DataTableGroupBy';
|
|
29
|
+
export * from './components/DataView';
|
|
20
30
|
export * from './components/DateInput';
|
|
21
31
|
export * from './components/Diagram';
|
|
22
32
|
export * from './components/Distribution';
|
|
@@ -79,6 +89,7 @@ export * from './components/TextArea';
|
|
|
79
89
|
export * from './components/TextInput';
|
|
80
90
|
export * from './components/ThumbsRating';
|
|
81
91
|
export * from './components/Tip';
|
|
92
|
+
export * from './components/Toolbar';
|
|
82
93
|
export * from './components/Video';
|
|
83
94
|
export * from './components/WorldMap';
|
|
84
95
|
export * from './contexts/AnnounceContext';
|
package/es6/index.js
CHANGED
package/es6/themes/base.d.ts
CHANGED
|
@@ -1429,6 +1429,10 @@ export interface ThemeType {
|
|
|
1429
1429
|
open?: string | object;
|
|
1430
1430
|
};
|
|
1431
1431
|
extend?: ExtendType;
|
|
1432
|
+
emptySearchMessage?: {
|
|
1433
|
+
container?: BoxProps;
|
|
1434
|
+
text?: TextProps;
|
|
1435
|
+
};
|
|
1432
1436
|
icons?: {
|
|
1433
1437
|
color?: ColorType;
|
|
1434
1438
|
down?: React.ReactNode | Icon;
|
package/es6/themes/base.js
CHANGED
|
@@ -1855,6 +1855,10 @@ export var generate = function generate(baseSpacing, scale) {
|
|
|
1855
1855
|
// extend: undefined,
|
|
1856
1856
|
// open: undefined,
|
|
1857
1857
|
},
|
|
1858
|
+
// emptySearchMessage: {
|
|
1859
|
+
// container: {}, // any box props
|
|
1860
|
+
// text: {}, // any text props
|
|
1861
|
+
// },
|
|
1858
1862
|
icons: {
|
|
1859
1863
|
// color: { dark: undefined, light: undefined },
|
|
1860
1864
|
margin: {
|
package/es6/utils/index.d.ts
CHANGED