grommet 2.32.2 → 2.33.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/all/stories/CustomThemed/ExtendTheme.tsx +2 -4
- package/components/Chart/Chart.js +20 -20
- package/components/Chart/calcs.js +163 -92
- package/components/Chart/index.d.ts +10 -4
- package/components/Chart/propTypes.js +10 -1
- package/components/Chart/stories/{Vertical.js → Horizontal.js} +34 -6
- package/components/Chart/utils.js +68 -64
- package/components/DataChart/DataChart.js +114 -68
- package/components/DataChart/Detail.js +55 -21
- package/components/DataChart/XAxis.js +33 -6
- package/components/DataChart/XGuide.js +14 -1
- package/components/DataChart/YAxis.js +58 -39
- package/components/DataChart/YGuide.js +13 -10
- package/components/DataChart/index.d.ts +2 -0
- package/components/DataChart/propTypes.js +3 -1
- package/components/DataChart/stories/Horizontal.js +63 -0
- package/components/DataChart/utils.js +27 -2
- package/components/DataFilter/DataFilter.js +25 -2
- package/components/DataSort/DataSort.js +1 -1
- package/components/DataTable/buildState.js +6 -1
- package/components/DataTableColumns/DataTableColumns.js +2 -2
- package/components/DateInput/DateInput.js +22 -2
- package/components/Footer/stories/DoubleFooter.js +6 -2
- package/components/Footer/stories/Sitemap.js +0 -2
- package/components/Footer/stories/Social.js +2 -2
- package/components/Menu/Menu.js +9 -6
- package/components/Select/Select.js +1 -1
- package/components/SelectMultiple/SelectMultipleContainer.js +5 -5
- package/components/Tabs/Tabs.js +2 -1
- package/es6/all/stories/CustomThemed/ExtendTheme.tsx +2 -4
- package/es6/components/Chart/Chart.js +20 -20
- package/es6/components/Chart/calcs.js +164 -93
- package/es6/components/Chart/index.d.ts +10 -4
- package/es6/components/Chart/propTypes.js +10 -1
- package/es6/components/Chart/stories/{Vertical.js → Horizontal.js} +32 -4
- package/es6/components/Chart/utils.js +66 -63
- package/es6/components/DataChart/DataChart.js +115 -69
- package/es6/components/DataChart/Detail.js +55 -21
- package/es6/components/DataChart/XAxis.js +33 -6
- package/es6/components/DataChart/XGuide.js +14 -1
- package/es6/components/DataChart/YAxis.js +59 -40
- package/es6/components/DataChart/YGuide.js +13 -10
- package/es6/components/DataChart/index.d.ts +2 -0
- package/es6/components/DataChart/propTypes.js +3 -1
- package/es6/components/DataChart/stories/Horizontal.js +57 -0
- package/es6/components/DataChart/utils.js +22 -0
- package/es6/components/DataFilter/DataFilter.js +27 -3
- package/es6/components/DataSort/DataSort.js +1 -1
- package/es6/components/DataTable/buildState.js +6 -1
- package/es6/components/DataTableColumns/DataTableColumns.js +2 -2
- package/es6/components/DateInput/DateInput.js +22 -2
- package/es6/components/Footer/stories/DoubleFooter.js +6 -2
- package/es6/components/Footer/stories/Sitemap.js +0 -2
- package/es6/components/Footer/stories/Social.js +2 -2
- package/es6/components/Menu/Menu.js +9 -6
- package/es6/components/Select/Select.js +1 -1
- package/es6/components/SelectMultiple/SelectMultipleContainer.js +5 -5
- package/es6/components/Tabs/Tabs.js +2 -1
- package/es6/themes/base.d.ts +5 -1
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/package.json +37 -40
- package/themes/base.d.ts +5 -1
|
@@ -95,7 +95,7 @@ var SelectMultipleContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
95
95
|
}, []);
|
|
96
96
|
useEffect(function () {
|
|
97
97
|
var optionsNode = optionsRef.current;
|
|
98
|
-
if (optionsNode.children) {
|
|
98
|
+
if (optionsNode != null && optionsNode.children) {
|
|
99
99
|
var optionNode = optionsNode.children[activeIndex];
|
|
100
100
|
if (optionNode) optionNode.focus();
|
|
101
101
|
}
|
|
@@ -143,7 +143,7 @@ var SelectMultipleContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
143
143
|
var onNextOption = useCallback(function (event) {
|
|
144
144
|
event.preventDefault();
|
|
145
145
|
var nextActiveIndex = activeIndex + 1;
|
|
146
|
-
if (nextActiveIndex !== options.length) {
|
|
146
|
+
if (nextActiveIndex !== (options == null ? void 0 : options.length)) {
|
|
147
147
|
setActiveIndex(nextActiveIndex);
|
|
148
148
|
setKeyboardNavigation(true);
|
|
149
149
|
}
|
|
@@ -190,7 +190,7 @@ var SelectMultipleContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
190
190
|
};
|
|
191
191
|
}, [keyboardNavigation]);
|
|
192
192
|
var onSelectOption = useCallback(function (event) {
|
|
193
|
-
if (!isDisabled(activeIndex) && activeIndex >= 0 && activeIndex < options.length) {
|
|
193
|
+
if (!isDisabled(activeIndex) && activeIndex >= 0 && activeIndex < (options == null ? void 0 : options.length)) {
|
|
194
194
|
event.preventDefault(); // prevent submitting forms
|
|
195
195
|
selectOption(activeIndex)(event);
|
|
196
196
|
}
|
|
@@ -219,7 +219,7 @@ var SelectMultipleContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
219
219
|
if (value.length === limit) {
|
|
220
220
|
var newDisabled = [].concat(disabledProp);
|
|
221
221
|
// disable everything that is not selected
|
|
222
|
-
for (var i = 0; i < options.length; i += 1) {
|
|
222
|
+
for (var i = 0; i < (options == null ? void 0 : options.length); i += 1) {
|
|
223
223
|
if (!isSelected(i) && !originallyDisabled(i)) {
|
|
224
224
|
newDisabled.push(options[i]);
|
|
225
225
|
}
|
|
@@ -312,7 +312,7 @@ var SelectMultipleContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
312
312
|
setActiveIndex(-1);
|
|
313
313
|
onSearch(nextSearch);
|
|
314
314
|
}
|
|
315
|
-
}))), helpContent, options.length > 0 ? /*#__PURE__*/React.createElement(OptionsContainer, {
|
|
315
|
+
}))), helpContent, (options == null ? void 0 : options.length) > 0 ? /*#__PURE__*/React.createElement(OptionsContainer, {
|
|
316
316
|
role: "listbox",
|
|
317
317
|
tabIndex: "0",
|
|
318
318
|
ref: optionsRef,
|
|
@@ -176,8 +176,9 @@ var Tabs = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
176
176
|
}
|
|
177
177
|
};
|
|
178
178
|
useEffect(function () {
|
|
179
|
+
var _tabRefs$activeIndex;
|
|
179
180
|
// if the active tab isn't visible scroll to it
|
|
180
|
-
if (overflow && tabRefs && tabRefs[activeIndex].current && !isVisible(activeIndex)) scrollTo(activeIndex, true);
|
|
181
|
+
if (overflow && tabRefs && (_tabRefs$activeIndex = tabRefs[activeIndex]) != null && _tabRefs$activeIndex.current && !isVisible(activeIndex)) scrollTo(activeIndex, true);
|
|
181
182
|
}, [overflow, activeIndex, tabRefs, isVisible, scrollTo]);
|
|
182
183
|
useEffect(function () {
|
|
183
184
|
// scroll focus item into view if it is not already visible
|
package/es6/themes/base.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
AlignContentType,
|
|
27
27
|
SkeletonColorsType,
|
|
28
28
|
AlignSelfType,
|
|
29
|
+
AlignType,
|
|
29
30
|
} from '../utils';
|
|
30
31
|
|
|
31
32
|
import { AnchorProps } from '../components/Anchor/index';
|
|
@@ -1087,7 +1088,10 @@ export interface ThemeType {
|
|
|
1087
1088
|
};
|
|
1088
1089
|
menu?: {
|
|
1089
1090
|
background?: BackgroundType;
|
|
1090
|
-
item?:
|
|
1091
|
+
item?:
|
|
1092
|
+
| ButtonType & {
|
|
1093
|
+
align?: AlignType;
|
|
1094
|
+
};
|
|
1091
1095
|
drop?: DropType;
|
|
1092
1096
|
extend?: ExtendType;
|
|
1093
1097
|
group?: {
|