@datarobot/design-system 30.6.4 → 30.8.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/cjs/button/button.d.ts +21 -21
- package/cjs/chat/chat-message-body.js +9 -7
- package/cjs/chat/utils.js +5 -1
- package/cjs/datetime-picker/datetime-picker.d.ts +2 -2
- package/cjs/datetime-range-picker/helpers.d.ts +12 -12
- package/cjs/dropdown-menu/dropdown-menu-content.d.ts +1 -1
- package/cjs/dropdown-menu/utils.d.ts +30 -31
- package/cjs/file-uploader/file-uploader-hook.d.ts +1 -1
- package/cjs/floating-panel/constants.d.ts +0 -1
- package/cjs/font-awesome-icon/font-awesome-icon.d.ts +0 -1
- package/cjs/form-field/utilities.d.ts +1 -1
- package/cjs/full-screen-drawer/useFullScreenDrawer.d.ts +0 -1
- package/cjs/hooks/use-analytics/use-analytics.d.ts +13 -13
- package/cjs/hooks/use-focus-trap/use-focus-trap.d.ts +0 -1
- package/cjs/hooks/use-non-native-button-attrs/use-non-native-button-attrs.d.ts +2 -2
- package/cjs/hooks/use-ordering/use-ordering.d.ts +0 -1
- package/cjs/hooks/use-paginated-search/use-paginated-search.d.ts +2 -2
- package/cjs/hooks/use-translation/use-translation.d.ts +20 -19
- package/cjs/input/input.d.ts +54 -54
- package/cjs/range-slider/context.d.ts +0 -1
- package/cjs/table/hooks/use-checkbox-cells-state/use-checkbox-cells-state.d.ts +0 -1
- package/cjs/table-react/hooks/useTableReact.d.ts +3 -3
- package/cjs/table-react/utils/getHeaderColumnsActions.d.ts +1 -1
- package/cjs/text-editor/edited-text.js +12 -4
- package/cjs/text-editor/text-editor.js +8 -1
- package/cjs/textarea/textarea.d.ts +2 -2
- package/cjs/time-from-now/time-from-now.d.ts +1 -1
- package/cjs/tour/advanced-tour/hooks.d.ts +0 -1
- package/cjs/tour/hooks.d.ts +0 -1
- package/cjs/typeahead/use-visible-options.d.ts +3 -3
- package/esm/button/button.d.ts +21 -21
- package/esm/chat/chat-message-body.js +9 -7
- package/esm/chat/utils.js +4 -1
- package/esm/datetime-picker/datetime-picker.d.ts +2 -2
- package/esm/datetime-range-picker/helpers.d.ts +12 -12
- package/esm/dropdown-menu/dropdown-menu-content.d.ts +1 -1
- package/esm/dropdown-menu/utils.d.ts +30 -31
- package/esm/file-uploader/file-uploader-hook.d.ts +1 -1
- package/esm/floating-panel/constants.d.ts +0 -1
- package/esm/font-awesome-icon/font-awesome-icon.d.ts +0 -1
- package/esm/form-field/utilities.d.ts +1 -1
- package/esm/full-screen-drawer/useFullScreenDrawer.d.ts +0 -1
- package/esm/hooks/use-analytics/use-analytics.d.ts +13 -13
- package/esm/hooks/use-focus-trap/use-focus-trap.d.ts +0 -1
- package/esm/hooks/use-non-native-button-attrs/use-non-native-button-attrs.d.ts +2 -2
- package/esm/hooks/use-ordering/use-ordering.d.ts +0 -1
- package/esm/hooks/use-paginated-search/use-paginated-search.d.ts +2 -2
- package/esm/hooks/use-translation/use-translation.d.ts +20 -19
- package/esm/input/input.d.ts +54 -54
- package/esm/range-slider/context.d.ts +0 -1
- package/esm/table/hooks/use-checkbox-cells-state/use-checkbox-cells-state.d.ts +0 -1
- package/esm/table-react/hooks/useTableReact.d.ts +3 -3
- package/esm/table-react/utils/getHeaderColumnsActions.d.ts +1 -1
- package/esm/text-editor/edited-text.js +12 -4
- package/esm/text-editor/text-editor.js +8 -1
- package/esm/textarea/textarea.d.ts +2 -2
- package/esm/time-from-now/time-from-now.d.ts +1 -1
- package/esm/tour/advanced-tour/hooks.d.ts +0 -1
- package/esm/tour/hooks.d.ts +0 -1
- package/esm/typeahead/use-visible-options.d.ts +3 -3
- package/js/bundle/bundle.js +89 -18
- package/js/bundle/bundle.min.js +1 -1
- package/js/bundle/index.d.ts +135 -134
- package/package.json +55 -55
|
@@ -42,7 +42,7 @@ export declare function useTableReact<FiltersData>({ tableId, version, debounceS
|
|
|
42
42
|
};
|
|
43
43
|
reset: () => void;
|
|
44
44
|
defaultState: {
|
|
45
|
-
defaultColumnSizing?: ColumnSizingState
|
|
45
|
+
defaultColumnSizing?: ColumnSizingState;
|
|
46
46
|
sorting: SortingState;
|
|
47
47
|
visible: {};
|
|
48
48
|
pagination: PaginationState;
|
|
@@ -51,7 +51,7 @@ export declare function useTableReact<FiltersData>({ tableId, version, debounceS
|
|
|
51
51
|
selected: {};
|
|
52
52
|
expandedRows: {};
|
|
53
53
|
columnOrder: ColumnOrderState;
|
|
54
|
-
touched?: Touched
|
|
54
|
+
touched?: Touched;
|
|
55
55
|
filters?: FiltersData | undefined;
|
|
56
56
|
columnSizing: {};
|
|
57
57
|
} | {
|
|
@@ -64,7 +64,7 @@ export declare function useTableReact<FiltersData>({ tableId, version, debounceS
|
|
|
64
64
|
selected: {};
|
|
65
65
|
expandedRows: {};
|
|
66
66
|
columnOrder: ColumnOrderState;
|
|
67
|
-
touched?: Touched
|
|
67
|
+
touched?: Touched;
|
|
68
68
|
filters?: FiltersData | undefined;
|
|
69
69
|
};
|
|
70
70
|
};
|
|
@@ -7,6 +7,7 @@ exports.default = EditedText;
|
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
9
|
var _isEqual = _interopRequireDefault(require("lodash-es/isEqual"));
|
|
10
|
+
var _cloneDeep = _interopRequireDefault(require("lodash-es/cloneDeep"));
|
|
10
11
|
var _slateHistory = require("slate-history");
|
|
11
12
|
var _chat = require("../chat");
|
|
12
13
|
var _textEditorContext = _interopRequireDefault(require("./text-editor-context"));
|
|
@@ -37,12 +38,19 @@ function EditedTextComponent({
|
|
|
37
38
|
Slate
|
|
38
39
|
} = slateReact;
|
|
39
40
|
const editor = (0, _react.useMemo)(() => (0, _withLinks.default)((0, _slateHistory.withHistory)(withReact(createEditor()))), []);
|
|
41
|
+
|
|
42
|
+
// Clone the incoming value so this editor instance owns its own Slate node
|
|
43
|
+
// references. slate-dom 0.123+ keys internal WeakMaps by node identity, and
|
|
44
|
+
// sharing node references across editors (e.g. the same value bound to a
|
|
45
|
+
// form's TextEditor and a preview's EditedText at the same time) makes
|
|
46
|
+
// findPath throw "Unable to find the path for Slate node".
|
|
47
|
+
const slateValue = (0, _react.useMemo)(() => value ? (0, _cloneDeep.default)(value) : value, [value]);
|
|
40
48
|
(0, _react.useEffect)(() => {
|
|
41
|
-
if (
|
|
49
|
+
if (slateValue && !(0, _isEqual.default)(editor.children, slateValue)) {
|
|
42
50
|
// Update the cached value inside the editor
|
|
43
|
-
(0, _chat.resetNodes)(editor,
|
|
51
|
+
(0, _chat.resetNodes)(editor, slateValue);
|
|
44
52
|
}
|
|
45
|
-
}, [
|
|
53
|
+
}, [slateValue, editor]);
|
|
46
54
|
const ariaAttrs = (0, _react.useMemo)(() => {
|
|
47
55
|
return {
|
|
48
56
|
'aria-label': ariaLabel
|
|
@@ -53,7 +61,7 @@ function EditedTextComponent({
|
|
|
53
61
|
// Slate throws an error when no onChange is given, providing a noop func to avoid issues
|
|
54
62
|
(0, _jsxRuntime.jsx)(Slate, {
|
|
55
63
|
editor: editor,
|
|
56
|
-
initialValue:
|
|
64
|
+
initialValue: slateValue,
|
|
57
65
|
onChange: () => undefined,
|
|
58
66
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_textEditorContent.default, {
|
|
59
67
|
placeholder: placeholder,
|
|
@@ -7,6 +7,7 @@ exports.default = TextEditor;
|
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
9
|
var _isEqual = _interopRequireDefault(require("lodash-es/isEqual"));
|
|
10
|
+
var _cloneDeep = _interopRequireDefault(require("lodash-es/cloneDeep"));
|
|
10
11
|
var _slateHistory = require("slate-history");
|
|
11
12
|
var _formField = require("../form-field");
|
|
12
13
|
var _chat = require("../chat");
|
|
@@ -79,7 +80,13 @@ function TextEditorComponent({
|
|
|
79
80
|
}, [getCharactersCounterString]);
|
|
80
81
|
const editor = (0, _react.useMemo)(() => (0, _chat.withMaxLength)(maxLength)((0, _withLinks.default)((0, _slateHistory.withHistory)(withReact(createEditor())))), [maxLength]);
|
|
81
82
|
const selection = (0, _react.useRef)(null);
|
|
82
|
-
|
|
83
|
+
// Clone the incoming value so this editor instance owns its own Slate node
|
|
84
|
+
// references. slate-dom 0.123+ keys internal WeakMaps by node identity, and
|
|
85
|
+
// sharing the same node references across editors (e.g. several editors
|
|
86
|
+
// falling back to TEXT_EDITOR_DEFAULT_VALUE, or the same parent state being
|
|
87
|
+
// bound to multiple editors at once) makes findPath throw
|
|
88
|
+
// "Unable to find the path for Slate node".
|
|
89
|
+
const slateValue = (0, _react.useMemo)(() => (0, _cloneDeep.default)(value || initialValue || _textEditorConstants.TEXT_EDITOR_DEFAULT_VALUE), [value, initialValue]);
|
|
83
90
|
(0, _react.useEffect)(() => {
|
|
84
91
|
if (!(0, _isEqual.default)(editor.children, slateValue)) {
|
|
85
92
|
// Update the cached value inside the editor
|
|
@@ -19,6 +19,6 @@ export function TextArea(props: FormFieldProps) {
|
|
|
19
19
|
* [CAPITALIZATION] Don't have mixed format in one text block, use sentence case
|
|
20
20
|
*/
|
|
21
21
|
export declare const TextArea: React.ForwardRefExoticComponent<FormFieldProps & Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & {
|
|
22
|
-
useFont?: boolean
|
|
23
|
-
allowResizing?: boolean | TextAreaResizeValues
|
|
22
|
+
useFont?: boolean;
|
|
23
|
+
allowResizing?: boolean | TextAreaResizeValues;
|
|
24
24
|
} & React.RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -9,6 +9,6 @@ export type TimeFromNowProps = {
|
|
|
9
9
|
tooltipPlacement?: TooltipPlacementsType;
|
|
10
10
|
tooltipDelayType?: TooltipDelayType;
|
|
11
11
|
};
|
|
12
|
-
export declare const getLocalTime: (timestamp: number | string, standard?:
|
|
12
|
+
export declare const getLocalTime: (timestamp: number | string, standard?: "utc") => moment.Moment;
|
|
13
13
|
declare const TimeFromNow: ({ timestamp, format, standard, hideSuffix, showTooltip, tooltipPlacement, tooltipDelayType, }: TimeFromNowProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export default TimeFromNow;
|
package/cjs/tour/hooks.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { TypeaheadOption } from './typeahead';
|
|
2
2
|
export declare const useVisibleOptions: ({ formatSearchValue, searchValue, options, searchFields, isShowAll, }: {
|
|
3
|
-
formatSearchValue?: (
|
|
4
|
-
searchValue?: string
|
|
3
|
+
formatSearchValue?: (value?: string) => string;
|
|
4
|
+
searchValue?: string;
|
|
5
5
|
options: TypeaheadOption[];
|
|
6
|
-
searchFields?: string[]
|
|
6
|
+
searchFields?: string[];
|
|
7
7
|
isShowAll: boolean;
|
|
8
8
|
}) => {
|
|
9
9
|
visibleOptions: TypeaheadOption[];
|
package/esm/button/button.d.ts
CHANGED
|
@@ -66,48 +66,48 @@ export type ButtonProps = {
|
|
|
66
66
|
*/
|
|
67
67
|
declare const Button: React.ForwardRefExoticComponent<{
|
|
68
68
|
/** Specifies an event handler. */
|
|
69
|
-
onClick?: (
|
|
69
|
+
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
70
70
|
/** Specifies content of the button. */
|
|
71
71
|
children?: React.ReactNode;
|
|
72
72
|
/** Specifies the look of the button. */
|
|
73
|
-
accentType?: AccentType
|
|
73
|
+
accentType?: AccentType;
|
|
74
74
|
/** Specifies that a button should automatically get focus when the page loads. */
|
|
75
|
-
autofocus?: boolean
|
|
75
|
+
autofocus?: boolean;
|
|
76
76
|
/** Specifies an additional css class. */
|
|
77
|
-
className?: string
|
|
77
|
+
className?: string;
|
|
78
78
|
/** Specifies that a button should be disabled. */
|
|
79
|
-
isDisabled?: boolean
|
|
79
|
+
isDisabled?: boolean;
|
|
80
80
|
/** Specifies the form element the button belongs to. Should be used for buttons located outside a form. Applicable to buttons of submit type. */
|
|
81
|
-
formId?: string
|
|
81
|
+
formId?: string;
|
|
82
82
|
/** Shows loading icon. */
|
|
83
|
-
isLoading?: boolean
|
|
83
|
+
isLoading?: boolean;
|
|
84
84
|
/** Specifies loading text. */
|
|
85
|
-
loadingText?: string
|
|
85
|
+
loadingText?: string;
|
|
86
86
|
/** Specifies the button size. Note: applicable to round button only. */
|
|
87
|
-
size?: ButtonSize
|
|
87
|
+
size?: ButtonSize;
|
|
88
88
|
/** Specifies the type of button. */
|
|
89
|
-
type?: ButtonType
|
|
89
|
+
type?: ButtonType;
|
|
90
90
|
/** Specifies button width to 100% */
|
|
91
|
-
fullWidth?: boolean
|
|
91
|
+
fullWidth?: boolean;
|
|
92
92
|
/** Specifies button tooltip text. If text is equal to false or empty string tooltip won't be applied */
|
|
93
93
|
tooltipText?: React.ReactNode;
|
|
94
94
|
/** Specifies the tooltip placement of the button. */
|
|
95
|
-
tooltipPlacement?: TooltipPlacementsType
|
|
95
|
+
tooltipPlacement?: TooltipPlacementsType;
|
|
96
96
|
/** Set docs link for the tooltip */
|
|
97
97
|
tooltipDocsLink?: React.ReactNode;
|
|
98
98
|
/** Font Awesome icon for field with left side icon */
|
|
99
|
-
leftIcon?: IconLookup | null
|
|
99
|
+
leftIcon?: IconLookup | null;
|
|
100
100
|
/** Font Awesome icon for field with right side icon */
|
|
101
|
-
rightIcon?: IconLookup | null
|
|
101
|
+
rightIcon?: IconLookup | null;
|
|
102
102
|
/** Used for tests */
|
|
103
|
-
testId?: string
|
|
104
|
-
leftIconTestId?: string
|
|
105
|
-
rightIconTestId?: string
|
|
103
|
+
testId?: string;
|
|
104
|
+
leftIconTestId?: string;
|
|
105
|
+
rightIconTestId?: string;
|
|
106
106
|
/** Used for onboarding tours */
|
|
107
|
-
tourId?: string
|
|
107
|
+
tourId?: string;
|
|
108
108
|
/** Use ariaLabel only when there is not text and icon is the only content. aria-label will work too */
|
|
109
|
-
ariaLabel?: string
|
|
110
|
-
tooltipDelayType?: TooltipDelayType
|
|
111
|
-
hasCustomButtonContent?: boolean
|
|
109
|
+
ariaLabel?: string;
|
|
110
|
+
tooltipDelayType?: TooltipDelayType;
|
|
111
|
+
hasCustomButtonContent?: boolean;
|
|
112
112
|
} & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
113
113
|
export default Button;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useMemo, useState, useCallback, useRef, useEffect, memo } from 'react';
|
|
2
2
|
import isEqual from 'lodash-es/isEqual';
|
|
3
|
+
import cloneDeep from 'lodash-es/cloneDeep';
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import { Editor, createEditor, Transforms, Range } from 'slate';
|
|
5
6
|
import { Slate, Editable, ReactEditor, withReact } from 'slate-react';
|
|
@@ -28,8 +29,9 @@ function ChatMessageBodyBase({
|
|
|
28
29
|
editableContentClassName,
|
|
29
30
|
mentionsPropmptText,
|
|
30
31
|
autoFocus,
|
|
31
|
-
value
|
|
32
|
+
value
|
|
32
33
|
}) {
|
|
34
|
+
const slateValue = useMemo(() => cloneDeep(value ?? DEFAULT_VALUE), [value]);
|
|
33
35
|
const anchorRef = useRef(null);
|
|
34
36
|
const [target, setTarget] = useState();
|
|
35
37
|
const [search, setSearch] = useState('');
|
|
@@ -46,10 +48,10 @@ function ChatMessageBodyBase({
|
|
|
46
48
|
event.preventDefault();
|
|
47
49
|
onSubmit({
|
|
48
50
|
key: itemKey,
|
|
49
|
-
value
|
|
51
|
+
value: slateValue
|
|
50
52
|
});
|
|
51
53
|
}
|
|
52
|
-
}, [mentions, target,
|
|
54
|
+
}, [mentions, target, slateValue, itemKey, onSubmit]);
|
|
53
55
|
const handleChange = useCallback(val => {
|
|
54
56
|
onChange({
|
|
55
57
|
key: itemKey,
|
|
@@ -116,14 +118,14 @@ function ChatMessageBodyBase({
|
|
|
116
118
|
});
|
|
117
119
|
}, [search]);
|
|
118
120
|
useEffect(() => {
|
|
119
|
-
if (!isEqual(editor.children,
|
|
120
|
-
resetNodes(editor,
|
|
121
|
+
if (!isEqual(editor.children, slateValue)) {
|
|
122
|
+
resetNodes(editor, slateValue);
|
|
121
123
|
}
|
|
122
|
-
}, [
|
|
124
|
+
}, [slateValue, editor]);
|
|
123
125
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
124
126
|
children: [/*#__PURE__*/_jsxs(Slate, {
|
|
125
127
|
editor: editor,
|
|
126
|
-
initialValue:
|
|
128
|
+
initialValue: slateValue,
|
|
127
129
|
onChange: handleChange,
|
|
128
130
|
children: [/*#__PURE__*/_jsx("div", {
|
|
129
131
|
"test-id": `chat-item-body-editable-content-${itemKey}`,
|
package/esm/chat/utils.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Editor, Transforms } from 'slate';
|
|
2
|
+
import cloneDeep from 'lodash-es/cloneDeep';
|
|
2
3
|
import { CUSTOM_ELEMENT_TYPES } from './constants';
|
|
3
4
|
export function isMentionElement(type) {
|
|
4
5
|
return type === CUSTOM_ELEMENT_TYPES.mention;
|
|
@@ -26,10 +27,12 @@ export function resetNodes(editor, nodes) {
|
|
|
26
27
|
path: [0],
|
|
27
28
|
node
|
|
28
29
|
}));
|
|
30
|
+
|
|
31
|
+
// Clone nodes before inserting so multiple editors never share Slate node refs.
|
|
29
32
|
nodes.forEach((node, i) => editor.apply({
|
|
30
33
|
type: 'insert_node',
|
|
31
34
|
path: [i],
|
|
32
|
-
node
|
|
35
|
+
node: cloneDeep(node)
|
|
33
36
|
}));
|
|
34
37
|
const point = Editor.end(editor, []);
|
|
35
38
|
Transforms.select(editor, point);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ComponentType, FocusEvent, FocusEventHandler, HTMLProps } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { ViewMode, TimeConstraints } from 'react-datetime';
|
|
3
3
|
import { Moment, MomentInput } from 'moment';
|
|
4
4
|
import { InputProps } from '../input';
|
|
5
5
|
import { DATE_PICKER_START_END_DATE, DATE_PICKER_VALUE, DatePickerPlacement, DATE_PICKER_VALIDITY } from './types';
|
|
@@ -57,7 +57,7 @@ export declare class DatePicker extends React.Component<DatePickerProps> {
|
|
|
57
57
|
onNavigate: () => void;
|
|
58
58
|
onNavigateBack: () => void;
|
|
59
59
|
onNavigateForward: () => void;
|
|
60
|
-
initialViewMode:
|
|
60
|
+
initialViewMode: ViewMode;
|
|
61
61
|
closeOnSelect: boolean;
|
|
62
62
|
closeOnTab: boolean;
|
|
63
63
|
timeConstraints: {};
|
|
@@ -3,24 +3,24 @@ import moment, { MomentInput, Moment, unitOfTime } from 'moment';
|
|
|
3
3
|
import Datetime from 'react-datetime';
|
|
4
4
|
import { InitialDirection } from './datetime-range-picker';
|
|
5
5
|
export declare function useValidateOnClick(): ({ start, end, minStart, maxEnd, viewMode, dateTimeFormat, sameDateError, }: {
|
|
6
|
-
start?:
|
|
7
|
-
end?:
|
|
6
|
+
start?: Moment | null;
|
|
7
|
+
end?: Moment | null;
|
|
8
8
|
viewMode: string;
|
|
9
9
|
dateTimeFormat: string;
|
|
10
|
-
minStart?:
|
|
11
|
-
maxEnd?:
|
|
12
|
-
sameDateError?: boolean
|
|
10
|
+
minStart?: Moment;
|
|
11
|
+
maxEnd?: Moment;
|
|
12
|
+
sameDateError?: boolean;
|
|
13
13
|
}) => {
|
|
14
14
|
startErrors: {
|
|
15
|
-
START_BEFORE_MIN?: string
|
|
16
|
-
START_AFTER_MAX?: string
|
|
17
|
-
INVALID_START_DATE?: string
|
|
18
|
-
START_END_SAME?: string
|
|
15
|
+
START_BEFORE_MIN?: string;
|
|
16
|
+
START_AFTER_MAX?: string;
|
|
17
|
+
INVALID_START_DATE?: string;
|
|
18
|
+
START_END_SAME?: string;
|
|
19
19
|
};
|
|
20
20
|
endErrors: {
|
|
21
|
-
INVALID_END_DATE?: string
|
|
22
|
-
END_AFTER_MIN?: string
|
|
23
|
-
END_AFTER_MAX?: string
|
|
21
|
+
INVALID_END_DATE?: string;
|
|
22
|
+
END_AFTER_MIN?: string;
|
|
23
|
+
END_AFTER_MAX?: string;
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
/** Checks whether a string can be strictly parsed as a moment object following a provided datetime format
|
|
@@ -25,7 +25,7 @@ export type DropdownMenuContentProps = {
|
|
|
25
25
|
handleSearch: (value: string) => void;
|
|
26
26
|
selectedKey?: string | number;
|
|
27
27
|
selectedItem?: DropdownMenuOption;
|
|
28
|
-
renderCustomHeader: null | (() =>
|
|
28
|
+
renderCustomHeader: null | (() => ReactNode);
|
|
29
29
|
contentClassName?: string;
|
|
30
30
|
labelledBy?: string;
|
|
31
31
|
LinkComponent: LinkComponentType;
|
|
@@ -1,42 +1,41 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { DropdownMenuOption } from './types';
|
|
3
2
|
export declare function getFlattenedSubsectionOptions(collection: Array<DropdownMenuOption>): DropdownMenuOption[];
|
|
4
3
|
export declare function getFooterOptionWithPrivateKey(option: DropdownMenuOption): {
|
|
5
|
-
id?: string
|
|
4
|
+
id?: string;
|
|
6
5
|
key: string | number;
|
|
7
|
-
testId?: string
|
|
8
|
-
link?: string
|
|
9
|
-
icon?: import("@fortawesome/fontawesome-svg-core").IconProp
|
|
10
|
-
iconClass?: string
|
|
11
|
-
className?: string
|
|
6
|
+
testId?: string;
|
|
7
|
+
link?: string;
|
|
8
|
+
icon?: import("@fortawesome/fontawesome-svg-core").IconProp;
|
|
9
|
+
iconClass?: string;
|
|
10
|
+
className?: string;
|
|
12
11
|
title?: import("react").ReactNode;
|
|
13
12
|
subtext?: import("react").ReactNode;
|
|
14
|
-
searchableValue?: string
|
|
15
|
-
value?: string | number
|
|
16
|
-
disabled?: boolean
|
|
13
|
+
searchableValue?: string;
|
|
14
|
+
value?: string | number;
|
|
15
|
+
disabled?: boolean;
|
|
17
16
|
tooltipText?: import("react").ReactNode;
|
|
18
|
-
tooltipTestId?: string
|
|
19
|
-
tooltipPlacement?: import("..").TooltipPlacementsType
|
|
20
|
-
tooltipDocsLink?: import("react").ReactElement
|
|
21
|
-
isChecked?: boolean
|
|
22
|
-
isFileUpload?: boolean
|
|
23
|
-
acceptedFiles?: string
|
|
24
|
-
isMultiple?: boolean
|
|
25
|
-
isShown?: boolean
|
|
26
|
-
shouldNotCloseDropdown?: boolean
|
|
27
|
-
isFolderUpload?: boolean
|
|
28
|
-
level?: string
|
|
17
|
+
tooltipTestId?: string;
|
|
18
|
+
tooltipPlacement?: import("..").TooltipPlacementsType;
|
|
19
|
+
tooltipDocsLink?: import("react").ReactElement;
|
|
20
|
+
isChecked?: boolean;
|
|
21
|
+
isFileUpload?: boolean;
|
|
22
|
+
acceptedFiles?: Array<string>;
|
|
23
|
+
isMultiple?: boolean;
|
|
24
|
+
isShown?: boolean;
|
|
25
|
+
shouldNotCloseDropdown?: boolean;
|
|
26
|
+
isFolderUpload?: boolean;
|
|
27
|
+
level?: string;
|
|
29
28
|
privateKey: string;
|
|
30
|
-
subOptions?: DropdownMenuOption
|
|
31
|
-
radioOptions?: import("./types").DropdownRadioOptionType
|
|
32
|
-
redirect?: (
|
|
33
|
-
isExternal?: boolean
|
|
34
|
-
subItems?: DropdownMenuOption
|
|
35
|
-
activeItemId?: string
|
|
36
|
-
onOptionSelect?: (
|
|
37
|
-
groupIdentifier?: string
|
|
38
|
-
tooltipId?: string
|
|
39
|
-
LinkComponent?: import("./types").LinkComponentType
|
|
29
|
+
subOptions?: Array<DropdownMenuOption>;
|
|
30
|
+
radioOptions?: Array<import("./types").DropdownRadioOptionType>;
|
|
31
|
+
redirect?: (e: import("./types").DropdownOnClickValueType) => void;
|
|
32
|
+
isExternal?: boolean;
|
|
33
|
+
subItems?: Array<DropdownMenuOption>;
|
|
34
|
+
activeItemId?: string;
|
|
35
|
+
onOptionSelect?: () => void;
|
|
36
|
+
groupIdentifier?: string;
|
|
37
|
+
tooltipId?: string;
|
|
38
|
+
LinkComponent?: import("./types").LinkComponentType;
|
|
40
39
|
};
|
|
41
40
|
/**
|
|
42
41
|
* privateKey is used for internal logic only, for efficient search and comparison of options.
|
|
@@ -8,7 +8,7 @@ type FileUploaderHookProps = {
|
|
|
8
8
|
export declare const useFileUploader: ({ initialFiles, isMultiple, setErrorMessage, }: FileUploaderHookProps) => {
|
|
9
9
|
addedFileStructure: any[];
|
|
10
10
|
collectedFileStructure: FileType[];
|
|
11
|
-
generateFileStructure: (dataTransfer: any) => Promise<any>;
|
|
11
|
+
generateFileStructure: (dataTransfer: DataTransfer | any) => Promise<any>;
|
|
12
12
|
removeFileFromStructure: (name: string) => void;
|
|
13
13
|
updateFileStructure: (name: string, payload: any) => void;
|
|
14
14
|
};
|
|
@@ -2,7 +2,7 @@ import { InputTypes } from '../input';
|
|
|
2
2
|
import { FormFieldValidity } from './validity-shape';
|
|
3
3
|
import { VALIDATION_VALUES } from './constants';
|
|
4
4
|
import { MessageTypes } from '../message';
|
|
5
|
-
export declare function isPassword(type?: InputTypes):
|
|
5
|
+
export declare function isPassword(type?: InputTypes): type is "password";
|
|
6
6
|
export type GetValidityMessagesParam = {
|
|
7
7
|
validity?: FormFieldValidity | null;
|
|
8
8
|
validationValues: VALIDATION_VALUES;
|
|
@@ -28,27 +28,27 @@ export declare function useAnalytics({ analyticsProviders }?: {
|
|
|
28
28
|
tabView: (name: string) => void;
|
|
29
29
|
change: ({ element, property, value, isOptions, }: Omit<{
|
|
30
30
|
event: string;
|
|
31
|
-
label?: string | null
|
|
32
|
-
property?: string | null
|
|
33
|
-
value?: string | null
|
|
34
|
-
isOptions?: boolean | null
|
|
35
|
-
}, "
|
|
31
|
+
label?: string | null;
|
|
32
|
+
property?: string | null;
|
|
33
|
+
value?: string | null;
|
|
34
|
+
isOptions?: boolean | null;
|
|
35
|
+
}, "event" | "label"> & {
|
|
36
36
|
element: string;
|
|
37
37
|
}) => void;
|
|
38
38
|
reset: () => void;
|
|
39
39
|
click: ({ label, property, value, }: Omit<{
|
|
40
40
|
event: string;
|
|
41
|
-
label?: string | null
|
|
42
|
-
property?: string | null
|
|
43
|
-
value?: string | null
|
|
44
|
-
isOptions?: boolean | null
|
|
41
|
+
label?: string | null;
|
|
42
|
+
property?: string | null;
|
|
43
|
+
value?: string | null;
|
|
44
|
+
isOptions?: boolean | null;
|
|
45
45
|
}, "event" | "isOptions">) => void;
|
|
46
46
|
track: ({ event, label, property, value, isOptions, }: {
|
|
47
47
|
event: string;
|
|
48
|
-
label?: string | null
|
|
49
|
-
property?: string | null
|
|
50
|
-
value?: string | null
|
|
51
|
-
isOptions?: boolean | null
|
|
48
|
+
label?: string | null;
|
|
49
|
+
property?: string | null;
|
|
50
|
+
value?: string | null;
|
|
51
|
+
isOptions?: boolean | null;
|
|
52
52
|
}) => void;
|
|
53
53
|
};
|
|
54
54
|
/**
|
|
@@ -18,7 +18,7 @@ export declare function useNonNativeButtonAttrs({ onKeyDown, onClick, tabIndex,
|
|
|
18
18
|
tabIndex: number;
|
|
19
19
|
role: string;
|
|
20
20
|
'aria-disabled': boolean;
|
|
21
|
-
onKeyDown(e: KeyboardEvent
|
|
22
|
-
onClick(e: MouseEvent
|
|
21
|
+
onKeyDown(e: KeyboardEvent): void;
|
|
22
|
+
onClick(e: MouseEvent): void;
|
|
23
23
|
};
|
|
24
24
|
export {};
|
|
@@ -15,7 +15,7 @@ export declare function usePaginatedSearchState(config: SearchState): {
|
|
|
15
15
|
count: number;
|
|
16
16
|
setPage: (page: number) => void;
|
|
17
17
|
setPageSize: (size: number) => void;
|
|
18
|
-
setTotal?: (
|
|
18
|
+
setTotal?: (val: number) => void;
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
21
|
* @typedef PaginatedSearch
|
|
@@ -59,7 +59,7 @@ export declare function usePaginatedSearch(items?: never[], { searchFields, filt
|
|
|
59
59
|
count: number;
|
|
60
60
|
setPage: (page: number) => void;
|
|
61
61
|
setPageSize: (size: number) => void;
|
|
62
|
-
setTotal?: (
|
|
62
|
+
setTotal?: (val: number) => void;
|
|
63
63
|
};
|
|
64
64
|
/**
|
|
65
65
|
* Example:
|