grommet 2.46.1 → 2.47.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/index.d.ts +7 -1
- package/components/AccordionPanel/index.d.ts +4 -1
- package/components/Anchor/index.d.ts +7 -1
- package/components/Avatar/Avatar.js +4 -3
- package/components/Avatar/index.d.ts +9 -1
- package/components/Avatar/propTypes.js +2 -1
- package/components/Box/StyledBox.js +9 -1
- package/components/Box/index.d.ts +9 -2
- package/components/Button/index.d.ts +14 -2
- package/components/Calendar/Calendar.js +43 -32
- package/components/Calendar/StyledCalendar.js +86 -32
- package/components/Calendar/index.d.ts +15 -2
- package/components/Calendar/propTypes.js +1 -0
- package/components/Cards/index.d.ts +7 -1
- package/components/Carousel/index.d.ts +4 -1
- package/components/Chart/index.d.ts +7 -1
- package/components/CheckBox/index.d.ts +7 -1
- package/components/CheckBoxGroup/index.d.ts +15 -2
- package/components/Clock/index.d.ts +14 -2
- package/components/Collapsible/index.d.ts +4 -1
- package/components/Data/index.d.ts +4 -1
- package/components/DataFilter/index.d.ts +4 -1
- package/components/DataFilters/index.d.ts +4 -1
- package/components/DataTable/Body.js +13 -7
- package/components/DataTable/DataTable.js +6 -1
- package/components/DataTable/index.d.ts +11 -2
- package/components/DataTable/propTypes.js +5 -1
- package/components/DataTable/stories/rowDetails.stories.js +174 -66
- package/components/DataTable/stories/typescript/OnSelect.stories.tsx +3 -3
- package/components/DataTableGroupBy/index.d.ts +4 -1
- package/components/DataView/index.d.ts +4 -1
- package/components/DateInput/index.d.ts +4 -1
- package/components/Diagram/index.d.ts +4 -1
- package/components/Distribution/index.d.ts +4 -1
- package/components/Drop/StyledDrop.js +3 -1
- package/components/Drop/index.d.ts +6 -2
- package/components/DropButton/index.d.ts +8 -1
- package/components/FileInput/index.d.ts +8 -2
- package/components/Form/index.d.ts +7 -1
- package/components/FormField/index.d.ts +4 -1
- package/components/Grid/index.d.ts +4 -1
- package/components/Grommet/index.d.ts +18 -1
- package/components/Grommet/propTypes.js +11 -0
- package/components/Header/stories/typescript/Ref.stories.tsx +1 -1
- package/components/Heading/index.d.ts +7 -7
- package/components/Image/index.d.ts +4 -1
- package/components/InfiniteScroll/index.d.ts +2 -2
- package/components/Layer/index.d.ts +4 -1
- package/components/List/index.d.ts +9 -3
- package/components/Markdown/index.d.ts +5 -1
- package/components/MaskedInput/MaskedInput.js +49 -4
- package/components/MaskedInput/index.d.ts +7 -1
- package/components/MaskedInput/stories/CustomBox.stories.js +1 -0
- package/components/MaskedInput/stories/Date.stories.js +1 -0
- package/components/MaskedInput/stories/DateRange.stories.js +1 -0
- package/components/MaskedInput/stories/DateTimeDrop.stories.js +1 -0
- package/components/MaskedInput/stories/Filtered.stories.js +1 -0
- package/components/MaskedInput/stories/SizeUnits.stories.js +1 -0
- package/components/MaskedInput/stories/Time.stories.js +1 -0
- package/components/NameValueList/index.d.ts +8 -1
- package/components/Notification/index.d.ts +1 -0
- package/components/PageHeader/index.d.ts +5 -1
- package/components/Pagination/PaginationStep.js +4 -0
- package/components/Pagination/index.d.ts +5 -0
- package/components/Pagination/propTypes.js +6 -1
- package/components/Paragraph/index.d.ts +7 -1
- package/components/RadioButton/index.d.ts +7 -1
- package/components/RadioButtonGroup/index.d.ts +7 -1
- package/components/RangeInput/index.d.ts +7 -1
- package/components/RangeSelector/index.d.ts +15 -2
- package/components/RoutedAnchor/index.d.ts +3 -2
- package/components/RoutedButton/index.d.ts +3 -2
- package/components/Select/Select.js +2 -4
- package/components/Select/index.d.ts +7 -1
- package/components/Select/utils.js +12 -3
- package/components/SelectMultiple/SelectMultiple.js +5 -10
- package/components/SelectMultiple/SelectMultipleContainer.js +2 -4
- package/components/SelectMultiple/SelectMultipleValue.js +1 -2
- package/components/SelectMultiple/index.d.ts +7 -1
- package/components/Sidebar/index.d.ts +4 -1
- package/components/Stack/index.d.ts +4 -1
- package/components/Tab/index.d.ts +7 -1
- package/components/Table/index.d.ts +4 -1
- package/components/TableBody/index.d.ts +4 -1
- package/components/TableCell/index.d.ts +10 -3
- package/components/TableFooter/index.d.ts +4 -1
- package/components/TableHeader/index.d.ts +4 -1
- package/components/TableRow/index.d.ts +4 -1
- package/components/Tabs/index.d.ts +4 -1
- package/components/Tag/Tag.js +15 -1
- package/components/Tag/index.d.ts +6 -0
- package/components/Tag/propTypes.js +6 -0
- package/components/Text/Text.js +3 -2
- package/components/Text/index.d.ts +7 -1
- package/components/TextArea/index.d.ts +7 -1
- package/components/TextInput/TextInput.js +6 -2
- package/components/TextInput/index.d.ts +6 -3
- package/components/TextInput/stories/CustomThemed/CustomSuggestions.stories.tsx +2 -1
- package/components/TextInput/stories/CustomThemed/Themed.stories.js +1 -0
- package/components/TextInput/stories/OnSelect.stories.js +1 -0
- package/components/TextInput/stories/WithTags.stories.js +1 -0
- package/components/Tip/Tip.js +16 -1
- package/components/ToggleGroup/index.d.ts +7 -1
- package/components/Toolbar/index.d.ts +5 -2
- package/components/Video/index.d.ts +7 -1
- package/components/WorldMap/index.d.ts +7 -1
- package/es6/components/Accordion/index.d.ts +7 -1
- package/es6/components/AccordionPanel/index.d.ts +4 -1
- package/es6/components/Anchor/index.d.ts +7 -1
- package/es6/components/Avatar/Avatar.js +4 -3
- package/es6/components/Avatar/index.d.ts +9 -1
- package/es6/components/Avatar/propTypes.js +2 -1
- package/es6/components/Box/StyledBox.js +8 -1
- package/es6/components/Box/index.d.ts +9 -2
- package/es6/components/Button/index.d.ts +14 -2
- package/es6/components/Calendar/Calendar.js +44 -32
- package/es6/components/Calendar/StyledCalendar.js +86 -32
- package/es6/components/Calendar/index.d.ts +15 -2
- package/es6/components/Calendar/propTypes.js +1 -0
- package/es6/components/Cards/index.d.ts +7 -1
- package/es6/components/Carousel/index.d.ts +4 -1
- package/es6/components/Chart/index.d.ts +7 -1
- package/es6/components/CheckBox/index.d.ts +7 -1
- package/es6/components/CheckBoxGroup/index.d.ts +15 -2
- package/es6/components/Clock/index.d.ts +14 -2
- package/es6/components/Collapsible/index.d.ts +4 -1
- package/es6/components/Data/index.d.ts +4 -1
- package/es6/components/DataFilter/index.d.ts +4 -1
- package/es6/components/DataFilters/index.d.ts +4 -1
- package/es6/components/DataTable/Body.js +13 -7
- package/es6/components/DataTable/DataTable.js +6 -1
- package/es6/components/DataTable/index.d.ts +11 -2
- package/es6/components/DataTable/propTypes.js +5 -1
- package/es6/components/DataTable/stories/rowDetails.stories.js +172 -66
- package/es6/components/DataTable/stories/typescript/OnSelect.stories.tsx +3 -3
- package/es6/components/DataTableGroupBy/index.d.ts +4 -1
- package/es6/components/DataView/index.d.ts +4 -1
- package/es6/components/DateInput/index.d.ts +4 -1
- package/es6/components/Diagram/index.d.ts +4 -1
- package/es6/components/Distribution/index.d.ts +4 -1
- package/es6/components/Drop/StyledDrop.js +3 -1
- package/es6/components/Drop/index.d.ts +6 -2
- package/es6/components/DropButton/index.d.ts +8 -1
- package/es6/components/FileInput/index.d.ts +8 -2
- package/es6/components/Form/index.d.ts +7 -1
- package/es6/components/FormField/index.d.ts +4 -1
- package/es6/components/Grid/index.d.ts +4 -1
- package/es6/components/Grommet/index.d.ts +18 -1
- package/es6/components/Grommet/propTypes.js +11 -0
- package/es6/components/Header/stories/typescript/Ref.stories.tsx +1 -1
- package/es6/components/Heading/index.d.ts +7 -7
- package/es6/components/Image/index.d.ts +4 -1
- package/es6/components/InfiniteScroll/index.d.ts +2 -2
- package/es6/components/Layer/index.d.ts +4 -1
- package/es6/components/List/index.d.ts +9 -3
- package/es6/components/Markdown/index.d.ts +5 -1
- package/es6/components/MaskedInput/MaskedInput.js +49 -4
- package/es6/components/MaskedInput/index.d.ts +7 -1
- package/es6/components/MaskedInput/stories/CustomBox.stories.js +1 -0
- package/es6/components/MaskedInput/stories/Date.stories.js +1 -0
- package/es6/components/MaskedInput/stories/DateRange.stories.js +1 -0
- package/es6/components/MaskedInput/stories/DateTimeDrop.stories.js +1 -0
- package/es6/components/MaskedInput/stories/Filtered.stories.js +1 -0
- package/es6/components/MaskedInput/stories/SizeUnits.stories.js +1 -0
- package/es6/components/MaskedInput/stories/Time.stories.js +1 -0
- package/es6/components/NameValueList/index.d.ts +8 -1
- package/es6/components/Notification/index.d.ts +1 -0
- package/es6/components/PageHeader/index.d.ts +5 -1
- package/es6/components/Pagination/PaginationStep.js +4 -0
- package/es6/components/Pagination/index.d.ts +5 -0
- package/es6/components/Pagination/propTypes.js +6 -1
- package/es6/components/Paragraph/index.d.ts +7 -1
- package/es6/components/RadioButton/index.d.ts +7 -1
- package/es6/components/RadioButtonGroup/index.d.ts +7 -1
- package/es6/components/RangeInput/index.d.ts +7 -1
- package/es6/components/RangeSelector/index.d.ts +15 -2
- package/es6/components/RoutedAnchor/index.d.ts +3 -2
- package/es6/components/RoutedButton/index.d.ts +3 -2
- package/es6/components/Select/Select.js +3 -5
- package/es6/components/Select/index.d.ts +7 -1
- package/es6/components/Select/utils.js +9 -2
- package/es6/components/SelectMultiple/SelectMultiple.js +6 -11
- package/es6/components/SelectMultiple/SelectMultipleContainer.js +3 -5
- package/es6/components/SelectMultiple/SelectMultipleValue.js +2 -3
- package/es6/components/SelectMultiple/index.d.ts +7 -1
- package/es6/components/Sidebar/index.d.ts +4 -1
- package/es6/components/Stack/index.d.ts +4 -1
- package/es6/components/Tab/index.d.ts +7 -1
- package/es6/components/Table/index.d.ts +4 -1
- package/es6/components/TableBody/index.d.ts +4 -1
- package/es6/components/TableCell/index.d.ts +10 -3
- package/es6/components/TableFooter/index.d.ts +4 -1
- package/es6/components/TableHeader/index.d.ts +4 -1
- package/es6/components/TableRow/index.d.ts +4 -1
- package/es6/components/Tabs/index.d.ts +4 -1
- package/es6/components/Tag/Tag.js +16 -2
- package/es6/components/Tag/index.d.ts +6 -0
- package/es6/components/Tag/propTypes.js +6 -0
- package/es6/components/Text/Text.js +3 -2
- package/es6/components/Text/index.d.ts +7 -1
- package/es6/components/TextArea/index.d.ts +7 -1
- package/es6/components/TextInput/TextInput.js +6 -2
- package/es6/components/TextInput/index.d.ts +6 -3
- package/es6/components/TextInput/stories/CustomThemed/CustomSuggestions.stories.tsx +2 -1
- package/es6/components/TextInput/stories/CustomThemed/Themed.stories.js +1 -0
- package/es6/components/TextInput/stories/OnSelect.stories.js +1 -0
- package/es6/components/TextInput/stories/WithTags.stories.js +1 -0
- package/es6/components/Tip/Tip.js +17 -1
- package/es6/components/ToggleGroup/index.d.ts +7 -1
- package/es6/components/Toolbar/index.d.ts +5 -2
- package/es6/components/Video/index.d.ts +7 -1
- package/es6/components/WorldMap/index.d.ts +7 -1
- package/es6/languages/default.json +6 -0
- package/es6/utils/mixins.js +2 -1
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/languages/default.json +6 -0
- package/package.json +9 -9
- package/utils/mixins.js +2 -1
- package/components/Drop/stories/TrapFocus.stories.js +0 -86
- package/es6/components/Drop/stories/TrapFocus.stories.js +0 -82
|
@@ -23,7 +23,13 @@ export interface RadioButtonGroupProps {
|
|
|
23
23
|
export interface RadioButtonGroupExtendedProps
|
|
24
24
|
extends RadioButtonGroupProps,
|
|
25
25
|
BoxProps,
|
|
26
|
-
Omit<
|
|
26
|
+
Omit<
|
|
27
|
+
React.DetailedHTMLProps<
|
|
28
|
+
React.HTMLAttributes<HTMLDivElement>,
|
|
29
|
+
HTMLDivElement
|
|
30
|
+
>,
|
|
31
|
+
'children' | 'onClick' | 'onChange'
|
|
32
|
+
> {}
|
|
27
33
|
|
|
28
34
|
declare const RadioButtonGroup: React.FC<RadioButtonGroupExtendedProps>;
|
|
29
35
|
|
|
@@ -20,7 +20,13 @@ export interface RangeInputProps {
|
|
|
20
20
|
|
|
21
21
|
export interface RangeInputExtendedProps
|
|
22
22
|
extends RangeInputProps,
|
|
23
|
-
Omit<
|
|
23
|
+
Omit<
|
|
24
|
+
React.DetailedHTMLProps<
|
|
25
|
+
React.InputHTMLAttributes<HTMLInputElement>,
|
|
26
|
+
HTMLInputElement
|
|
27
|
+
>,
|
|
28
|
+
'color' | 'step' | 'value'
|
|
29
|
+
> {}
|
|
24
30
|
|
|
25
31
|
declare const RangeInput: React.FC<RangeInputExtendedProps>;
|
|
26
32
|
|
|
@@ -28,10 +28,23 @@ export interface RangeSelectorProps {
|
|
|
28
28
|
|
|
29
29
|
export interface RangeSelectorExtendedProps
|
|
30
30
|
extends RangeSelectorProps,
|
|
31
|
-
Omit<
|
|
31
|
+
Omit<
|
|
32
|
+
React.DetailedHTMLProps<
|
|
33
|
+
React.HTMLAttributes<HTMLDivElement>,
|
|
34
|
+
HTMLDivElement
|
|
35
|
+
>,
|
|
36
|
+
'color' | 'onChange'
|
|
37
|
+
> {}
|
|
32
38
|
|
|
33
39
|
declare const RangeSelector: React.FC<
|
|
34
|
-
RangeSelectorProps &
|
|
40
|
+
RangeSelectorProps &
|
|
41
|
+
Omit<
|
|
42
|
+
React.DetailedHTMLProps<
|
|
43
|
+
React.HTMLAttributes<HTMLDivElement>,
|
|
44
|
+
HTMLDivElement
|
|
45
|
+
>,
|
|
46
|
+
'color'
|
|
47
|
+
>
|
|
35
48
|
>;
|
|
36
49
|
|
|
37
50
|
export { RangeSelector };
|
|
@@ -7,7 +7,8 @@ export interface RoutedAnchorProps {
|
|
|
7
7
|
path: string;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
declare const RoutedAnchor: React.ComponentClass<
|
|
11
|
-
Omit<AnchorProps, 'href'
|
|
10
|
+
declare const RoutedAnchor: React.ComponentClass<
|
|
11
|
+
RoutedAnchorProps & Omit<AnchorProps, 'href'>
|
|
12
|
+
>;
|
|
12
13
|
|
|
13
14
|
export { RoutedAnchor };
|
|
@@ -6,7 +6,8 @@ export interface RoutedButtonProps {
|
|
|
6
6
|
method?: 'push' | 'replace';
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
declare const RoutedButton: React.ComponentClass<
|
|
10
|
-
ButtonProps
|
|
9
|
+
declare const RoutedButton: React.ComponentClass<
|
|
10
|
+
RoutedButtonProps & ButtonProps
|
|
11
|
+
>;
|
|
11
12
|
|
|
12
13
|
export { RoutedButton };
|
|
@@ -331,8 +331,7 @@ var Select = exports.Select = /*#__PURE__*/(0, _react.forwardRef)(function (_ref
|
|
|
331
331
|
type: "text",
|
|
332
332
|
name: name,
|
|
333
333
|
id: id ? id + "__input" : undefined,
|
|
334
|
-
inert:
|
|
335
|
-
,
|
|
334
|
+
inert: _utils2.inertTrueValue,
|
|
336
335
|
value: inputValue,
|
|
337
336
|
ref: inputRef,
|
|
338
337
|
readOnly: true
|
|
@@ -340,8 +339,7 @@ var Select = exports.Select = /*#__PURE__*/(0, _react.forwardRef)(function (_ref
|
|
|
340
339
|
a11yTitle: (ariaLabel || a11yTitle) && "" + (ariaLabel || a11yTitle) + (value && typeof value === 'string' ? ", " + value : ''),
|
|
341
340
|
disabled: disabled,
|
|
342
341
|
id: id,
|
|
343
|
-
inert:
|
|
344
|
-
,
|
|
342
|
+
inert: _utils2.inertTrueValue,
|
|
345
343
|
name: name,
|
|
346
344
|
ref: inputRef,
|
|
347
345
|
placeholder: placeholder,
|
|
@@ -63,7 +63,13 @@ export interface SelectProps extends BasicSelectProps {
|
|
|
63
63
|
// value, name, id, onChange, placeholder
|
|
64
64
|
export interface SelectExtendedProps
|
|
65
65
|
extends SelectProps,
|
|
66
|
-
Omit<
|
|
66
|
+
Omit<
|
|
67
|
+
React.DetailedHTMLProps<
|
|
68
|
+
React.InputHTMLAttributes<HTMLInputElement>,
|
|
69
|
+
HTMLInputElement
|
|
70
|
+
>,
|
|
71
|
+
keyof SelectProps | 'readOnly'
|
|
72
|
+
> {}
|
|
67
73
|
|
|
68
74
|
declare const Select: React.FC<SelectExtendedProps>;
|
|
69
75
|
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.useDisabled = exports.getSelectIcon = exports.getOptionValue = exports.getOptionLabel = exports.getOptionIndex = exports.getNormalizedValue = exports.getIconColor = exports.getDisplayLabelKey = exports.formatValueForA11y = exports.changeEvent = exports.arrayIncludes = exports.applyKey = void 0;
|
|
5
|
-
var _react = require("react");
|
|
4
|
+
exports.useDisabled = exports.inertTrueValue = exports.getSelectIcon = exports.getOptionValue = exports.getOptionLabel = exports.getOptionIndex = exports.getNormalizedValue = exports.getIconColor = exports.getDisplayLabelKey = exports.formatValueForA11y = exports.changeEvent = exports.arrayIncludes = exports.applyKey = void 0;
|
|
5
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
6
6
|
var _utils = require("../../utils");
|
|
7
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
8
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
7
9
|
var _applyKey = exports.applyKey = function applyKey(option, key) {
|
|
8
10
|
if (/*#__PURE__*/(0, _react.isValidElement)(option)) return option;
|
|
9
11
|
if (option === undefined || option === null) return undefined;
|
|
@@ -107,4 +109,11 @@ var _formatValueForA11y = exports.formatValueForA11y = function formatValueForA1
|
|
|
107
109
|
}).join(', ');
|
|
108
110
|
}
|
|
109
111
|
return _applyKey(value, labelKey);
|
|
110
|
-
};
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
// In react 18 and below the inert attribute is not supported
|
|
115
|
+
// so we use an empty string instead of true. In react 19 and above
|
|
116
|
+
// inert is supported so we should use true. The use function is
|
|
117
|
+
// used to determine the react version because it is only available
|
|
118
|
+
// in react 19 and above.
|
|
119
|
+
var inertTrueValue = exports.inertTrueValue = _react["default"].use ? true : '';
|
|
@@ -409,8 +409,7 @@ var SelectMultiple = exports.SelectMultiple = /*#__PURE__*/(0, _react.forwardRef
|
|
|
409
409
|
defaultCursor: disabled === true || undefined,
|
|
410
410
|
focusIndicator: false,
|
|
411
411
|
id: id ? id + "__input" : undefined,
|
|
412
|
-
inert:
|
|
413
|
-
,
|
|
412
|
+
inert: _utils2.inertTrueValue,
|
|
414
413
|
name: name,
|
|
415
414
|
width: "100%"
|
|
416
415
|
}, rest, {
|
|
@@ -433,8 +432,7 @@ var SelectMultiple = exports.SelectMultiple = /*#__PURE__*/(0, _react.forwardRef
|
|
|
433
432
|
type: "text",
|
|
434
433
|
name: name,
|
|
435
434
|
id: id ? id + "__input" : undefined,
|
|
436
|
-
inert:
|
|
437
|
-
,
|
|
435
|
+
inert: _utils2.inertTrueValue,
|
|
438
436
|
value: inputValue,
|
|
439
437
|
ref: inputRef,
|
|
440
438
|
readOnly: true
|
|
@@ -444,8 +442,7 @@ var SelectMultiple = exports.SelectMultiple = /*#__PURE__*/(0, _react.forwardRef
|
|
|
444
442
|
a11yTitle: ariaLabel || a11yTitle,
|
|
445
443
|
disabled: disabled,
|
|
446
444
|
id: id,
|
|
447
|
-
inert:
|
|
448
|
-
,
|
|
445
|
+
inert: _utils2.inertTrueValue,
|
|
449
446
|
name: name,
|
|
450
447
|
ref: inputRef,
|
|
451
448
|
placeholder: placeholder || 'Select',
|
|
@@ -472,8 +469,7 @@ var SelectMultiple = exports.SelectMultiple = /*#__PURE__*/(0, _react.forwardRef
|
|
|
472
469
|
type: "text",
|
|
473
470
|
name: name,
|
|
474
471
|
id: id ? id + "__input" : undefined,
|
|
475
|
-
inert:
|
|
476
|
-
,
|
|
472
|
+
inert: _utils2.inertTrueValue,
|
|
477
473
|
value: inputValue,
|
|
478
474
|
ref: inputRef,
|
|
479
475
|
readOnly: true
|
|
@@ -481,8 +477,7 @@ var SelectMultiple = exports.SelectMultiple = /*#__PURE__*/(0, _react.forwardRef
|
|
|
481
477
|
a11yTitle: ariaLabel || a11yTitle,
|
|
482
478
|
disabled: disabled,
|
|
483
479
|
id: id,
|
|
484
|
-
inert:
|
|
485
|
-
,
|
|
480
|
+
inert: _utils2.inertTrueValue,
|
|
486
481
|
name: name,
|
|
487
482
|
ref: inputRef,
|
|
488
483
|
placeholder: placeholder,
|
|
@@ -372,8 +372,7 @@ var SelectMultipleContainer = exports.SelectMultipleContainer = /*#__PURE__*/(0,
|
|
|
372
372
|
tabIndex: "-1",
|
|
373
373
|
checked: optionSelected,
|
|
374
374
|
disabled: optionDisabled,
|
|
375
|
-
inert:
|
|
376
|
-
,
|
|
375
|
+
inert: _utils2.inertTrueValue,
|
|
377
376
|
containerProps: {
|
|
378
377
|
// in Firefox when we have inert set, the checkbox
|
|
379
378
|
// click event gets swallowed by the checkbox.
|
|
@@ -407,8 +406,7 @@ var SelectMultipleContainer = exports.SelectMultipleContainer = /*#__PURE__*/(0,
|
|
|
407
406
|
tabIndex: "-1",
|
|
408
407
|
checked: optionSelected,
|
|
409
408
|
disabled: optionDisabled,
|
|
410
|
-
inert:
|
|
411
|
-
,
|
|
409
|
+
inert: _utils2.inertTrueValue,
|
|
412
410
|
containerProps: {
|
|
413
411
|
// in Firefox when we have inert set, the checkbox
|
|
414
412
|
// click event gets swallowed by the checkbox.
|
|
@@ -107,8 +107,7 @@ var SelectMultipleValue = exports.SelectMultipleValue = function SelectMultipleV
|
|
|
107
107
|
pad: "xsmall",
|
|
108
108
|
tabIndex: "-1",
|
|
109
109
|
checked: optionSelected,
|
|
110
|
-
inert:
|
|
111
|
-
,
|
|
110
|
+
inert: _utils.inertTrueValue,
|
|
112
111
|
containerProps: {
|
|
113
112
|
// in Firefox when we have inert set, the checkbox
|
|
114
113
|
// click event gets swallowed by the checkbox.
|
|
@@ -31,7 +31,13 @@ export interface SelectMultipleProps extends BasicSelectProps {
|
|
|
31
31
|
// value, name, id, onChange, placeholder
|
|
32
32
|
export interface SelectMultipleExtendedProps
|
|
33
33
|
extends SelectMultipleProps,
|
|
34
|
-
Omit<
|
|
34
|
+
Omit<
|
|
35
|
+
React.DetailedHTMLProps<
|
|
36
|
+
React.InputHTMLAttributes<HTMLInputElement>,
|
|
37
|
+
HTMLInputElement
|
|
38
|
+
>,
|
|
39
|
+
keyof SelectMultipleProps
|
|
40
|
+
> {}
|
|
35
41
|
|
|
36
42
|
declare const SelectMultiple: React.FC<SelectMultipleExtendedProps>;
|
|
37
43
|
|
|
@@ -6,7 +6,10 @@ export interface SidebarProps {
|
|
|
6
6
|
header?: React.ReactNode;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
type divProps = Omit<
|
|
9
|
+
type divProps = Omit<
|
|
10
|
+
React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
|
|
11
|
+
'onClick'
|
|
12
|
+
>;
|
|
10
13
|
|
|
11
14
|
export interface SidebarExtendedProps
|
|
12
15
|
extends BoxProps,
|
|
@@ -27,7 +27,10 @@ export interface StackProps {
|
|
|
27
27
|
margin?: MarginType;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
type divProps =
|
|
30
|
+
type divProps = React.DetailedHTMLProps<
|
|
31
|
+
React.HTMLAttributes<HTMLDivElement>,
|
|
32
|
+
HTMLDivElement
|
|
33
|
+
>;
|
|
31
34
|
|
|
32
35
|
export interface StackExtendedProps extends StackProps, divProps {}
|
|
33
36
|
|
|
@@ -12,7 +12,13 @@ export interface TabProps {
|
|
|
12
12
|
|
|
13
13
|
export interface TabExtendedProps
|
|
14
14
|
extends TabProps,
|
|
15
|
-
Omit<
|
|
15
|
+
Omit<
|
|
16
|
+
React.DetailedHTMLProps<
|
|
17
|
+
React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
18
|
+
HTMLButtonElement
|
|
19
|
+
>,
|
|
20
|
+
'title'
|
|
21
|
+
> {}
|
|
16
22
|
|
|
17
23
|
declare const Tab: React.FC<TabExtendedProps>;
|
|
18
24
|
|
|
@@ -14,7 +14,10 @@ export interface TableProps {
|
|
|
14
14
|
margin?: MarginType;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
type htmlTableProps =
|
|
17
|
+
type htmlTableProps = React.DetailedHTMLProps<
|
|
18
|
+
React.HTMLAttributes<HTMLTableElement>,
|
|
19
|
+
HTMLTableElement
|
|
20
|
+
>;
|
|
18
21
|
|
|
19
22
|
export interface TableExtendedProps extends TableProps, htmlTableProps {}
|
|
20
23
|
|
|
@@ -2,7 +2,10 @@ import * as React from 'react';
|
|
|
2
2
|
|
|
3
3
|
export interface TableBodyProps {}
|
|
4
4
|
|
|
5
|
-
type htmlTableBodyProps =
|
|
5
|
+
type htmlTableBodyProps = React.DetailedHTMLProps<
|
|
6
|
+
React.HTMLAttributes<HTMLTableSectionElement>,
|
|
7
|
+
HTMLTableSectionElement
|
|
8
|
+
>;
|
|
6
9
|
|
|
7
10
|
export interface TableBodyExtendedProps
|
|
8
11
|
extends TableBodyProps,
|
|
@@ -22,12 +22,19 @@ export interface TableCellProps {
|
|
|
22
22
|
verticalAlign?: 'top' | 'middle' | 'bottom';
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
// We combine BoxTypes &
|
|
26
|
-
// is a combination of BoxProps &
|
|
25
|
+
// We combine BoxTypes & React.DetailedHTMLProps<React.TdHTMLAttributes<HTMLTableCellElement>, HTMLTableCellElement> inline here since BoxTypes
|
|
26
|
+
// is a combination of BoxProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, and there is a
|
|
27
27
|
// large overlap between td and div attributes.
|
|
28
28
|
export interface TableCellExtendedProps
|
|
29
29
|
extends TableCellProps,
|
|
30
|
-
Omit<
|
|
30
|
+
Omit<
|
|
31
|
+
BoxTypes &
|
|
32
|
+
React.DetailedHTMLProps<
|
|
33
|
+
React.TdHTMLAttributes<HTMLTableCellElement>,
|
|
34
|
+
HTMLTableCellElement
|
|
35
|
+
>,
|
|
36
|
+
'scope'
|
|
37
|
+
> {}
|
|
31
38
|
|
|
32
39
|
declare const TableCell: React.FC<TableCellExtendedProps>;
|
|
33
40
|
|
|
@@ -2,7 +2,10 @@ import * as React from 'react';
|
|
|
2
2
|
|
|
3
3
|
export interface TableFooterProps {}
|
|
4
4
|
|
|
5
|
-
type htmlTableFooterProps =
|
|
5
|
+
type htmlTableFooterProps = React.DetailedHTMLProps<
|
|
6
|
+
React.HTMLAttributes<HTMLTableSectionElement>,
|
|
7
|
+
HTMLTableSectionElement
|
|
8
|
+
>;
|
|
6
9
|
|
|
7
10
|
export interface TableFooterExtendedProps
|
|
8
11
|
extends TableFooterProps,
|
|
@@ -2,7 +2,10 @@ import * as React from 'react';
|
|
|
2
2
|
|
|
3
3
|
export interface TableHeaderProps {}
|
|
4
4
|
|
|
5
|
-
type htmlTableHeaderProps =
|
|
5
|
+
type htmlTableHeaderProps = React.DetailedHTMLProps<
|
|
6
|
+
React.HTMLAttributes<HTMLTableSectionElement>,
|
|
7
|
+
HTMLTableSectionElement
|
|
8
|
+
>;
|
|
6
9
|
|
|
7
10
|
export interface TableHeaderExtendedProps
|
|
8
11
|
extends TableHeaderProps,
|
|
@@ -2,7 +2,10 @@ import * as React from 'react';
|
|
|
2
2
|
|
|
3
3
|
export interface TableRowProps {}
|
|
4
4
|
|
|
5
|
-
type htmlTableRowProps =
|
|
5
|
+
type htmlTableRowProps = React.DetailedHTMLProps<
|
|
6
|
+
React.HTMLAttributes<HTMLTableRowElement>,
|
|
7
|
+
HTMLTableRowElement
|
|
8
|
+
>;
|
|
6
9
|
|
|
7
10
|
export interface TableRowExtendedProps
|
|
8
11
|
extends TableRowProps,
|
|
@@ -20,7 +20,10 @@ export interface TabsProps {
|
|
|
20
20
|
onActive?: (index: number) => void;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
type divProps = Omit<
|
|
23
|
+
type divProps = Omit<
|
|
24
|
+
React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
|
|
25
|
+
'children'
|
|
26
|
+
>;
|
|
24
27
|
|
|
25
28
|
export interface TabsExtendedProps extends TabsProps, divProps {}
|
|
26
29
|
|
package/components/Tag/Tag.js
CHANGED
|
@@ -9,7 +9,8 @@ var _Box = require("../Box");
|
|
|
9
9
|
var _Text = require("../Text");
|
|
10
10
|
var _StyledTag = require("./StyledTag");
|
|
11
11
|
var _useThemeValue2 = require("../../utils/useThemeValue");
|
|
12
|
-
var
|
|
12
|
+
var _MessageContext = require("../../contexts/MessageContext");
|
|
13
|
+
var _excluded = ["name", "value", "size", "onRemove", "onClick", "messages"];
|
|
13
14
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
14
15
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
15
16
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
@@ -22,11 +23,23 @@ var Tag = exports.Tag = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
|
|
|
22
23
|
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
23
24
|
onRemove = _ref.onRemove,
|
|
24
25
|
onClick = _ref.onClick,
|
|
26
|
+
messages = _ref.messages,
|
|
25
27
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
28
|
+
var _useContext = (0, _react.useContext)(_MessageContext.MessageContext),
|
|
29
|
+
format = _useContext.format;
|
|
26
30
|
var _useThemeValue = (0, _useThemeValue2.useThemeValue)(),
|
|
27
31
|
theme = _useThemeValue.theme,
|
|
28
32
|
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
29
33
|
var RemoveIcon = ((_theme$tag$icons = theme.tag.icons) == null ? void 0 : _theme$tag$icons.remove) || _FormClose.FormClose;
|
|
34
|
+
var removeLabelId = name ? 'tag.removeLabel.nameAndValue' : 'tag.removeLabel.valueOnly';
|
|
35
|
+
var removeLabel = format({
|
|
36
|
+
id: removeLabelId,
|
|
37
|
+
messages: messages,
|
|
38
|
+
values: {
|
|
39
|
+
name: name,
|
|
40
|
+
value: value
|
|
41
|
+
}
|
|
42
|
+
});
|
|
30
43
|
var containerProps = _extends({
|
|
31
44
|
ref: ref,
|
|
32
45
|
align: 'center',
|
|
@@ -65,6 +78,7 @@ var Tag = exports.Tag = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
|
|
|
65
78
|
}, containerProps), contents, onRemove && /*#__PURE__*/_react["default"].createElement(_StyledTag.StyledRemoveButton, _extends({
|
|
66
79
|
onClick: onRemove
|
|
67
80
|
}, removeProps, {
|
|
81
|
+
"aria-label": removeLabel,
|
|
68
82
|
icon: /*#__PURE__*/_react["default"].createElement(RemoveIcon, (_theme$tag$size3 = theme.tag.size) == null || (_theme$tag$size3 = _theme$tag$size3[size]) == null ? void 0 : _theme$tag$size3.icon),
|
|
69
83
|
round: ((_theme$tag$size4 = theme.tag.size) == null || (_theme$tag$size4 = _theme$tag$size4[size]) == null ? void 0 : _theme$tag$size4.round) || theme.tag.round
|
|
70
84
|
}, theme.tag.remove, (_theme$tag$size5 = theme.tag.size) == null || (_theme$tag$size5 = _theme$tag$size5[size]) == null ? void 0 : _theme$tag$size5.remove, passThemeFlag))) : /*#__PURE__*/_react["default"].createElement(_StyledTag.StyledTagButton, _extends({
|
|
@@ -11,6 +11,12 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
11
11
|
value: _propTypes["default"].string.isRequired,
|
|
12
12
|
onClick: _propTypes["default"].func,
|
|
13
13
|
onRemove: _propTypes["default"].func,
|
|
14
|
+
messages: _propTypes["default"].shape({
|
|
15
|
+
removeLabel: _propTypes["default"].shape({
|
|
16
|
+
nameAndValue: _propTypes["default"].string,
|
|
17
|
+
valueOnly: _propTypes["default"].string
|
|
18
|
+
})
|
|
19
|
+
}),
|
|
14
20
|
size: _propTypes["default"].oneOfType([_propTypes["default"].oneOf(['xsmall', 'small', 'medium', 'large', 'xlarge']), _propTypes["default"].string])
|
|
15
21
|
};
|
|
16
22
|
}
|
package/components/Text/Text.js
CHANGED
|
@@ -78,18 +78,19 @@ var Text = exports.Text = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
|
|
|
78
78
|
}), children !== undefined ? /*#__PURE__*/_react["default"].createElement(_TextContext.TextContext.Provider, {
|
|
79
79
|
value: textContextValue
|
|
80
80
|
}, children) : undefined);
|
|
81
|
+
var tipProps = tipProp && typeof tipProp === 'object' ? tipProp : {};
|
|
81
82
|
if (tipProp || textTruncated) {
|
|
82
83
|
// place the text content in a tip if truncate === 'tip'
|
|
83
84
|
// and the text has been truncated
|
|
84
85
|
if (textTruncated) {
|
|
85
86
|
return /*#__PURE__*/_react["default"].createElement(_Tip.Tip, _extends({
|
|
86
87
|
content: children
|
|
87
|
-
},
|
|
88
|
+
}, tipProps), styledTextResult);
|
|
88
89
|
}
|
|
89
90
|
// place the text content in a tip if truncate !== 'tip'
|
|
90
91
|
// it displays even if the text has not truncated
|
|
91
92
|
if (truncate !== 'tip') {
|
|
92
|
-
return /*#__PURE__*/_react["default"].createElement(_Tip.Tip,
|
|
93
|
+
return /*#__PURE__*/_react["default"].createElement(_Tip.Tip, tipProps, styledTextResult);
|
|
93
94
|
}
|
|
94
95
|
}
|
|
95
96
|
return styledTextResult;
|
|
@@ -43,7 +43,13 @@ export interface TextProps {
|
|
|
43
43
|
}
|
|
44
44
|
export interface TextExtendedProps
|
|
45
45
|
extends TextProps,
|
|
46
|
-
Omit<
|
|
46
|
+
Omit<
|
|
47
|
+
React.DetailedHTMLProps<
|
|
48
|
+
React.HTMLAttributes<HTMLSpanElement>,
|
|
49
|
+
HTMLSpanElement
|
|
50
|
+
>,
|
|
51
|
+
'color'
|
|
52
|
+
> {}
|
|
47
53
|
|
|
48
54
|
declare const Text: React.FC<TextExtendedProps>;
|
|
49
55
|
export type TextType = TextProps;
|
|
@@ -14,7 +14,13 @@ export interface TextAreaProps {
|
|
|
14
14
|
value?: string;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
type textareaProps = Omit<
|
|
17
|
+
type textareaProps = Omit<
|
|
18
|
+
React.DetailedHTMLProps<
|
|
19
|
+
React.TextareaHTMLAttributes<HTMLTextAreaElement>,
|
|
20
|
+
HTMLTextAreaElement
|
|
21
|
+
>,
|
|
22
|
+
'value'
|
|
23
|
+
>;
|
|
18
24
|
|
|
19
25
|
export interface TextAreaExtendedProps extends TextAreaProps, textareaProps {}
|
|
20
26
|
|
|
@@ -340,7 +340,8 @@ var TextInput = exports.TextInput = /*#__PURE__*/(0, _react.forwardRef)(function
|
|
|
340
340
|
},
|
|
341
341
|
onMouseMove: mouseMovedSinceLastKey && activeSuggestionIndex !== index ? function () {
|
|
342
342
|
return setActiveSuggestionIndex(index);
|
|
343
|
-
} : undefined
|
|
343
|
+
} : undefined,
|
|
344
|
+
keyboard: !mouseMovedSinceLastKey
|
|
344
345
|
}, child));
|
|
345
346
|
}))));
|
|
346
347
|
}
|
|
@@ -397,7 +398,10 @@ var TextInput = exports.TextInput = /*#__PURE__*/(0, _react.forwardRef)(function
|
|
|
397
398
|
,
|
|
398
399
|
readOnlyCopy: readOnlyCopy,
|
|
399
400
|
plain: plain,
|
|
400
|
-
border: !plain
|
|
401
|
+
border: !plain,
|
|
402
|
+
onMouseMove: function onMouseMove() {
|
|
403
|
+
return setMouseMovedSinceLastKey(true);
|
|
404
|
+
}
|
|
401
405
|
}, passThemeFlag), reverse && readOnlyCopy && ReadOnlyCopyButton, showStyledPlaceholder && /*#__PURE__*/_react["default"].createElement(_StyledTextInput.StyledPlaceholder, passThemeFlag, placeholder), textInputIcon && !readOnly && /*#__PURE__*/_react["default"].createElement(_StyledTextInput.StyledIcon, {
|
|
402
406
|
reverse: reverse,
|
|
403
407
|
theme: theme
|
|
@@ -10,7 +10,10 @@ import { DropType } from '../Drop';
|
|
|
10
10
|
|
|
11
11
|
export interface TextInputProps
|
|
12
12
|
extends Omit<
|
|
13
|
-
|
|
13
|
+
React.DetailedHTMLProps<
|
|
14
|
+
React.InputHTMLAttributes<HTMLInputElement>,
|
|
15
|
+
HTMLInputElement
|
|
16
|
+
>,
|
|
14
17
|
'onSelect' | 'size' | 'placeholder' | 'width'
|
|
15
18
|
> {
|
|
16
19
|
a11yTitle?: A11yTitleType;
|
|
@@ -35,11 +38,11 @@ export interface TextInputProps
|
|
|
35
38
|
};
|
|
36
39
|
name?: string;
|
|
37
40
|
onSelect?: (x: {
|
|
38
|
-
target: React.RefObject<HTMLElement>['current'];
|
|
41
|
+
target: React.RefObject<HTMLElement | null>['current'];
|
|
39
42
|
suggestion: any;
|
|
40
43
|
}) => void;
|
|
41
44
|
onSuggestionSelect?: (x: {
|
|
42
|
-
target: React.RefObject<HTMLElement>['current'];
|
|
45
|
+
target: React.RefObject<HTMLElement | null>['current'];
|
|
43
46
|
suggestion: any;
|
|
44
47
|
}) => void;
|
|
45
48
|
onSuggestionsOpen?: () => void;
|
|
@@ -99,7 +99,7 @@ export const CustomSuggestions = () => {
|
|
|
99
99
|
const [value, setValue] = useState('');
|
|
100
100
|
const [suggestionOpen, setSuggestionOpen] = useState(false);
|
|
101
101
|
const [suggestions, setSuggestions] = useState([]);
|
|
102
|
-
const boxRef = useRef();
|
|
102
|
+
const boxRef = useRef(undefined);
|
|
103
103
|
|
|
104
104
|
const onChange = useCallback((event) => {
|
|
105
105
|
const { value: newValue } = event.target;
|
|
@@ -156,6 +156,7 @@ export const CustomSuggestions = () => {
|
|
|
156
156
|
>
|
|
157
157
|
<Search color="brand" />
|
|
158
158
|
<TextInput
|
|
159
|
+
id="grommet-custom-suggestions"
|
|
159
160
|
dropTarget={boxRef.current}
|
|
160
161
|
placeholder="Enter your name..."
|
|
161
162
|
plain
|
|
@@ -61,6 +61,7 @@ var Themed = exports.Themed = function Themed() {
|
|
|
61
61
|
}, /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
62
62
|
width: "medium"
|
|
63
63
|
}, /*#__PURE__*/_react["default"].createElement(_grommet.TextInput, {
|
|
64
|
+
id: "grommet-password",
|
|
64
65
|
type: "password",
|
|
65
66
|
value: value,
|
|
66
67
|
dropProps: {
|
|
@@ -35,6 +35,7 @@ var OnSelect = exports.OnSelect = function OnSelect() {
|
|
|
35
35
|
}, /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
36
36
|
width: "medium"
|
|
37
37
|
}, /*#__PURE__*/_react["default"].createElement(_grommet.TextInput, {
|
|
38
|
+
id: "grommet-onselect",
|
|
38
39
|
value: value,
|
|
39
40
|
onChange: onChange,
|
|
40
41
|
onSelect: onHighlight,
|
|
@@ -140,6 +140,7 @@ var WithTags = exports.WithTags = function WithTags() {
|
|
|
140
140
|
_react["default"].createElement(_grommet.Box, {
|
|
141
141
|
pad: "small"
|
|
142
142
|
}, /*#__PURE__*/_react["default"].createElement(TagInput, {
|
|
143
|
+
id: "grommet-tag-input",
|
|
143
144
|
placeholder: "Search for aliases...",
|
|
144
145
|
suggestions: suggestions,
|
|
145
146
|
value: selectedTags,
|
package/components/Tip/Tip.js
CHANGED
|
@@ -12,6 +12,21 @@ var _useThemeValue2 = require("../../utils/useThemeValue");
|
|
|
12
12
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
13
13
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
14
14
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
15
|
+
/*
|
|
16
|
+
* This function getReactNodeRef is adapted from
|
|
17
|
+
* [Material UI] (https://github.com/mui/material-ui)
|
|
18
|
+
* Licensed under the MIT License (c) 2024 aarongarciah
|
|
19
|
+
* The function has been modified from its original version.
|
|
20
|
+
*/
|
|
21
|
+
var getReactNodeRef = function getReactNodeRef(element) {
|
|
22
|
+
if (!element || ! /*#__PURE__*/_react["default"].isValidElement(element)) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// 'ref' is passed as prop in React 19, whereas 'ref' is directly attached to
|
|
27
|
+
// children in older versions
|
|
28
|
+
return {}.propertyIsEnumerable.call(element.props, 'ref') ? element.props.ref : element.ref;
|
|
29
|
+
};
|
|
15
30
|
var Tip = exports.Tip = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, tipRef) {
|
|
16
31
|
var children = _ref.children,
|
|
17
32
|
content = _ref.content,
|
|
@@ -66,7 +81,7 @@ var Tip = exports.Tip = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, tipR
|
|
|
66
81
|
componentRef.current = node;
|
|
67
82
|
}
|
|
68
83
|
// Call the original ref, if any
|
|
69
|
-
var callerRef = child
|
|
84
|
+
var callerRef = getReactNodeRef(child);
|
|
70
85
|
if (typeof callerRef === 'function') {
|
|
71
86
|
callerRef(node);
|
|
72
87
|
} else if (callerRef) {
|