grommet 2.26.0 → 2.27.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/all/stories/AllComponents.js +19 -126
- package/components/Accordion/stories/CustomHeader.js +3 -1
- package/components/Avatar/Avatar.js +22 -9
- package/components/CheckBox/StyledCheckBox.js +9 -5
- package/components/DataChart/Detail.js +3 -1
- package/components/DataTable/index.d.ts +6 -6
- package/components/DateInput/DateInput.js +1 -1
- package/components/Diagram/Diagram.js +2 -1
- package/components/Drop/stories/Inline.js +1 -1
- package/components/Drop/stories/Overflow.js +1 -1
- package/components/Drop/stories/Plain.js +1 -1
- package/components/Drop/stories/Simple.js +1 -1
- package/components/Drop/stories/Styled.js +1 -1
- package/components/List/List.js +16 -13
- package/components/List/stories/Order.js +1 -0
- package/components/List/stories/Pinned.js +1 -0
- package/components/List/stories/Selection.js +1 -0
- package/components/List/stories/onClickItem.js +1 -0
- package/components/Notification/Notification.js +2 -2
- package/components/Notification/index.d.ts +1 -1
- package/components/Notification/propTypes.js +1 -1
- package/components/RadioButton/README.md +1 -279
- package/components/RadioButton/RadioButton.js +1 -0
- package/components/Select/Select.js +8 -4
- package/components/Select/SelectContainer.js +4 -4
- package/components/Select/utils.js +28 -2
- package/components/SelectMultiple/SelectMultiple.js +4 -4
- package/components/SelectMultiple/SelectMultipleContainer.js +10 -8
- package/components/SelectMultiple/SelectMultipleValue.js +18 -21
- package/components/SelectMultiple/SelectionSummary.js +1 -1
- package/components/SelectMultiple/stories/ObjectOptions.js +25 -1
- package/components/Sidebar/stories/Labels.js +4 -1
- package/components/TextArea/stories/NonResizable.js +1 -0
- package/components/TextArea/stories/Simple.js +1 -0
- package/es6/all/stories/AllComponents.js +21 -121
- package/es6/components/Accordion/stories/CustomHeader.js +3 -1
- package/es6/components/Avatar/Avatar.js +21 -9
- package/es6/components/CheckBox/StyledCheckBox.js +9 -5
- package/es6/components/DataChart/Detail.js +3 -1
- package/es6/components/DataTable/index.d.ts +6 -6
- package/es6/components/DateInput/DateInput.js +1 -1
- package/es6/components/Diagram/Diagram.js +2 -1
- package/es6/components/Drop/stories/Inline.js +1 -1
- package/es6/components/Drop/stories/Overflow.js +1 -1
- package/es6/components/Drop/stories/Plain.js +1 -1
- package/es6/components/Drop/stories/Simple.js +1 -1
- package/es6/components/Drop/stories/Styled.js +1 -1
- package/es6/components/List/List.js +16 -13
- package/es6/components/List/stories/Order.js +1 -0
- package/es6/components/List/stories/Pinned.js +1 -0
- package/es6/components/List/stories/Selection.js +1 -0
- package/es6/components/List/stories/onClickItem.js +1 -0
- package/es6/components/Notification/Notification.js +2 -2
- package/es6/components/Notification/index.d.ts +1 -1
- package/es6/components/Notification/propTypes.js +1 -1
- package/es6/components/RadioButton/README.md +1 -279
- package/es6/components/RadioButton/RadioButton.js +1 -0
- package/es6/components/Select/Select.js +8 -4
- package/es6/components/Select/SelectContainer.js +4 -4
- package/es6/components/Select/utils.js +21 -1
- package/es6/components/SelectMultiple/SelectMultiple.js +5 -5
- package/es6/components/SelectMultiple/SelectMultipleContainer.js +11 -9
- package/es6/components/SelectMultiple/SelectMultipleValue.js +19 -22
- package/es6/components/SelectMultiple/SelectionSummary.js +2 -2
- package/es6/components/SelectMultiple/stories/ObjectOptions.js +25 -1
- package/es6/components/Sidebar/stories/Labels.js +4 -1
- package/es6/components/TextArea/stories/NonResizable.js +1 -0
- package/es6/components/TextArea/stories/Simple.js +1 -0
- package/es6/themes/base.d.ts +8 -3
- package/es6/themes/base.js +6 -1
- package/es6/themes/hacktoberfest2022.js +129 -0
- package/es6/themes/index.js +2 -1
- package/es6/utils/background.js +4 -4
- package/es6/utils/styles.js +3 -1
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/package.json +45 -43
- package/themes/base.d.ts +8 -3
- package/themes/base.js +6 -1
- package/themes/hacktoberfest2022.js +137 -0
- package/themes/index.js +6 -2
- package/tools/grommet-babel-preset-es2015.js +1 -12
- package/tools/pack.js +1 -94
- package/tools/release-stable.js +1 -27
- package/utils/background.js +4 -4
- package/utils/styles.js +3 -1
|
@@ -9,20 +9,6 @@ var _grommet = require("grommet");
|
|
|
9
9
|
|
|
10
10
|
var _grommetIcons = require("grommet-icons");
|
|
11
11
|
|
|
12
|
-
var _themes = require("grommet/themes");
|
|
13
|
-
|
|
14
|
-
var _base = require("grommet/themes/base");
|
|
15
|
-
|
|
16
|
-
var _utils = require("grommet/utils");
|
|
17
|
-
|
|
18
|
-
var _grommetThemeHpe = require("grommet-theme-hpe");
|
|
19
|
-
|
|
20
|
-
var _grommetThemeAruba = require("grommet-theme-aruba");
|
|
21
|
-
|
|
22
|
-
var _grommetThemeHp = require("grommet-theme-hp");
|
|
23
|
-
|
|
24
|
-
var _grommetThemeDxc = require("grommet-theme-dxc");
|
|
25
|
-
|
|
26
12
|
var _excluded = ["id"],
|
|
27
13
|
_excluded2 = ["color"];
|
|
28
14
|
|
|
@@ -63,61 +49,31 @@ var connection = function connection(fromTarget, toTarget, _temp) {
|
|
|
63
49
|
}, rest);
|
|
64
50
|
};
|
|
65
51
|
|
|
66
|
-
var themes = {
|
|
67
|
-
grommet: _themes.grommet,
|
|
68
|
-
hpe: _grommetThemeHpe.hpe,
|
|
69
|
-
aruba: _grommetThemeAruba.aruba,
|
|
70
|
-
hp: _grommetThemeHp.hp,
|
|
71
|
-
dxc: _grommetThemeDxc.dxc
|
|
72
|
-
};
|
|
73
|
-
|
|
74
52
|
var Components = function Components() {
|
|
75
|
-
var _useState = (0, _react.useState)(
|
|
76
|
-
|
|
77
|
-
|
|
53
|
+
var _useState = (0, _react.useState)(true),
|
|
54
|
+
checkBox = _useState[0],
|
|
55
|
+
setCheckBox = _useState[1];
|
|
78
56
|
|
|
79
|
-
var _useState2 = (0, _react.useState)(
|
|
80
|
-
|
|
81
|
-
|
|
57
|
+
var _useState2 = (0, _react.useState)(''),
|
|
58
|
+
textInput = _useState2[0],
|
|
59
|
+
setTextInput = _useState2[1];
|
|
82
60
|
|
|
83
61
|
var _useState3 = (0, _react.useState)(''),
|
|
84
|
-
|
|
85
|
-
|
|
62
|
+
maskedInput = _useState3[0],
|
|
63
|
+
setMaskedInput = _useState3[1];
|
|
86
64
|
|
|
87
|
-
var _useState4 = (0, _react.useState)(''),
|
|
88
|
-
|
|
89
|
-
|
|
65
|
+
var _useState4 = (0, _react.useState)('RadioButton 1'),
|
|
66
|
+
radioButton = _useState4[0],
|
|
67
|
+
setRadioButton = _useState4[1];
|
|
90
68
|
|
|
91
|
-
var _useState5 = (0, _react.useState)(
|
|
92
|
-
|
|
93
|
-
|
|
69
|
+
var _useState5 = (0, _react.useState)([1, 2]),
|
|
70
|
+
rangeSelector = _useState5[0],
|
|
71
|
+
setRangeSelector = _useState5[1];
|
|
94
72
|
|
|
95
|
-
var _useState6 = (0, _react.useState)(
|
|
96
|
-
|
|
97
|
-
|
|
73
|
+
var _useState6 = (0, _react.useState)(0),
|
|
74
|
+
tabIndex = _useState6[0],
|
|
75
|
+
setTabIndex = _useState6[1];
|
|
98
76
|
|
|
99
|
-
var _useState7 = (0, _react.useState)(),
|
|
100
|
-
themeMode = _useState7[0],
|
|
101
|
-
setThemeMode = _useState7[1];
|
|
102
|
-
|
|
103
|
-
var _useState8 = (0, _react.useState)('grommet'),
|
|
104
|
-
themeName = _useState8[0],
|
|
105
|
-
setThemeName = _useState8[1];
|
|
106
|
-
|
|
107
|
-
var _useState9 = (0, _react.useState)(undefined),
|
|
108
|
-
background = _useState9[0],
|
|
109
|
-
setBackground = _useState9[1];
|
|
110
|
-
|
|
111
|
-
var _useState10 = (0, _react.useState)(0),
|
|
112
|
-
tabIndex = _useState10[0],
|
|
113
|
-
setTabIndex = _useState10[1];
|
|
114
|
-
|
|
115
|
-
var theme = (0, _react.useMemo)(function () {
|
|
116
|
-
return (0, _utils.deepMerge)((0, _base.generate)(baseSize), themes[themeName]);
|
|
117
|
-
}, [baseSize, themeName]);
|
|
118
|
-
var themeCanMode = (0, _react.useMemo)(function () {
|
|
119
|
-
return theme && theme.global.colors.background && theme.global.colors.background.dark;
|
|
120
|
-
}, [theme]);
|
|
121
77
|
var content = [/*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
122
78
|
key: "type",
|
|
123
79
|
align: "start",
|
|
@@ -376,77 +332,14 @@ var Components = function Components() {
|
|
|
376
332
|
src: "http://techslides.com/demos/sample-videos/small.3gp",
|
|
377
333
|
type: "video/3gp"
|
|
378
334
|
})))];
|
|
379
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
380
|
-
style: {
|
|
381
|
-
height: '100vh',
|
|
382
|
-
display: 'flex',
|
|
383
|
-
flexDirection: 'column'
|
|
384
|
-
}
|
|
385
|
-
}, /*#__PURE__*/_react["default"].createElement(_grommet.Grommet, {
|
|
386
|
-
theme: _themes.grommet,
|
|
387
|
-
style: {
|
|
388
|
-
flex: '0 0 auto'
|
|
389
|
-
}
|
|
390
|
-
}, /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
391
|
-
direction: "row-responsive",
|
|
392
|
-
gap: "medium",
|
|
393
|
-
justify: "end",
|
|
394
|
-
align: "center",
|
|
395
|
-
margin: "small"
|
|
396
|
-
}, /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
397
|
-
basis: "small"
|
|
398
|
-
}, /*#__PURE__*/_react["default"].createElement(_grommet.Select, {
|
|
399
|
-
plain: true,
|
|
400
|
-
size: "small",
|
|
401
|
-
options: Object.keys(themes),
|
|
402
|
-
value: themeName,
|
|
403
|
-
onChange: function onChange(event) {
|
|
404
|
-
return setThemeName(event.option);
|
|
405
|
-
}
|
|
406
|
-
})), themeCanMode && /*#__PURE__*/_react["default"].createElement(_grommet.CheckBox, {
|
|
407
|
-
label: "dark",
|
|
408
|
-
checked: themeMode === 'dark',
|
|
409
|
-
onChange: function onChange() {
|
|
410
|
-
return setThemeMode(themeMode === 'dark' ? 'light' : 'dark');
|
|
411
|
-
}
|
|
412
|
-
}), !themeCanMode && /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
413
|
-
basis: "small"
|
|
414
|
-
}, /*#__PURE__*/_react["default"].createElement(_grommet.Select, {
|
|
415
|
-
plain: true,
|
|
416
|
-
placeholder: "background",
|
|
417
|
-
size: "small",
|
|
418
|
-
options: ['default', 'dark-1', 'light-1'],
|
|
419
|
-
value: background,
|
|
420
|
-
onChange: function onChange(event) {
|
|
421
|
-
return setBackground(event.option);
|
|
422
|
-
}
|
|
423
|
-
})), /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
424
|
-
basis: "small"
|
|
425
|
-
}, /*#__PURE__*/_react["default"].createElement(_grommet.RangeInput, {
|
|
426
|
-
min: 16,
|
|
427
|
-
max: 36,
|
|
428
|
-
step: 2,
|
|
429
|
-
value: baseSize,
|
|
430
|
-
onChange: function onChange(event) {
|
|
431
|
-
return setBaseSize(parseInt(event.target.value, 10));
|
|
432
|
-
}
|
|
433
|
-
})), /*#__PURE__*/_react["default"].createElement(_grommet.Text, {
|
|
434
|
-
size: "small"
|
|
435
|
-
}, baseSize + "px base spacing"))), /*#__PURE__*/_react["default"].createElement(_grommet.Grommet, {
|
|
436
|
-
theme: theme,
|
|
437
|
-
themeMode: themeMode,
|
|
438
|
-
style: {
|
|
439
|
-
flex: '1 1'
|
|
440
|
-
}
|
|
441
|
-
}, /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
335
|
+
return /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
442
336
|
fill: true,
|
|
443
337
|
pad: "medium",
|
|
444
|
-
background: background || theme.global.colors.background,
|
|
445
338
|
overflow: "auto"
|
|
446
339
|
}, /*#__PURE__*/_react["default"].createElement(_grommet.Grid, {
|
|
447
340
|
columns: "small",
|
|
448
341
|
gap: "medium"
|
|
449
|
-
}, content))
|
|
342
|
+
}, content));
|
|
450
343
|
};
|
|
451
344
|
|
|
452
345
|
var All = function All() {
|
|
@@ -44,7 +44,9 @@ var CustomHeaderAccordion = function CustomHeaderAccordion() {
|
|
|
44
44
|
style: {
|
|
45
45
|
height: '800px'
|
|
46
46
|
}
|
|
47
|
-
}, /*#__PURE__*/_react["default"].createElement(_grommet.Text, null, "Panel 1 contents"), /*#__PURE__*/_react["default"].createElement(_grommet.TextInput,
|
|
47
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.Text, null, "Panel 1 contents"), /*#__PURE__*/_react["default"].createElement(_grommet.TextInput, {
|
|
48
|
+
a11yTitle: "panel 1 text box"
|
|
49
|
+
}))), /*#__PURE__*/_react["default"].createElement(_grommet.AccordionPanel, {
|
|
48
50
|
header: renderPanelHeader('Panel 2', activeIndex.includes(1))
|
|
49
51
|
}, /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
50
52
|
pad: "medium",
|
|
@@ -7,13 +7,15 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
7
7
|
|
|
8
8
|
var _styledComponents = require("styled-components");
|
|
9
9
|
|
|
10
|
+
var _Image = require("../Image");
|
|
11
|
+
|
|
10
12
|
var _defaultProps = require("../../default-props");
|
|
11
13
|
|
|
12
14
|
var _StyledAvatar = require("./StyledAvatar");
|
|
13
15
|
|
|
14
16
|
var _propTypes = require("./propTypes");
|
|
15
17
|
|
|
16
|
-
var _excluded = ["align", "children", "height", "justify", "round", "size", "src", "width"];
|
|
18
|
+
var _excluded = ["a11yTitle", "aria-label", "align", "children", "height", "justify", "round", "size", "src", "width"];
|
|
17
19
|
|
|
18
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
21
|
|
|
@@ -24,7 +26,9 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
24
26
|
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; }
|
|
25
27
|
|
|
26
28
|
var Avatar = function Avatar(_ref) {
|
|
27
|
-
var
|
|
29
|
+
var a11yTitle = _ref.a11yTitle,
|
|
30
|
+
ariaLabel = _ref['aria-label'],
|
|
31
|
+
_ref$align = _ref.align,
|
|
28
32
|
align = _ref$align === void 0 ? 'center' : _ref$align,
|
|
29
33
|
children = _ref.children,
|
|
30
34
|
height = _ref.height,
|
|
@@ -60,17 +64,26 @@ var Avatar = function Avatar(_ref) {
|
|
|
60
64
|
console.warn('Avatar should use `size` instead of `height` or `width` props');
|
|
61
65
|
}
|
|
62
66
|
|
|
63
|
-
|
|
64
|
-
return /*#__PURE__*/_react["default"].createElement(_StyledAvatar.StyledAvatar, _extends({}, avatarProps, rest, {
|
|
65
|
-
background: "url(" + src + ")"
|
|
66
|
-
}));
|
|
67
|
-
}
|
|
67
|
+
var content;
|
|
68
68
|
|
|
69
69
|
if (typeof children === 'string') {
|
|
70
|
-
|
|
70
|
+
content = /*#__PURE__*/_react["default"].createElement(_StyledAvatar.StyledAvatarText, {
|
|
71
71
|
alignSelf: "center",
|
|
72
72
|
size: avatarTextSize
|
|
73
|
-
}, children)
|
|
73
|
+
}, children);
|
|
74
|
+
} else if (typeof src === 'string') {
|
|
75
|
+
content = /*#__PURE__*/_react["default"].createElement(_Image.Image, {
|
|
76
|
+
role: "presentation",
|
|
77
|
+
fit: "contain",
|
|
78
|
+
src: src
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (typeof children === 'string' || typeof src === 'string') {
|
|
83
|
+
return /*#__PURE__*/_react["default"].createElement(_StyledAvatar.StyledAvatar, _extends({
|
|
84
|
+
role: typeof src === 'string' ? 'figure' : undefined,
|
|
85
|
+
a11yTitle: a11yTitle || ariaLabel
|
|
86
|
+
}, avatarProps, rest), content);
|
|
74
87
|
}
|
|
75
88
|
|
|
76
89
|
return /*#__PURE__*/_react["default"].createElement(AvatarChildren, null);
|
|
@@ -21,14 +21,18 @@ var fillStyle = function fillStyle() {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
var disabledStyle = "\n opacity: 0.5;\n cursor: default;\n";
|
|
24
|
-
var hoverStyle = (0, _styledComponents.css)([":hover input:not([disabled]) + div,:hover input:not([disabled]) + span{border-color:", ";}:hover{background-color:", ";}"], function (props) {
|
|
24
|
+
var hoverStyle = (0, _styledComponents.css)([":hover input:not([disabled]) + div,:hover input:not([disabled]) + span{border-color:", ";", "}:hover{background-color:", ";}"], function (props) {
|
|
25
25
|
var _props$theme$checkBox, _props$theme$checkBox2;
|
|
26
26
|
|
|
27
27
|
return (0, _utils.normalizeColor)((_props$theme$checkBox = props.theme.checkBox.hover) == null ? void 0 : (_props$theme$checkBox2 = _props$theme$checkBox.border) == null ? void 0 : _props$theme$checkBox2.color, props.theme);
|
|
28
28
|
}, function (props) {
|
|
29
|
-
var _props$theme$checkBox3
|
|
29
|
+
var _props$theme$checkBox3;
|
|
30
30
|
|
|
31
|
-
return (
|
|
31
|
+
return (_props$theme$checkBox3 = props.theme.checkBox.hover) == null ? void 0 : _props$theme$checkBox3.extend;
|
|
32
|
+
}, function (props) {
|
|
33
|
+
var _props$theme$checkBox4, _props$theme$checkBox5;
|
|
34
|
+
|
|
35
|
+
return (0, _utils.normalizeColor)(!props.disabled && ((_props$theme$checkBox4 = props.theme.checkBox.hover) == null ? void 0 : (_props$theme$checkBox5 = _props$theme$checkBox4.background) == null ? void 0 : _props$theme$checkBox5.color), props.theme);
|
|
32
36
|
});
|
|
33
37
|
|
|
34
38
|
var StyledCheckBoxIcon = _styledComponents["default"].svg.withConfig({
|
|
@@ -64,9 +68,9 @@ var StyledCheckBoxContainer = _styledComponents["default"].label.withConfig({
|
|
|
64
68
|
}, function (props) {
|
|
65
69
|
return !props.disabled && 'cursor: pointer;';
|
|
66
70
|
}, hoverStyle, function (props) {
|
|
67
|
-
var _props$theme$
|
|
71
|
+
var _props$theme$checkBox6, _props$theme$checkBox7, _props$theme$checkBox8, _props$theme$checkBox9;
|
|
68
72
|
|
|
69
|
-
return props.focus && !props.focusIndicator && "\n input:not([disabled]) + div,\n input:not([disabled]) + span {\n border-color: " + (0, _utils.normalizeColor)((_props$theme$
|
|
73
|
+
return props.focus && !props.focusIndicator && "\n input:not([disabled]) + div,\n input:not([disabled]) + span {\n border-color: " + (0, _utils.normalizeColor)((_props$theme$checkBox6 = props.theme.checkBox.hover) == null ? void 0 : (_props$theme$checkBox7 = _props$theme$checkBox6.border) == null ? void 0 : _props$theme$checkBox7.color, props.theme) + ";\n }\n \n background-color: " + (0, _utils.normalizeColor)(!props.disabled && ((_props$theme$checkBox8 = props.theme.checkBox.hover) == null ? void 0 : (_props$theme$checkBox9 = _props$theme$checkBox8.background) == null ? void 0 : _props$theme$checkBox9.color), props.theme) + ";";
|
|
70
74
|
}, function (props) {
|
|
71
75
|
return props.theme.checkBox.extend;
|
|
72
76
|
});
|
|
@@ -134,8 +134,10 @@ var Detail = function Detail(_ref) {
|
|
|
134
134
|
gap: "xsmall",
|
|
135
135
|
align: "center"
|
|
136
136
|
}, series.filter(function (_ref2) {
|
|
137
|
+
var _data$detailIndex;
|
|
138
|
+
|
|
137
139
|
var property = _ref2.property;
|
|
138
|
-
return !activeProperty || activeProperty === property || axis && axis.x && axis.x.property === property;
|
|
140
|
+
return (!activeProperty || activeProperty === property) && (data == null ? void 0 : (_data$detailIndex = data[detailIndex]) == null ? void 0 : _data$detailIndex[property]) !== undefined || axis && axis.x && axis.x.property === property;
|
|
139
141
|
}).map(function (serie) {
|
|
140
142
|
var propertyStyle = seriesStyles[serie.property];
|
|
141
143
|
return /*#__PURE__*/_react["default"].createElement(_react.Fragment, {
|
|
@@ -91,12 +91,12 @@ export interface DataTableProps<TRowType = any> {
|
|
|
91
91
|
groupBy?:
|
|
92
92
|
| string
|
|
93
93
|
| {
|
|
94
|
-
property
|
|
95
|
-
expand
|
|
96
|
-
expandable
|
|
97
|
-
select
|
|
98
|
-
onExpand
|
|
99
|
-
onSelect
|
|
94
|
+
property?: string;
|
|
95
|
+
expand?: Array<string>;
|
|
96
|
+
expandable?: Array<string>;
|
|
97
|
+
select?: { [key: string]: 'all' | 'some' | 'none' };
|
|
98
|
+
onExpand?: (expandedKeys: string[]) => void;
|
|
99
|
+
onSelect?: (select: (string | number)[], datum: TRowType) => void;
|
|
100
100
|
};
|
|
101
101
|
primaryKey?: string | boolean;
|
|
102
102
|
select?: (string | number)[];
|
|
@@ -289,7 +289,7 @@ var DateInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, refArg) {
|
|
|
289
289
|
}, /*#__PURE__*/_react["default"].createElement(_Box.Box, {
|
|
290
290
|
ref: containerRef,
|
|
291
291
|
border: !plain,
|
|
292
|
-
round:
|
|
292
|
+
round: theme.dateInput.container.round,
|
|
293
293
|
direction: "row",
|
|
294
294
|
fill: true
|
|
295
295
|
}, reverse && calendarButton, /*#__PURE__*/_react["default"].createElement(_MaskedInput.MaskedInput, _extends({
|
|
@@ -223,7 +223,8 @@ var Diagram = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
223
223
|
|
|
224
224
|
path = /*#__PURE__*/_react["default"].createElement("path", _extends({
|
|
225
225
|
// eslint-disable-next-line react/no-array-index-key
|
|
226
|
-
key: index
|
|
226
|
+
key: index // eslint-disable-next-line react/no-unknown-property
|
|
227
|
+
,
|
|
227
228
|
animation: animation
|
|
228
229
|
}, cleanedRest, {
|
|
229
230
|
stroke: (0, _utils.normalizeColor)(colorName, theme),
|
|
@@ -48,7 +48,7 @@ var OverflowDrop = function OverflowDrop() {
|
|
|
48
48
|
align: "center",
|
|
49
49
|
justify: "center"
|
|
50
50
|
}, /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
51
|
-
background: "dark-
|
|
51
|
+
background: "dark-2",
|
|
52
52
|
pad: "medium",
|
|
53
53
|
align: "center",
|
|
54
54
|
justify: "start",
|
package/components/List/List.js
CHANGED
|
@@ -217,18 +217,23 @@ var List = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
217
217
|
|
|
218
218
|
var _useState4 = (0, _react.useState)(),
|
|
219
219
|
dragging = _useState4[0],
|
|
220
|
-
setDragging = _useState4[1];
|
|
220
|
+
setDragging = _useState4[1];
|
|
221
|
+
|
|
222
|
+
var _useState5 = (0, _react.useState)(),
|
|
223
|
+
orderingData = _useState5[0],
|
|
224
|
+
setOrderingData = _useState5[1]; // store a reference to the pinned and the data that is orderable
|
|
221
225
|
|
|
222
226
|
|
|
223
227
|
var _useMemo = (0, _react.useMemo)(function () {
|
|
224
228
|
var orderable = [];
|
|
225
229
|
var pinnedData = [];
|
|
226
230
|
var pinnedIndexes = [];
|
|
227
|
-
|
|
231
|
+
var currentData = orderingData || data;
|
|
232
|
+
if (pinned.length === 0) return [currentData, {
|
|
228
233
|
data: pinnedData,
|
|
229
234
|
indexes: pinnedIndexes
|
|
230
235
|
}];
|
|
231
|
-
|
|
236
|
+
currentData.forEach(function (item, index) {
|
|
232
237
|
var key = typeof item === 'object' ? item[itemKey] : item;
|
|
233
238
|
|
|
234
239
|
if (pinned.includes(key)) {
|
|
@@ -242,7 +247,7 @@ var List = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
242
247
|
data: pinnedData,
|
|
243
248
|
indexes: pinnedIndexes
|
|
244
249
|
}];
|
|
245
|
-
}, [data, itemKey, pinned]),
|
|
250
|
+
}, [data, orderingData, itemKey, pinned]),
|
|
246
251
|
orderableData = _useMemo[0],
|
|
247
252
|
pinnedInfo = _useMemo[1];
|
|
248
253
|
|
|
@@ -256,11 +261,6 @@ var List = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
256
261
|
|
|
257
262
|
var Container = paginate ? StyledContainer : _react.Fragment;
|
|
258
263
|
var containterProps = paginate ? _extends({}, theme.list.container) : undefined;
|
|
259
|
-
|
|
260
|
-
var _useState5 = (0, _react.useState)(),
|
|
261
|
-
orderingData = _useState5[0],
|
|
262
|
-
setOrderingData = _useState5[1];
|
|
263
|
-
|
|
264
264
|
var draggingRef = (0, _react.useRef)();
|
|
265
265
|
var sendAnalytics = (0, _AnalyticsContext.useAnalytics)();
|
|
266
266
|
var ariaProps = {
|
|
@@ -610,15 +610,18 @@ var List = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
610
610
|
updateActive(undefined);
|
|
611
611
|
setItemFocus(false);
|
|
612
612
|
}
|
|
613
|
-
}));
|
|
613
|
+
})); // wrap the main content and use
|
|
614
|
+
// the boxProps defined for the content
|
|
615
|
+
|
|
616
|
+
content = /*#__PURE__*/_react["default"].createElement(_Box.Box, _extends({
|
|
617
|
+
flex: true
|
|
618
|
+
}, boxProps), content); // Adjust the boxProps to account for the order controls
|
|
619
|
+
|
|
614
620
|
boxProps = {
|
|
615
621
|
direction: 'row',
|
|
616
622
|
align: defaultItemProps && defaultItemProps.align || 'center',
|
|
617
623
|
gap: 'medium'
|
|
618
624
|
};
|
|
619
|
-
content = /*#__PURE__*/_react["default"].createElement(_Box.Box, {
|
|
620
|
-
flex: true
|
|
621
|
-
}, content);
|
|
622
625
|
}
|
|
623
626
|
|
|
624
627
|
var itemAriaProps;
|
|
@@ -29,6 +29,7 @@ var Selection = function Selection() {
|
|
|
29
29
|
pad: "large",
|
|
30
30
|
gap: "large"
|
|
31
31
|
}, /*#__PURE__*/_react["default"].createElement(_grommet.List, {
|
|
32
|
+
"aria-label": "selection list",
|
|
32
33
|
data: data.slice(0, 10),
|
|
33
34
|
itemProps: selected >= 0 ? (_ref = {}, _ref[selected] = {
|
|
34
35
|
background: 'brand'
|
|
@@ -36,6 +36,7 @@ var OnClickItemList = function OnClickItemList() {
|
|
|
36
36
|
pad: "large",
|
|
37
37
|
gap: "large"
|
|
38
38
|
}, /*#__PURE__*/_react["default"].createElement(_grommet.List, {
|
|
39
|
+
"aria-label": "onClickItem list",
|
|
39
40
|
data: data.slice(0, 10),
|
|
40
41
|
onClickItem: function onClickItem(event) {
|
|
41
42
|
setShow(true);
|
|
@@ -161,11 +161,11 @@ var Notification = function Notification(_ref) {
|
|
|
161
161
|
}, action, theme.notification.actions)), ' ');
|
|
162
162
|
});
|
|
163
163
|
var Message = direction !== 'row' ? _Paragraph.Paragraph : _Text.Text;
|
|
164
|
-
if (message || actions) message = /*#__PURE__*/_react["default"].createElement(Message, theme.notification.message, /*#__PURE__*/_react["default"].createElement(_Text.Text, {
|
|
164
|
+
if (message || actions) message = typeof message === 'string' ? /*#__PURE__*/_react["default"].createElement(Message, theme.notification.message, /*#__PURE__*/_react["default"].createElement(_Text.Text, {
|
|
165
165
|
margin: {
|
|
166
166
|
right: 'xsmall'
|
|
167
167
|
}
|
|
168
|
-
}, message), actions);
|
|
168
|
+
}, message), actions) : message;
|
|
169
169
|
|
|
170
170
|
var content = /*#__PURE__*/_react["default"].createElement(_Box.Box, _extends({}, theme.notification.container, global ? _extends({}, theme.notification.global.container) : {}, toast ? _extends({}, theme.notification.toast.container) : {}, {
|
|
171
171
|
background: background // let internal box control pad
|
|
@@ -16,7 +16,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
16
16
|
actions: _propTypes["default"].arrayOf(_propTypes["default"].shape(_propTypes2.AnchorPropTypes)),
|
|
17
17
|
global: _propTypes["default"].bool,
|
|
18
18
|
title: _propTypes["default"].string,
|
|
19
|
-
message: _propTypes["default"].string,
|
|
19
|
+
message: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].node]),
|
|
20
20
|
status: _propTypes["default"].oneOf(['critical', 'warning', 'normal', 'info', 'unknown']),
|
|
21
21
|
toast: _propTypes["default"].oneOfType([_propTypes["default"].bool, _propTypes["default"].shape({
|
|
22
22
|
autoClose: _propTypes["default"].bool,
|