@rio-cloud/rio-uikit 0.16.4-beta.22 → 0.16.4-beta.23
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/autosuggest/AutoSuggest.d.ts +19 -2
- package/components/autosuggest/AutoSuggest.js +10 -7
- package/components/button/Button.d.ts +12 -12
- package/components/button/ToggleButton.d.ts +8 -2
- package/components/button/ToggleButton.js +1 -0
- package/components/clearableInput/ClearableInput.d.ts +6 -0
- package/components/clearableInput/ClearableInput.js +6 -5
- package/components/dialog/Dialog.d.ts +5 -2
- package/components/dialog/Dialog.js +40 -9
- package/components/dialog/DialogBody.d.ts +3 -0
- package/components/dialog/DialogFooter.d.ts +3 -1
- package/components/dialog/DialogFooter.js +5 -2
- package/components/dialog/DialogHeader.d.ts +9 -3
- package/components/dialog/DialogHeader.js +9 -5
- package/components/dialog/SplitDialog.d.ts +8 -0
- package/components/dialog/SplitDialog.js +1 -1
- package/components/dialog/dialogContext.d.ts +10 -0
- package/components/dialog/dialogContext.js +17 -0
- package/components/dropdown/ButtonDropdown.d.ts +10 -5
- package/components/dropdown/DropdownToggleButton.d.ts +3 -4
- package/components/dropdown/SplitCaretButton.d.ts +3 -4
- package/components/map/exceptions/MapException.d.ts +2 -6
- package/components/map/exceptions/MapException.js +8 -6
- package/components/page/Page.d.ts +24 -2
- package/components/tag/Tag.d.ts +2 -2
- package/hooks/useClickOutside.d.ts +4 -1
- package/hooks/useClickOutside.js +7 -6
- package/hooks/useClipboard.d.ts +6 -5
- package/hooks/useClipboard.js +13 -7
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/lib/es/components/autosuggest/AutoSuggest.d.ts +19 -2
- package/lib/es/components/autosuggest/AutoSuggest.js +10 -7
- package/lib/es/components/button/Button.d.ts +12 -12
- package/lib/es/components/button/ToggleButton.d.ts +8 -2
- package/lib/es/components/button/ToggleButton.js +1 -0
- package/lib/es/components/clearableInput/ClearableInput.d.ts +6 -0
- package/lib/es/components/clearableInput/ClearableInput.js +6 -5
- package/lib/es/components/dialog/Dialog.d.ts +5 -2
- package/lib/es/components/dialog/Dialog.js +40 -9
- package/lib/es/components/dialog/DialogBody.d.ts +3 -0
- package/lib/es/components/dialog/DialogFooter.d.ts +3 -1
- package/lib/es/components/dialog/DialogFooter.js +5 -2
- package/lib/es/components/dialog/DialogHeader.d.ts +9 -3
- package/lib/es/components/dialog/DialogHeader.js +9 -5
- package/lib/es/components/dialog/SplitDialog.d.ts +8 -0
- package/lib/es/components/dialog/SplitDialog.js +1 -1
- package/lib/es/components/dialog/dialogContext.d.ts +10 -0
- package/lib/es/components/dialog/dialogContext.js +22 -0
- package/lib/es/components/dropdown/ButtonDropdown.d.ts +10 -5
- package/lib/es/components/dropdown/DropdownToggleButton.d.ts +3 -4
- package/lib/es/components/dropdown/SplitCaretButton.d.ts +3 -4
- package/lib/es/components/map/exceptions/MapException.d.ts +2 -6
- package/lib/es/components/map/exceptions/MapException.js +7 -6
- package/lib/es/components/page/Page.d.ts +24 -2
- package/lib/es/components/tag/Tag.d.ts +2 -2
- package/lib/es/hooks/useClickOutside.d.ts +4 -1
- package/lib/es/hooks/useClickOutside.js +6 -6
- package/lib/es/hooks/useClipboard.d.ts +6 -5
- package/lib/es/hooks/useClipboard.js +12 -7
- package/lib/es/index.d.ts +2 -2
- package/lib/es/index.js +8 -8
- package/lib/es/types.d.ts +0 -9
- package/lib/es/useClickOutside.d.ts +2 -4
- package/lib/es/useClickOutside.js +3 -2
- package/lib/es/useClipboard.d.ts +1 -4
- package/lib/es/useClipboard.js +5 -3
- package/lib/es/utils/SortUtils.d.ts +1 -0
- package/lib/es/utils/colorScheme.d.ts +1 -1
- package/lib/es/utils/darkModeCDN.d.ts +1 -1
- package/lib/es/version.json +1 -1
- package/package.json +13 -13
- package/types.d.ts +0 -9
- package/useClickOutside.d.ts +2 -4
- package/useClickOutside.js +2 -2
- package/useClipboard.d.ts +1 -4
- package/useClipboard.js +1 -2
- package/utils/SortUtils.d.ts +1 -0
- package/utils/colorScheme.d.ts +1 -1
- package/utils/darkModeCDN.d.ts +1 -1
- package/version.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export type AutoSuggestSuggestion = {
|
|
3
|
-
label
|
|
3
|
+
label?: string;
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
[name: string]: string | React.ReactNode;
|
|
6
6
|
};
|
|
@@ -9,6 +9,10 @@ export type SelectedSuggestion = {
|
|
|
9
9
|
suggestion: AutoSuggestSuggestion;
|
|
10
10
|
};
|
|
11
11
|
export type AutoSuggestInputProps = {
|
|
12
|
+
/**
|
|
13
|
+
* A native input id attribute. Passed through as HTML attribute to the input element.
|
|
14
|
+
*/
|
|
15
|
+
id?: string;
|
|
12
16
|
/**
|
|
13
17
|
* The value to be set for the input. Using this prop the input can be controlled from the outside.
|
|
14
18
|
*/
|
|
@@ -79,7 +83,11 @@ export type AutoSuggestInputProps = {
|
|
|
79
83
|
*/
|
|
80
84
|
className?: string;
|
|
81
85
|
};
|
|
82
|
-
export type AutoSuggestProps = {
|
|
86
|
+
export type AutoSuggestProps<T = AutoSuggestSuggestion> = {
|
|
87
|
+
/**
|
|
88
|
+
* A native input id attribute on the component root. Passed through as HTML attribute to the input element.
|
|
89
|
+
*/
|
|
90
|
+
id?: string;
|
|
83
91
|
/**
|
|
84
92
|
* Object to define properties for the input component. For the input, the ClearableInput
|
|
85
93
|
* component is used.
|
|
@@ -88,6 +96,10 @@ export type AutoSuggestProps = {
|
|
|
88
96
|
/**
|
|
89
97
|
* Array of items which will be displayed. Items can be arbitrary objects as long as they
|
|
90
98
|
* have a label defined.
|
|
99
|
+
*
|
|
100
|
+
* __Important__: in case you specify your own custom renderer via `renderSuggestion` prop, you
|
|
101
|
+
* can pass our own object that does not need to have a label. In this case you may want to
|
|
102
|
+
* specify the `customSuggestionKey` to avoid react throwing an error of rendering menu items with the same key.
|
|
91
103
|
*/
|
|
92
104
|
suggestions?: AutoSuggestSuggestion[];
|
|
93
105
|
/**
|
|
@@ -138,6 +150,11 @@ export type AutoSuggestProps = {
|
|
|
138
150
|
* @returns
|
|
139
151
|
*/
|
|
140
152
|
renderSuggestion?: (suggestion: AutoSuggestSuggestion) => React.ReactNode;
|
|
153
|
+
/**
|
|
154
|
+
* When rendering your own custom suggestions that do not have the `label` attribute, use this prop to specify
|
|
155
|
+
* a unique value for each suggestion which will be used as a react key for the individual menu items.
|
|
156
|
+
*/
|
|
157
|
+
customSuggestionKey?: string;
|
|
141
158
|
/**
|
|
142
159
|
* Boolean that disabled autoDropDirection and opens the dropdown-menu be above the toggle.
|
|
143
160
|
* @default false
|
|
@@ -15,7 +15,8 @@ import AutoSuggestAddons from './AutoSuggestAddons';
|
|
|
15
15
|
import DropdownSpinner from './DropdownSpinner';
|
|
16
16
|
import NoItemMessage from './NoItemMessage';
|
|
17
17
|
export const AutoSuggest = (props) => {
|
|
18
|
-
const { onSuggestionSelected = noop, onSuggestionsFetchRequested = noop, onSuggestionHighlighted = noop, renderSuggestion = suggestion => suggestion.label, getSuggestionValue = suggestion => suggestion.label, suggestions = [], autoDropDirection = true, pullRight = false, dropup = false, isLoading = false, openOnFocus = false, closeOnSelect = true, showSelectedItemsInInput = true, autoComplete = 'off', inputProps = {
|
|
18
|
+
const { id, onSuggestionSelected = noop, onSuggestionsFetchRequested = noop, onSuggestionHighlighted = noop, renderSuggestion = (suggestion) => suggestion.label, customSuggestionKey, getSuggestionValue = (suggestion) => { var _a; return (_a = suggestion.label) !== null && _a !== void 0 ? _a : suggestion === null || suggestion === void 0 ? void 0 : suggestion.customSuggestionKey; }, suggestions = [], autoDropDirection = true, pullRight = false, dropup = false, isLoading = false, openOnFocus = false, closeOnSelect = true, showSelectedItemsInInput = true, autoComplete = 'off', inputProps = {
|
|
19
|
+
id,
|
|
19
20
|
disabled: false,
|
|
20
21
|
onChange: noop,
|
|
21
22
|
onClear: noop,
|
|
@@ -26,7 +27,7 @@ export const AutoSuggest = (props) => {
|
|
|
26
27
|
tabIndex: 0,
|
|
27
28
|
value: undefined,
|
|
28
29
|
icon: undefined,
|
|
29
|
-
}, leadingInputAddons, trailingInputAddons, noItemMessage, dropdownClassName = '', className = '' } = props, remainingProps = __rest(props, ["onSuggestionSelected", "onSuggestionsFetchRequested", "onSuggestionHighlighted", "renderSuggestion", "getSuggestionValue", "suggestions", "autoDropDirection", "pullRight", "dropup", "isLoading", "openOnFocus", "closeOnSelect", "showSelectedItemsInInput", "autoComplete", "inputProps", "leadingInputAddons", "trailingInputAddons", "noItemMessage", "dropdownClassName", "className"]);
|
|
30
|
+
}, leadingInputAddons, trailingInputAddons, noItemMessage, dropdownClassName = '', className = '' } = props, remainingProps = __rest(props, ["id", "onSuggestionSelected", "onSuggestionsFetchRequested", "onSuggestionHighlighted", "renderSuggestion", "customSuggestionKey", "getSuggestionValue", "suggestions", "autoDropDirection", "pullRight", "dropup", "isLoading", "openOnFocus", "closeOnSelect", "showSelectedItemsInInput", "autoComplete", "inputProps", "leadingInputAddons", "trailingInputAddons", "noItemMessage", "dropdownClassName", "className"]);
|
|
30
31
|
const [isOpen, setIsOpen] = useState(false);
|
|
31
32
|
const [value, setValue] = useState(inputProps.value || '');
|
|
32
33
|
const [highlightedItemIndex, setHighlightedItemIndex] = useState(-1);
|
|
@@ -173,8 +174,8 @@ export const AutoSuggest = (props) => {
|
|
|
173
174
|
}
|
|
174
175
|
};
|
|
175
176
|
const renderInput = () => {
|
|
176
|
-
const { icon, value: ignoredExternalValue } = inputProps, remainingInputProps = __rest(inputProps, ["icon", "value"]);
|
|
177
|
-
const clearableProps = Object.assign(Object.assign({}, remainingInputProps), { onClick: () => openMenu });
|
|
177
|
+
const { id: inputPropId, icon, value: ignoredExternalValue } = inputProps, remainingInputProps = __rest(inputProps, ["id", "icon", "value"]);
|
|
178
|
+
const clearableProps = Object.assign(Object.assign({ id: id !== null && id !== void 0 ? id : inputPropId }, remainingInputProps), { onClick: () => openMenu });
|
|
178
179
|
const input = (_jsx(ClearableInput, Object.assign({}, clearableProps, { ref: inputRef, autoComplete: autoComplete, onChange: handleInputChange, onClear: clearInputValue, onFocus: handleFocus, value: showSelectedItemsInInput ? value : '' })));
|
|
179
180
|
if (icon || leadingInputAddons || trailingInputAddons) {
|
|
180
181
|
return (_jsx(AutoSuggestAddons, Object.assign({ icon: icon, leadingInputAddons: leadingInputAddons, trailingInputAddons: trailingInputAddons }, { children: input })));
|
|
@@ -191,10 +192,12 @@ export const AutoSuggest = (props) => {
|
|
|
191
192
|
return null;
|
|
192
193
|
}
|
|
193
194
|
return (_jsxs("ul", Object.assign({ role: 'menu', className: dropdownMenuClasses, ref: dropdownMenuRef }, { children: [hasNoSuggestions && noItemMessage && _jsx(NoItemMessage, { message: noItemMessage }, 'NoItemMessage'), suggestions.map((suggestion, index) => {
|
|
194
|
-
|
|
195
|
-
|
|
195
|
+
var _a;
|
|
196
|
+
const key = `index-${(_a = suggestion.label) !== null && _a !== void 0 ? _a : suggestion[customSuggestionKey !== null && customSuggestionKey !== void 0 ? customSuggestionKey : '']}`;
|
|
197
|
+
if (suggestion.header && suggestion.label) {
|
|
198
|
+
return _jsx(DropdownHeader, { label: suggestion.label }, key);
|
|
196
199
|
}
|
|
197
|
-
return (_jsx(MenuItem, { active: index === highlightedItemIndex, disabled: suggestion.disabled, value: suggestion.customSuggestion ? suggestion.customSuggestion : renderSuggestion(suggestion), onSelect: (_, event) => onSuggestionClicked(event, suggestion), index: index, onMouseEnter: onMouseEnter },
|
|
200
|
+
return (_jsx(MenuItem, { active: index === highlightedItemIndex, disabled: suggestion.disabled, value: suggestion.customSuggestion ? suggestion.customSuggestion : renderSuggestion(suggestion), onSelect: (_, event) => onSuggestionClicked(event, suggestion), index: index, onMouseEnter: onMouseEnter }, key));
|
|
198
201
|
})] })));
|
|
199
202
|
};
|
|
200
203
|
const classes = classNames('AutoSuggest', 'dropdown', isOpen && 'open', dropDirection.dropup && 'dropup', className);
|
|
@@ -10,21 +10,21 @@ export declare const STYLES_MAP: {
|
|
|
10
10
|
readonly SUCCESS: "success";
|
|
11
11
|
readonly MUTED: "muted";
|
|
12
12
|
};
|
|
13
|
-
type
|
|
13
|
+
export type BUTTON_STYLE = ObjectValues<typeof STYLES_MAP>;
|
|
14
14
|
export declare const VARIANTS_MAP: {
|
|
15
15
|
readonly VARIANT_LINK: "link";
|
|
16
16
|
readonly VARIANT_LINK_INLINE: "link-inline";
|
|
17
17
|
readonly VARIANT_OUTLINE: "outline";
|
|
18
18
|
readonly VARIANT_ACTION: "action";
|
|
19
19
|
};
|
|
20
|
-
type
|
|
20
|
+
export type BUTTON_VARIANT = ObjectValues<typeof VARIANTS_MAP>;
|
|
21
21
|
export declare const SIZES_MAP: {
|
|
22
22
|
readonly XS: "xs";
|
|
23
23
|
readonly SM: "sm";
|
|
24
24
|
readonly MD: "md";
|
|
25
25
|
readonly LG: "lg";
|
|
26
26
|
};
|
|
27
|
-
type
|
|
27
|
+
export type BUTTON_SIZE = ObjectValues<typeof SIZES_MAP>;
|
|
28
28
|
type RegularButton = {
|
|
29
29
|
/**
|
|
30
30
|
* Use the button as a toggle button. The toggle state can be controlled via the `active` prop.
|
|
@@ -37,7 +37,7 @@ type RegularButton = {
|
|
|
37
37
|
*/
|
|
38
38
|
onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
39
39
|
};
|
|
40
|
-
|
|
40
|
+
type ToggleButton = {
|
|
41
41
|
/**
|
|
42
42
|
* Use the button as a toggle button. The toggle state can be controlled via the `active` prop.
|
|
43
43
|
* @default false
|
|
@@ -50,17 +50,17 @@ export type ToggleButton = {
|
|
|
50
50
|
onClick?: (value: boolean) => void;
|
|
51
51
|
};
|
|
52
52
|
export type ButtonProps = Omit<HTMLProps<HTMLButtonElement>, 'type' | 'onClick'> & {
|
|
53
|
-
/**
|
|
54
|
-
* Set the button toggled. Should be used in combination with "asToggle" prop.
|
|
55
|
-
* @default false
|
|
56
|
-
*/
|
|
57
|
-
active?: boolean;
|
|
58
53
|
/**
|
|
59
54
|
* Whether the button should be disabled.
|
|
60
55
|
*
|
|
61
56
|
* @default false
|
|
62
57
|
*/
|
|
63
58
|
disabled?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Set the button toggled. Should be used in combination with "asToggle" prop.
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
active?: boolean;
|
|
64
64
|
/**
|
|
65
65
|
* Defines the type of the button. This may be used for form submit buttons.
|
|
66
66
|
* @default 'button'
|
|
@@ -92,15 +92,15 @@ export type ButtonProps = Omit<HTMLProps<HTMLButtonElement>, 'type' | 'onClick'>
|
|
|
92
92
|
* Sets the button style.
|
|
93
93
|
* @default "default"
|
|
94
94
|
*/
|
|
95
|
-
bsStyle?:
|
|
95
|
+
bsStyle?: BUTTON_STYLE;
|
|
96
96
|
/**
|
|
97
97
|
* Sets the button size.
|
|
98
98
|
*/
|
|
99
|
-
bsSize?:
|
|
99
|
+
bsSize?: BUTTON_SIZE;
|
|
100
100
|
/**
|
|
101
101
|
* Sets the button variant.
|
|
102
102
|
*/
|
|
103
|
-
variant?:
|
|
103
|
+
variant?: BUTTON_VARIANT;
|
|
104
104
|
/**
|
|
105
105
|
* Whether the "ripple" effect should be suppressed on this button.
|
|
106
106
|
*/
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { type PropsWithChildren } from 'react';
|
|
2
|
-
import { type
|
|
3
|
-
export type ToggleButtonProps =
|
|
2
|
+
import { type ButtonProps } from './Button';
|
|
3
|
+
export type ToggleButtonProps = Omit<ButtonProps, 'onClick'> & {
|
|
4
|
+
/**
|
|
5
|
+
* Callback function triggered when clicking the button.
|
|
6
|
+
* @param value The new value of the toggle button.
|
|
7
|
+
*/
|
|
8
|
+
onClick?: (value: boolean) => void;
|
|
9
|
+
};
|
|
4
10
|
declare const ToggleButton: (props: PropsWithChildren<ToggleButtonProps>) => import("react/jsx-runtime").JSX.Element;
|
|
5
11
|
export default ToggleButton;
|
|
@@ -2,5 +2,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
// @ts-ignore-next-line importsNotUsedAsValues
|
|
3
3
|
import 'react';
|
|
4
4
|
import Button from './Button';
|
|
5
|
+
// @ts-ignore - the Button throws TS error due to refs that may be checked at a later point in time
|
|
5
6
|
const ToggleButton = (props) => _jsx(Button, Object.assign({}, props, { asToggle: true }));
|
|
6
7
|
export default ToggleButton;
|
|
@@ -111,6 +111,12 @@ export type ClearableInputProps = {
|
|
|
111
111
|
* @default '_'
|
|
112
112
|
*/
|
|
113
113
|
maskPlaceholder?: string | null;
|
|
114
|
+
/**
|
|
115
|
+
* Disabled the input component.
|
|
116
|
+
*
|
|
117
|
+
* @default false
|
|
118
|
+
*/
|
|
119
|
+
disabled?: boolean;
|
|
114
120
|
/**
|
|
115
121
|
* Whether mask prefix and placeholder should be displayed when input is empty and
|
|
116
122
|
* has no focus.
|
|
@@ -13,7 +13,7 @@ export const DEFAULT_TYPE = 'text';
|
|
|
13
13
|
export const SUPPORTED_TYPES = ['text', 'password', 'email'];
|
|
14
14
|
const hasValue = (value) => !isEmpty(`${value}`);
|
|
15
15
|
const ClearableInput = forwardRef((props, ref) => {
|
|
16
|
-
const { type = DEFAULT_TYPE, defaultValue, value, maxLength, tabIndex = 0, hasError = false, inputRef, autoComplete, onChange = noop, onBlur = noop, onFocus = noop, onClear = noop, onKeyPress = noop, mask, maskPlaceholder = '_', alwaysShowMask = false, inputClassName = '', className = '', children } = props, remainingProps = __rest(props, ["type", "defaultValue", "value", "maxLength", "tabIndex", "hasError", "inputRef", "autoComplete", "onChange", "onBlur", "onFocus", "onClear", "onKeyPress", "mask", "maskPlaceholder", "alwaysShowMask", "inputClassName", "className", "children"]);
|
|
16
|
+
const { type = DEFAULT_TYPE, defaultValue, value, maxLength, tabIndex = 0, hasError = false, inputRef, autoComplete, onChange = noop, onBlur = noop, onFocus = noop, onClear = noop, onKeyPress = noop, mask, maskPlaceholder = '_', alwaysShowMask = false, inputClassName = '', disabled = false, className = '', children } = props, remainingProps = __rest(props, ["type", "defaultValue", "value", "maxLength", "tabIndex", "hasError", "inputRef", "autoComplete", "onChange", "onBlur", "onFocus", "onClear", "onKeyPress", "mask", "maskPlaceholder", "alwaysShowMask", "inputClassName", "disabled", "className", "children"]);
|
|
17
17
|
const initialValue = value || defaultValue || '';
|
|
18
18
|
const [inputValue, setInputValue] = useState(initialValue);
|
|
19
19
|
const [showClear, setShowClear] = useState(hasValue(initialValue));
|
|
@@ -56,14 +56,15 @@ const ClearableInput = forwardRef((props, ref) => {
|
|
|
56
56
|
onClear(event);
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
|
-
const classes = classNames('ClearableInput', 'input-group', hasError && 'has-error', className && className);
|
|
60
|
-
const inputClassNames = classNames('form-control', inputClassName, showClear && 'withClearButton', hasMask && 'withInputMask');
|
|
59
|
+
const classes = classNames('ClearableInput', 'input-group', hasError && 'has-error', disabled && 'pointer-events-none', className && className);
|
|
60
|
+
const inputClassNames = classNames('form-control', inputClassName, showClear && 'withClearButton', hasMask && 'withInputMask', disabled && 'disabled');
|
|
61
61
|
const clearButtonClassNames = classNames('clearButton', !showClear && 'hide');
|
|
62
62
|
const convertedType = type === null || type === void 0 ? void 0 : type.toLowerCase();
|
|
63
63
|
const inputType = SUPPORTED_TYPES.indexOf(convertedType) !== -1 ? convertedType : DEFAULT_TYPE;
|
|
64
64
|
const inputProps = Object.assign(Object.assign({}, omit(['value', 'defaultValue', 'onClear'])(remainingProps)), { className: inputClassNames, autoComplete, type: inputType, value: inputValue, onChange: handleChange, onKeyPress: handleKeyPress, onBlur,
|
|
65
|
-
onFocus,
|
|
66
|
-
|
|
65
|
+
onFocus,
|
|
66
|
+
disabled, maxLength: hasMask ? undefined : maxLength, tabIndex, ref: inputRef || ref });
|
|
67
|
+
const input = hasMask ? (_jsx(InputMask, Object.assign({}, inputProps, { disabled: disabled, mask: mask, maskPlaceholder: maskPlaceholder, alwaysShowMask: alwaysShowMask }))) : (_jsx("input", Object.assign({}, inputProps)));
|
|
67
68
|
return (_jsxs("div", Object.assign({ className: classes }, { children: [children && isFunction(children) ? children(inputProps) : input, _jsx("span", Object.assign({ className: clearButtonClassNames, onClick: clearInputValue }, { children: _jsx("span", { className: 'clearButtonIcon rioglyph rioglyph-remove-sign' }) }))] })));
|
|
68
69
|
});
|
|
69
70
|
export default ClearableInput;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
export type bsSizeDialog = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full' | 'fullwidth' | 'fullheight' | 'fullscreen';
|
|
3
3
|
export type BaseDialogProps = {
|
|
4
4
|
/**
|
|
@@ -89,7 +89,10 @@ export type DialogProps = BaseDialogProps & {
|
|
|
89
89
|
onCloseValidation?: () => boolean;
|
|
90
90
|
};
|
|
91
91
|
declare const Dialog: {
|
|
92
|
-
(props: DialogProps): React.ReactPortal;
|
|
92
|
+
(props: PropsWithChildren<DialogProps>): React.ReactPortal;
|
|
93
|
+
Title: (props: import("./DialogHeader").DialogHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
94
|
+
Body: ({ className, children, ...remainingProps }: React.PropsWithChildren<import("./DialogBody").DialogBodyProps>) => import("react/jsx-runtime").JSX.Element;
|
|
95
|
+
Footer: (props: React.PropsWithChildren<import("./DialogFooter").DialogFooterProps>) => import("react/jsx-runtime").JSX.Element;
|
|
93
96
|
SIZE_XS: "xs";
|
|
94
97
|
SIZE_SM: "sm";
|
|
95
98
|
SIZE_MD: "md";
|
|
@@ -5,7 +5,7 @@ import ReactDOM from 'react-dom';
|
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import activeElement from 'dom-helpers/activeElement';
|
|
7
7
|
import noop from 'lodash/fp/noop';
|
|
8
|
-
import {
|
|
8
|
+
import { AnimatePresence, motion } from 'framer-motion';
|
|
9
9
|
import { getOrCreatePortalRoot } from '../../utils/portalRoot';
|
|
10
10
|
import useEsc from '../../hooks/useEsc';
|
|
11
11
|
import useAfterMount from '../../hooks/useAfterMount';
|
|
@@ -13,10 +13,11 @@ import DialogHeader from './DialogHeader';
|
|
|
13
13
|
import DialogBody from './DialogBody';
|
|
14
14
|
import DialogFooter from './DialogFooter';
|
|
15
15
|
import useFocusTrap from '../../hooks/useFocusTrap';
|
|
16
|
+
import { DialogContextProvider } from './dialogContext';
|
|
16
17
|
const MODAL_DIALOG_CLASS = 'modal-dialog';
|
|
17
18
|
const MODAL_OPEN_CLASS = 'modal-open';
|
|
18
19
|
const Dialog = (props) => {
|
|
19
|
-
const { title, subtitle, body, footer, headerButtons, className = '', bodyClassName, footerClassName, showXsDialogBorders = false, showCloseButton = true, useOverflow = false, bsSize, show = false, onHide = noop, onClose, disableEsc = false, onEsc = noop, onCloseValidation = () => true } = props, remainingProps = __rest(props, ["title", "subtitle", "body", "footer", "headerButtons", "className", "bodyClassName", "footerClassName", "showXsDialogBorders", "showCloseButton", "useOverflow", "bsSize", "show", "onHide", "onClose", "disableEsc", "onEsc", "onCloseValidation"]);
|
|
20
|
+
const { title, subtitle, body, footer, headerButtons, className = '', bodyClassName, footerClassName, showXsDialogBorders = false, showCloseButton = true, useOverflow = false, bsSize, show = false, onHide = noop, onClose, disableEsc = false, onEsc = noop, onCloseValidation = () => true, children } = props, remainingProps = __rest(props, ["title", "subtitle", "body", "footer", "headerButtons", "className", "bodyClassName", "footerClassName", "showXsDialogBorders", "showCloseButton", "useOverflow", "bsSize", "show", "onHide", "onClose", "disableEsc", "onEsc", "onCloseValidation", "children"]);
|
|
20
21
|
const [open, setOpen] = useState(show);
|
|
21
22
|
const dialogWrapperRef = useRef(null);
|
|
22
23
|
const onCloseCallback = onClose !== null && onClose !== void 0 ? onClose : onHide;
|
|
@@ -60,26 +61,56 @@ const Dialog = (props) => {
|
|
|
60
61
|
closeDialog(true);
|
|
61
62
|
}
|
|
62
63
|
});
|
|
63
|
-
const
|
|
64
|
+
const handleAnimationComplete = (definition) => {
|
|
64
65
|
var _a;
|
|
66
|
+
// The animation complete callback is invoked too when closing the dialog.
|
|
67
|
+
// For that we check the animation props like the "opacity" to skip focusing
|
|
68
|
+
// on the way out when closing the dialog.
|
|
69
|
+
// @ts-ignore
|
|
70
|
+
if (definition.opacity === 0) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
65
73
|
const dialogElement = dialogWrapperRef.current;
|
|
66
74
|
const currentActiveElement = activeElement(document);
|
|
67
75
|
// Set the focus to the dialog if no element inside has focus already. Otherwise, focused
|
|
68
|
-
// elements like inputs would
|
|
76
|
+
// elements like inputs would loose their focus to the dialog.
|
|
69
77
|
// Note that in order to focus the dialog itself, the tabindex has to be set on that element
|
|
78
|
+
// IMPORTANT: make sure the dialog has a tabIndex prop
|
|
70
79
|
if (!(dialogElement === null || dialogElement === void 0 ? void 0 : dialogElement.contains(currentActiveElement))) {
|
|
71
80
|
(_a = dialogWrapperRef === null || dialogWrapperRef === void 0 ? void 0 : dialogWrapperRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
72
81
|
}
|
|
73
82
|
};
|
|
74
83
|
const modalClasses = classNames('modal', 'show', className);
|
|
75
84
|
const isSmallestDialog = bsSize === 'xs';
|
|
76
|
-
const hasChildren =
|
|
85
|
+
const hasChildren = !!children;
|
|
77
86
|
const modalDialogClasses = classNames(MODAL_DIALOG_CLASS, useOverflow && 'modal-overflow', bsSize === 'xs' && 'modal-xs', bsSize === 'sm' && 'modal-sm', bsSize === 'lg' && 'modal-lg', bsSize === 'lg' && 'modal-xl', bsSize === 'full' && 'modal-full-width', bsSize === 'fullwidth' && 'modal-full-width', bsSize === 'fullheight' && 'modal-full-height', bsSize === 'fullscreen' && 'modal-fullscreen');
|
|
78
|
-
|
|
87
|
+
const spring = {
|
|
88
|
+
type: 'spring',
|
|
89
|
+
damping: 33,
|
|
90
|
+
stiffness: 500,
|
|
91
|
+
};
|
|
92
|
+
const springXs = {
|
|
93
|
+
type: 'spring',
|
|
94
|
+
damping: 25,
|
|
95
|
+
stiffness: 400,
|
|
96
|
+
};
|
|
97
|
+
return ReactDOM.createPortal(_jsx(DialogContextProvider, Object.assign({ value: { onClose: handleCloseButton, isSmallestDialog, showXsDialogBorders, showCloseButton } }, { children: _jsx(AnimatePresence
|
|
98
|
+
// Disable any initial animations on children that
|
|
99
|
+
// are present when the component is first rendered
|
|
100
|
+
, Object.assign({
|
|
101
|
+
// Disable any initial animations on children that
|
|
102
|
+
// are present when the component is first rendered
|
|
103
|
+
initial: false,
|
|
104
|
+
// Only render one component at a time.
|
|
105
|
+
// The exiting component will finish its exit
|
|
106
|
+
// animation before entering component is rendered
|
|
107
|
+
exitBeforeEnter: true }, { children: open && (_jsxs("div", Object.assign({}, remainingProps, { className: modalClasses, role: 'dialog', ref: dialogWrapperRef, "aria-label": 'dialog', tabIndex: 0 }, { children: [_jsx(motion.div, Object.assign({ initial: { opacity: 0, y: '-50%' }, animate: { opacity: 1, y: 0, transition: isSmallestDialog ? springXs : spring }, exit: { opacity: 0, y: '-150%' }, transition: { opacity: 0.2, y: 0.3 }, onAnimationComplete: handleAnimationComplete,
|
|
108
|
+
// @ts-ignore
|
|
109
|
+
ref: setFocusTrapRef, className: modalDialogClasses, role: 'document' }, { children: _jsxs("div", Object.assign({ className: 'modal-content' }, { children: [hasChildren && children, !hasChildren && (_jsxs(_Fragment, { children: [title && (_jsx(DialogHeader, { title: title, subtitle: subtitle, headerButtons: headerButtons })), body && _jsx(DialogBody, Object.assign({ className: bodyClassName }, { children: body })), footer && _jsx(DialogFooter, Object.assign({ className: footerClassName }, { children: footer }))] }))] })) })), _jsx(motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: 0.1 }, className: 'modal-backdrop' })] }))) })) })), modalRoot);
|
|
79
110
|
};
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
111
|
+
Dialog.Title = DialogHeader;
|
|
112
|
+
Dialog.Body = DialogBody;
|
|
113
|
+
Dialog.Footer = DialogFooter;
|
|
83
114
|
Dialog.SIZE_XS = 'xs';
|
|
84
115
|
Dialog.SIZE_SM = 'sm';
|
|
85
116
|
Dialog.SIZE_MD = 'md'; // default
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { type PropsWithChildren } from 'react';
|
|
2
2
|
export type DialogBodyProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Additional classes for the modal-body element.
|
|
5
|
+
*/
|
|
3
6
|
className?: string;
|
|
4
7
|
};
|
|
5
8
|
declare const DialogBody: ({ className, children, ...remainingProps }: PropsWithChildren<DialogBodyProps>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { type PropsWithChildren } from 'react';
|
|
2
2
|
export type DialogFooterProps = {
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Additional classes for the modal-footer element.
|
|
5
|
+
*/
|
|
4
6
|
className?: string;
|
|
5
7
|
};
|
|
6
8
|
declare const DialogFooter: (props: PropsWithChildren<DialogFooterProps>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,9 +3,12 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
// @ts-ignore-next-line importsNotUsedAsValues
|
|
4
4
|
import 'react';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
|
+
import { useDialogContext } from './dialogContext';
|
|
6
7
|
const DialogFooter = (props) => {
|
|
7
|
-
const { className = '',
|
|
8
|
-
const
|
|
8
|
+
const { className = '', children } = props, remainingProps = __rest(props, ["className", "children"]);
|
|
9
|
+
const { isSmallestDialog, showXsDialogBorders } = useDialogContext();
|
|
10
|
+
const doShowXsDialogBorders = isSmallestDialog ? showXsDialogBorders : true;
|
|
11
|
+
const footerClassNames = classNames('modal-footer', !doShowXsDialogBorders && 'border-top-none padding-top-0', className);
|
|
9
12
|
return (_jsx("div", Object.assign({}, remainingProps, { className: footerClassNames, "aria-label": 'dialog footer' }, { children: children })));
|
|
10
13
|
};
|
|
11
14
|
export default DialogFooter;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export type DialogHeaderProps = {
|
|
3
|
+
/**
|
|
4
|
+
* The dialog title (can also be a FormattedMessage component).
|
|
5
|
+
*/
|
|
3
6
|
title: string | React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* The dialog header subtitle content.
|
|
9
|
+
*/
|
|
4
10
|
subtitle?: string | React.ReactNode;
|
|
5
|
-
|
|
6
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Allows to add additional buttons to the dialog header.
|
|
13
|
+
*/
|
|
7
14
|
headerButtons?: React.ReactNode;
|
|
8
|
-
showXsDialogBorders: boolean;
|
|
9
15
|
};
|
|
10
16
|
declare const DialogHeader: (props: DialogHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
17
|
export default DialogHeader;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import
|
|
4
|
+
import 'lodash/fp/noop';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
|
+
import { useDialogContext } from './dialogContext';
|
|
6
7
|
const DialogHeader = (props) => {
|
|
7
|
-
const { title, subtitle, headerButtons
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
8
|
+
const { title, subtitle, headerButtons } = props, remainingProps = __rest(props, ["title", "subtitle", "headerButtons"]);
|
|
9
|
+
const { onClose, isSmallestDialog, showXsDialogBorders, showCloseButton } = useDialogContext();
|
|
10
|
+
const doShowXsDialogBorders = isSmallestDialog ? showXsDialogBorders : true;
|
|
11
|
+
const doShowCloseButton = isSmallestDialog ? false : showCloseButton;
|
|
12
|
+
const headerClasses = classNames('modal-header', !doShowXsDialogBorders && 'border-bottom-none');
|
|
13
|
+
const headerTextClasses = classNames('modal-header-text', !doShowXsDialogBorders && 'padding-bottom-0 width-100pct');
|
|
14
|
+
return (_jsxs("div", Object.assign({}, remainingProps, { className: headerClasses, "aria-label": 'dialog header' }, { children: [_jsxs("div", Object.assign({ className: headerTextClasses }, { children: [subtitle && _jsx("div", Object.assign({ className: 'modal-header-subtitle' }, { children: subtitle })), _jsx("div", Object.assign({ className: 'modal-header-title' }, { children: title }))] })), _jsxs("div", Object.assign({ className: 'modal-header-buttons' }, { children: [headerButtons && !isSmallestDialog && (_jsxs(React.Fragment, { children: [headerButtons, _jsx("div", { className: 'modal-header-buttons-spacer' })] })), doShowCloseButton && (_jsx("button", Object.assign({ type: 'button', className: 'btn btn-icon-only btn-muted modal-header-close close', onClick: onClose, "data-testid": 'close', "aria-label": 'dialog close button' }, { children: _jsx("span", { className: 'rioglyph rioglyph-remove', "aria-hidden": 'true' }) })))] }))] })));
|
|
11
15
|
};
|
|
12
16
|
export default DialogHeader;
|
|
@@ -17,6 +17,14 @@ export type SplitDialogProps = BaseDialogProps & {
|
|
|
17
17
|
* Additional classes for the right content element.
|
|
18
18
|
*/
|
|
19
19
|
rightContentClassName?: string;
|
|
20
|
+
/**
|
|
21
|
+
* The dialog body content.
|
|
22
|
+
*/
|
|
23
|
+
footer?: React.ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* Additional classes for the modal-footer element.
|
|
26
|
+
*/
|
|
27
|
+
footerClassName?: string;
|
|
20
28
|
};
|
|
21
29
|
declare const SplitDialog: (props: SplitDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
30
|
export default SplitDialog;
|
|
@@ -5,7 +5,7 @@ import 'react';
|
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import Dialog from './Dialog';
|
|
7
7
|
const SplitDialog = (props) => {
|
|
8
|
-
const { leftContent, rightContent,
|
|
8
|
+
const { leftContent, rightContent, leftContentClassName = '', rightContentClassName = '', className = '', useOverflow = true } = props, remainingProps = __rest(props, ["leftContent", "rightContent", "leftContentClassName", "rightContentClassName", "className", "useOverflow"]);
|
|
9
9
|
const dialogClassName = `split-dialog ${className}`;
|
|
10
10
|
const dividerClasses = classNames('split-divider', 'bg-lighter');
|
|
11
11
|
const body = (_jsxs("div", Object.assign({ className: 'split-wrapper' }, { children: [_jsxs("div", Object.assign({ className: `split-left ${leftContentClassName}` }, { children: [leftContent, _jsx("div", { className: dividerClasses })] })), _jsx("div", Object.assign({ className: `split-right ${rightContentClassName}` }, { children: rightContent }))] })));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type DialogContext = {
|
|
3
|
+
onClose: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
4
|
+
isSmallestDialog: boolean;
|
|
5
|
+
showXsDialogBorders: boolean;
|
|
6
|
+
showCloseButton: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const dialogContext: React.Context<DialogContext>;
|
|
9
|
+
export declare const DialogContextProvider: React.Provider<DialogContext>;
|
|
10
|
+
export declare const useDialogContext: () => DialogContext;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
import noop from 'lodash/fp/noop';
|
|
3
|
+
const initialContext = {
|
|
4
|
+
onClose: noop,
|
|
5
|
+
isSmallestDialog: false,
|
|
6
|
+
showXsDialogBorders: false,
|
|
7
|
+
showCloseButton: true,
|
|
8
|
+
};
|
|
9
|
+
export const dialogContext = createContext(initialContext);
|
|
10
|
+
export const DialogContextProvider = dialogContext.Provider;
|
|
11
|
+
export const useDialogContext = () => {
|
|
12
|
+
const context = useContext(dialogContext);
|
|
13
|
+
if (!context) {
|
|
14
|
+
throw new Error('Dialog compound components cannot be rendered outside the Dialog component');
|
|
15
|
+
}
|
|
16
|
+
return context;
|
|
17
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { MenuItemProps as MenuItem } from '../menuItems/MenuItem';
|
|
3
|
-
import type {
|
|
4
|
-
import type { ObjectValues } from '../../utils/ObjectValues';
|
|
3
|
+
import type { BUTTON_SIZE, BUTTON_STYLE, BUTTON_VARIANT } from '../button/Button';
|
|
5
4
|
export type ButtonDropdownProps = {
|
|
6
5
|
/**
|
|
7
6
|
* Unique button id. If not present a random id is generated.
|
|
@@ -31,16 +30,22 @@ export type ButtonDropdownProps = {
|
|
|
31
30
|
pullRight?: boolean;
|
|
32
31
|
/**
|
|
33
32
|
* Defines how large the button will be rendered.
|
|
33
|
+
*
|
|
34
|
+
* Possible values are: `xs`, `sm`, `md`, `lg`
|
|
34
35
|
*/
|
|
35
|
-
bsSize?:
|
|
36
|
+
bsSize?: BUTTON_SIZE;
|
|
36
37
|
/**
|
|
37
38
|
* Defines the button color.
|
|
39
|
+
*
|
|
40
|
+
* Possible values are: `default`, `primary`, `secondary`, `info`, `warning`, `danger`, `success`, `muted`
|
|
38
41
|
*/
|
|
39
|
-
bsStyle?:
|
|
42
|
+
bsStyle?: BUTTON_STYLE;
|
|
40
43
|
/**
|
|
41
44
|
* Defines the variation of the button design.
|
|
45
|
+
*
|
|
46
|
+
* Possible values are: `link`, `link-inline`, `outline`, `action`
|
|
42
47
|
*/
|
|
43
|
-
variant?:
|
|
48
|
+
variant?: BUTTON_VARIANT;
|
|
44
49
|
/**
|
|
45
50
|
* Optional prop to defines whether the dropdown title is icon only which
|
|
46
51
|
* applies different padding so the button is a square.
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import React, { type HTMLProps } from 'react';
|
|
2
|
-
import type
|
|
3
|
-
import { type SIZES_MAP, type STYLES_MAP } from '../button/Button';
|
|
2
|
+
import { type BUTTON_SIZE, type BUTTON_STYLE } from '../button/Button';
|
|
4
3
|
export type DropdownToggleButtonProps = HTMLProps<HTMLButtonElement> & {
|
|
5
4
|
id?: string;
|
|
6
5
|
disabled?: boolean;
|
|
7
6
|
splitButton?: boolean;
|
|
8
7
|
iconOnly?: boolean;
|
|
9
8
|
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
10
|
-
bsSize:
|
|
11
|
-
bsStyle:
|
|
9
|
+
bsSize: BUTTON_SIZE;
|
|
10
|
+
bsStyle: BUTTON_STYLE;
|
|
12
11
|
className?: string;
|
|
13
12
|
};
|
|
14
13
|
declare const DropdownToggleButton: React.ForwardRefExoticComponent<Omit<React.PropsWithChildren<DropdownToggleButtonProps>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React, { type HTMLProps } from 'react';
|
|
2
|
-
import type
|
|
3
|
-
import { type SIZES_MAP, type STYLES_MAP } from '../button/Button';
|
|
2
|
+
import { BUTTON_STYLE, type BUTTON_SIZE } from '../button/Button';
|
|
4
3
|
export type SplitCaretButtonProps = HTMLProps<HTMLButtonElement> & {
|
|
5
4
|
disabled?: boolean;
|
|
6
5
|
iconOnly?: boolean;
|
|
7
6
|
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
8
|
-
bsSize:
|
|
9
|
-
bsStyle:
|
|
7
|
+
bsSize: BUTTON_SIZE;
|
|
8
|
+
bsStyle: BUTTON_STYLE;
|
|
10
9
|
className?: string;
|
|
11
10
|
};
|
|
12
11
|
declare const SplitCaretButton: React.ForwardRefExoticComponent<Omit<React.PropsWithChildren<SplitCaretButtonProps>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
declare
|
|
2
|
-
|
|
3
|
-
constructor(msg: any);
|
|
4
|
-
name: string;
|
|
5
|
-
message: any;
|
|
6
|
-
constructor: typeof MapException;
|
|
1
|
+
declare class MapException extends Error {
|
|
2
|
+
constructor(msg?: string);
|
|
7
3
|
}
|
|
8
4
|
export default MapException;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
class MapException extends Error {
|
|
2
|
+
constructor(msg) {
|
|
3
|
+
super(msg || 'no error message');
|
|
4
|
+
this.name = 'MapException';
|
|
5
|
+
// Restoring the prototype chain
|
|
6
|
+
Object.setPrototypeOf(this, MapException.prototype);
|
|
7
|
+
}
|
|
5
8
|
}
|
|
6
|
-
|
|
7
|
-
MapException.prototype.constructor = MapException;
|
|
9
|
+
export default MapException;
|