@doist/reactist 12.0.4 → 13.0.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/README.md +2 -0
- package/dist/reactist.cjs.development.js +153 -651
- package/dist/reactist.cjs.development.js.map +1 -1
- package/dist/reactist.cjs.production.min.js +1 -1
- package/dist/reactist.cjs.production.min.js.map +1 -1
- package/es/components/color-picker/color-picker.js +4 -4
- package/es/components/color-picker/color-picker.js.map +1 -1
- package/es/components/{dropdown → deprecated-dropdown}/dropdown.js +0 -0
- package/es/components/deprecated-dropdown/dropdown.js.map +1 -0
- package/es/components/{dropdown → deprecated-dropdown}/index.js +0 -0
- package/es/components/{checkbox → deprecated-dropdown}/index.js.map +0 -0
- package/es/components/{input → deprecated-input}/index.js +0 -0
- package/es/components/{dropdown → deprecated-input}/index.js.map +0 -0
- package/es/components/{input → deprecated-input}/input.js +0 -0
- package/es/components/deprecated-input/input.js.map +1 -0
- package/es/components/{select → deprecated-select}/index.js +0 -0
- package/es/components/{input → deprecated-select}/index.js.map +0 -0
- package/es/components/{select → deprecated-select}/select.js +0 -0
- package/es/components/deprecated-select/select.js.map +1 -0
- package/es/index.js +3 -7
- package/es/index.js.map +1 -1
- package/es/new-components/base-button/base-button.js +12 -9
- package/es/new-components/base-button/base-button.js.map +1 -1
- package/es/new-components/base-button/base-button.module.css.js +1 -1
- package/es/new-components/base-field/base-field.js +60 -16
- package/es/new-components/base-field/base-field.js.map +1 -1
- package/es/new-components/base-field/base-field.module.css.js +1 -1
- package/es/new-components/password-field/password-field.js +8 -2
- package/es/new-components/password-field/password-field.js.map +1 -1
- package/es/new-components/password-field/password-field.module.css.js +1 -1
- package/es/new-components/select-field/select-field.js +6 -2
- package/es/new-components/select-field/select-field.js.map +1 -1
- package/es/new-components/select-field/select-field.module.css.js +1 -1
- package/es/new-components/text/text.module.css.js +1 -1
- package/es/new-components/text-area/text-area.js +10 -3
- package/es/new-components/text-area/text-area.js.map +1 -1
- package/es/new-components/text-area/text-area.module.css.js +1 -1
- package/es/new-components/text-field/text-field.js +8 -2
- package/es/new-components/text-field/text-field.js.map +1 -1
- package/es/new-components/text-field/text-field.module.css.js +1 -1
- package/lib/components/color-picker/color-picker.js +1 -1
- package/lib/components/color-picker/color-picker.js.map +1 -1
- package/lib/components/{dropdown → deprecated-dropdown}/dropdown.d.ts +0 -0
- package/lib/components/{dropdown → deprecated-dropdown}/dropdown.js +0 -0
- package/lib/components/deprecated-dropdown/dropdown.js.map +1 -0
- package/lib/components/{dropdown → deprecated-dropdown}/dropdown.test.d.ts +0 -0
- package/lib/components/{dropdown → deprecated-dropdown}/index.d.ts +0 -0
- package/lib/components/{dropdown → deprecated-dropdown}/index.js +0 -0
- package/lib/components/{checkbox → deprecated-dropdown}/index.js.map +0 -0
- package/lib/components/{input → deprecated-input}/index.d.ts +0 -0
- package/lib/components/{input → deprecated-input}/index.js +0 -0
- package/lib/components/{dropdown → deprecated-input}/index.js.map +0 -0
- package/lib/components/{input → deprecated-input}/input.d.ts +0 -0
- package/lib/components/{input → deprecated-input}/input.js +0 -0
- package/lib/components/deprecated-input/input.js.map +1 -0
- package/lib/components/{input → deprecated-input}/input.test.d.ts +0 -0
- package/lib/components/{select → deprecated-select}/index.d.ts +0 -0
- package/lib/components/{select → deprecated-select}/index.js +0 -0
- package/lib/components/{input → deprecated-select}/index.js.map +0 -0
- package/lib/components/{select → deprecated-select}/select.d.ts +0 -0
- package/lib/components/{select → deprecated-select}/select.js +0 -0
- package/lib/components/deprecated-select/select.js.map +1 -0
- package/lib/components/{select → deprecated-select}/select.test.d.ts +0 -0
- package/lib/index.d.ts +3 -7
- package/lib/index.js +1 -1
- package/lib/new-components/base-button/base-button.d.ts +7 -4
- package/lib/new-components/base-button/base-button.js +1 -1
- package/lib/new-components/base-button/base-button.js.map +1 -1
- package/lib/new-components/base-button/base-button.module.css.js +1 -1
- package/lib/new-components/base-field/base-field.d.ts +66 -9
- package/lib/new-components/base-field/base-field.js +1 -1
- package/lib/new-components/base-field/base-field.js.map +1 -1
- package/lib/new-components/base-field/base-field.module.css.js +1 -1
- package/lib/new-components/password-field/password-field.d.ts +3 -2
- package/lib/new-components/password-field/password-field.js +1 -1
- package/lib/new-components/password-field/password-field.js.map +1 -1
- package/lib/new-components/password-field/password-field.module.css.js +1 -1
- package/lib/new-components/select-field/select-field.d.ts +1 -1
- package/lib/new-components/select-field/select-field.js +1 -1
- package/lib/new-components/select-field/select-field.js.map +1 -1
- package/lib/new-components/select-field/select-field.module.css.js +1 -1
- package/lib/new-components/switch-field/switch-field.d.ts +1 -1
- package/lib/new-components/text/text.module.css.js +1 -1
- package/lib/new-components/text-area/text-area.d.ts +3 -3
- package/lib/new-components/text-area/text-area.js +1 -1
- package/lib/new-components/text-area/text-area.js.map +1 -1
- package/lib/new-components/text-area/text-area.module.css.js +1 -1
- package/lib/new-components/text-field/text-field.d.ts +3 -2
- package/lib/new-components/text-field/text-field.js +1 -1
- package/lib/new-components/text-field/text-field.js.map +1 -1
- package/lib/new-components/text-field/text-field.module.css.js +1 -1
- package/package.json +1 -1
- package/styles/alert.css +1 -1
- package/styles/base-button.css +1 -1
- package/styles/base-button.module.css.css +1 -1
- package/styles/base-field.css +4 -3
- package/styles/base-field.module.css.css +1 -1
- package/styles/checkbox-field.css +1 -1
- package/styles/modal.css +1 -1
- package/styles/password-field.css +5 -4
- package/styles/password-field.module.css.css +1 -1
- package/styles/reactist.css +11 -15
- package/styles/select-field.css +4 -3
- package/styles/select-field.module.css.css +1 -1
- package/styles/switch-field.css +3 -2
- package/styles/text-area.css +4 -3
- package/styles/text-area.module.css.css +1 -1
- package/styles/text-field.css +4 -3
- package/styles/text-field.module.css.css +1 -1
- package/styles/text.css +1 -1
- package/styles/text.module.css.css +1 -1
- package/es/components/checkbox/checkbox.js +0 -24
- package/es/components/checkbox/checkbox.js.map +0 -1
- package/es/components/checkbox/index.js +0 -6
- package/es/components/deprecated-loading/deprecated-loading.js +0 -39
- package/es/components/deprecated-loading/deprecated-loading.js.map +0 -1
- package/es/components/deprecated-modal/deprecated-modal.js +0 -207
- package/es/components/deprecated-modal/deprecated-modal.js.map +0 -1
- package/es/components/deprecated-modal/index.js +0 -11
- package/es/components/deprecated-modal/index.js.map +0 -1
- package/es/components/dropdown/dropdown.js.map +0 -1
- package/es/components/input/input.js.map +0 -1
- package/es/components/popover/index.js +0 -6
- package/es/components/popover/index.js.map +0 -1
- package/es/components/popover/popover.js +0 -206
- package/es/components/popover/popover.js.map +0 -1
- package/es/components/popover/positioning-utils.js +0 -104
- package/es/components/popover/positioning-utils.js.map +0 -1
- package/es/components/select/index.js.map +0 -1
- package/es/components/select/select.js.map +0 -1
- package/lib/components/checkbox/checkbox.d.ts +0 -13
- package/lib/components/checkbox/checkbox.js +0 -2
- package/lib/components/checkbox/checkbox.js.map +0 -1
- package/lib/components/checkbox/checkbox.test.d.ts +0 -1
- package/lib/components/checkbox/index.d.ts +0 -2
- package/lib/components/checkbox/index.js +0 -2
- package/lib/components/deprecated-loading/deprecated-loading.d.ts +0 -19
- package/lib/components/deprecated-loading/deprecated-loading.js +0 -2
- package/lib/components/deprecated-loading/deprecated-loading.js.map +0 -1
- package/lib/components/deprecated-loading/deprecated-loading.test.d.ts +0 -1
- package/lib/components/deprecated-loading/index.d.ts +0 -1
- package/lib/components/deprecated-modal/deprecated-modal.d.ts +0 -88
- package/lib/components/deprecated-modal/deprecated-modal.js +0 -2
- package/lib/components/deprecated-modal/deprecated-modal.js.map +0 -1
- package/lib/components/deprecated-modal/deprecated-modal.test.d.ts +0 -1
- package/lib/components/deprecated-modal/index.d.ts +0 -10
- package/lib/components/deprecated-modal/index.js +0 -2
- package/lib/components/deprecated-modal/index.js.map +0 -1
- package/lib/components/dropdown/dropdown.js.map +0 -1
- package/lib/components/input/input.js.map +0 -1
- package/lib/components/popover/index.d.ts +0 -2
- package/lib/components/popover/index.js +0 -2
- package/lib/components/popover/index.js.map +0 -1
- package/lib/components/popover/popover.d.ts +0 -54
- package/lib/components/popover/popover.js +0 -2
- package/lib/components/popover/popover.js.map +0 -1
- package/lib/components/popover/popover.test.d.ts +0 -1
- package/lib/components/popover/positioning-utils.d.ts +0 -19
- package/lib/components/popover/positioning-utils.js +0 -2
- package/lib/components/popover/positioning-utils.js.map +0 -1
- package/lib/components/popover/positioning-utils.test.d.ts +0 -1
- package/lib/components/select/index.js.map +0 -1
- package/lib/components/select/select.js.map +0 -1
- package/styles/checkbox.css +0 -1
- package/styles/deprecated-loading.css +0 -1
- package/styles/deprecated-modal.css +0 -1
- package/styles/popover.css +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import { hasEnoughSpace, calculatePosition } from './positioning-utils.js';
|
|
4
|
-
|
|
5
|
-
class Popover extends React__default.Component {
|
|
6
|
-
constructor(...args) {
|
|
7
|
-
super(...args);
|
|
8
|
-
this.popover = void 0;
|
|
9
|
-
this.wrapper = void 0;
|
|
10
|
-
|
|
11
|
-
this._updatePopoverPosition = () => {
|
|
12
|
-
const {
|
|
13
|
-
position,
|
|
14
|
-
allowVaguePositioning,
|
|
15
|
-
gapSize
|
|
16
|
-
} = this.props;
|
|
17
|
-
const wrapperRect = this.wrapper.getBoundingClientRect();
|
|
18
|
-
const popoverRect = this.popover.getBoundingClientRect(); // Instead of using the documentElement find the nearest absolutely positioned element
|
|
19
|
-
|
|
20
|
-
const documentEl = document.documentElement;
|
|
21
|
-
let node = this.wrapper;
|
|
22
|
-
let foundParent = false;
|
|
23
|
-
|
|
24
|
-
while (!foundParent) {
|
|
25
|
-
const styles = getComputedStyle(node);
|
|
26
|
-
const position = styles.getPropertyValue('position');
|
|
27
|
-
|
|
28
|
-
if (position === 'absolute' || node === documentEl || !node.parentElement) {
|
|
29
|
-
foundParent = true;
|
|
30
|
-
} else {
|
|
31
|
-
node = node.parentElement;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const nodeRect = node.getBoundingClientRect();
|
|
36
|
-
const windowDimensions = {
|
|
37
|
-
height: nodeRect.height,
|
|
38
|
-
width: nodeRect.width
|
|
39
|
-
};
|
|
40
|
-
const popoverDimensions = {
|
|
41
|
-
height: popoverRect.height,
|
|
42
|
-
width: popoverRect.width
|
|
43
|
-
};
|
|
44
|
-
const wrapperDimensions = {
|
|
45
|
-
height: wrapperRect.height,
|
|
46
|
-
width: wrapperRect.width
|
|
47
|
-
};
|
|
48
|
-
const wrapperPositionRelative = {
|
|
49
|
-
x: wrapperRect.left - nodeRect.left,
|
|
50
|
-
y: wrapperRect.top - nodeRect.top
|
|
51
|
-
};
|
|
52
|
-
const wrapperPositionAbsolute = {
|
|
53
|
-
x: wrapperRect.left,
|
|
54
|
-
y: wrapperRect.top
|
|
55
|
-
};
|
|
56
|
-
const positionsToTry = position === 'auto' ? ['top', 'right', 'bottom', 'left', 'top'] : position === 'vertical' ? ['top', 'bottom'] : position === 'horizontal' ? ['left', 'right'] : [position];
|
|
57
|
-
|
|
58
|
-
for (let index = 0; index < positionsToTry.length; index++) {
|
|
59
|
-
const currentPosition = positionsToTry[index];
|
|
60
|
-
const enoughSpaceAtPosition = currentPosition != null ? hasEnoughSpace(windowDimensions, popoverDimensions, wrapperDimensions, wrapperPositionRelative, currentPosition, gapSize) : false;
|
|
61
|
-
|
|
62
|
-
if (enoughSpaceAtPosition || index === positionsToTry.length - 1) {
|
|
63
|
-
const popoverPosition = currentPosition != null ? calculatePosition(currentPosition, wrapperDimensions, wrapperPositionAbsolute, popoverDimensions, gapSize) : wrapperPositionAbsolute;
|
|
64
|
-
this.popover.style.top = popoverPosition.y + "px";
|
|
65
|
-
this.popover.style.left = popoverPosition.x + "px";
|
|
66
|
-
/**
|
|
67
|
-
* Correct placement if vague positioning is allowed.
|
|
68
|
-
* When it's not allowed we "cut off" popovers and display them
|
|
69
|
-
* out of the viewport to maintain their centered position.
|
|
70
|
-
*/
|
|
71
|
-
|
|
72
|
-
if (allowVaguePositioning) {
|
|
73
|
-
// correct horizontally
|
|
74
|
-
if (popoverPosition.x < 0) {
|
|
75
|
-
this.popover.style.left = 2 * gapSize + "px";
|
|
76
|
-
} // correct vertically
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
if (popoverPosition.y + popoverDimensions.height > windowDimensions.height) {
|
|
80
|
-
this.popover.style.top = windowDimensions.height - popoverDimensions.height - 2 * gapSize + "px";
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (currentPosition !== position) {
|
|
85
|
-
this.popover.className = this._getClassNameForPosition(currentPosition);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
break;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
this._getClassNameForPosition = position => {
|
|
94
|
-
const {
|
|
95
|
-
visible,
|
|
96
|
-
withArrow,
|
|
97
|
-
arrowClassName
|
|
98
|
-
} = this.props;
|
|
99
|
-
const className = classNames('reactist_popover', {
|
|
100
|
-
visible
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
if (visible && withArrow) {
|
|
104
|
-
return classNames(className, arrowClassName, {
|
|
105
|
-
arrow_top: position === 'bottom',
|
|
106
|
-
arrow_right: position === 'left',
|
|
107
|
-
arrow_bottom: position === 'auto' || position === 'top',
|
|
108
|
-
arrow_left: position === 'right'
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
return className;
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
this._updatePopoverRef = popover => {
|
|
116
|
-
this.popover = popover;
|
|
117
|
-
|
|
118
|
-
if (typeof this.props.popoverRef === 'function') {
|
|
119
|
-
this.props.popoverRef(popover);
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
this._updateWrapperRef = wrapper => {
|
|
124
|
-
this.wrapper = wrapper;
|
|
125
|
-
|
|
126
|
-
if (typeof this.props.wrapperRef === 'function') {
|
|
127
|
-
this.props.wrapperRef(wrapper);
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
componentDidMount() {
|
|
133
|
-
if (this.props.visible) {
|
|
134
|
-
this._updatePopoverPosition();
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
componentDidUpdate(prevProps) {
|
|
139
|
-
if (this.wrapper && this.props.visible) {
|
|
140
|
-
const positionChanged = prevProps.position !== this.props.position;
|
|
141
|
-
const vaguePositioningChanged = prevProps.allowVaguePositioning !== this.props.allowVaguePositioning;
|
|
142
|
-
const visibilityChanged = prevProps.visible !== this.props.visible;
|
|
143
|
-
const arrowChanged = prevProps.withArrow !== this.props.withArrow;
|
|
144
|
-
const gapSizeChanged = prevProps.gapSize !== this.props.gapSize;
|
|
145
|
-
const contentChanged = prevProps.content !== this.props.content;
|
|
146
|
-
|
|
147
|
-
if (positionChanged || vaguePositioningChanged || visibilityChanged || arrowChanged || gapSizeChanged || contentChanged) {
|
|
148
|
-
this._updatePopoverPosition();
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
render() {
|
|
154
|
-
const {
|
|
155
|
-
position,
|
|
156
|
-
wrapperClassName,
|
|
157
|
-
popoverClassName,
|
|
158
|
-
onMouseEnter,
|
|
159
|
-
onMouseLeave,
|
|
160
|
-
onClick,
|
|
161
|
-
trigger,
|
|
162
|
-
content
|
|
163
|
-
} = this.props;
|
|
164
|
-
const popoverClass = position ? this._getClassNameForPosition(position) : '';
|
|
165
|
-
const popoverContentClass = classNames('reactist_popover__content', popoverClassName);
|
|
166
|
-
const wrapperClass = classNames('reactist_popover__wrapper', wrapperClassName);
|
|
167
|
-
const triggerElement = React__default.Children.only(trigger);
|
|
168
|
-
|
|
169
|
-
function handleTriggerClick(event) {
|
|
170
|
-
// @ts-expect-error This is temporary while we revisit the Popover interface
|
|
171
|
-
if (onClick) onClick(event); // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
172
|
-
|
|
173
|
-
if (typeof triggerElement.props.onClick === 'function') {
|
|
174
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-call
|
|
175
|
-
triggerElement.props.onClick(event);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
return /*#__PURE__*/React__default.createElement("span", {
|
|
180
|
-
className: wrapperClass,
|
|
181
|
-
onMouseEnter: onMouseEnter,
|
|
182
|
-
onMouseLeave: onMouseLeave,
|
|
183
|
-
ref: this._updateWrapperRef
|
|
184
|
-
}, /*#__PURE__*/React__default.cloneElement(triggerElement, {
|
|
185
|
-
onClick: handleTriggerClick
|
|
186
|
-
}), /*#__PURE__*/React__default.createElement("span", {
|
|
187
|
-
className: popoverClass,
|
|
188
|
-
ref: this._updatePopoverRef
|
|
189
|
-
}, this.props.visible ? /*#__PURE__*/React__default.createElement("span", {
|
|
190
|
-
className: popoverContentClass
|
|
191
|
-
}, typeof content === 'function' ? content() : content) : null));
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
Popover.displayName = void 0;
|
|
197
|
-
Popover.defaultProps = void 0;
|
|
198
|
-
Popover.displayName = 'Popover';
|
|
199
|
-
Popover.defaultProps = {
|
|
200
|
-
position: 'auto',
|
|
201
|
-
gapSize: 5 // default size of the arrow (see `tooltip.less`)
|
|
202
|
-
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
export { Popover };
|
|
206
|
-
//# sourceMappingURL=popover.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"popover.js","sources":["../../../src/components/popover/popover.tsx"],"sourcesContent":["import React from 'react'\nimport classNames from 'classnames'\n\nimport { hasEnoughSpace, calculatePosition, RelativePosition } from './positioning-utils'\n\nimport './popover.less'\n\n/**\n * Position of the popover. Defaults to `auto`.\n * `auto` tries to position the tooltip to the top,\n * if there's not enough space it tries to position the tooltip clockwise (right, bottom, left).\n * Setting a distinct value like `right` will always position the popover right, regardless of available space.\n * Specifying `horizontal` will only try to position the tooltip left and right in that order.\n * Specifying `vertical` will only try to position the tooltip top and bottom in that order.\n */\ntype Position = 'left' | 'right' | 'top' | 'bottom' | 'vertical' | 'horizontal' | 'auto'\n\ntype Props = {\n visible?: boolean\n /** ref of the popover in case you need to manipulate it. */\n popoverRef?: React.Ref<HTMLElement>\n /** ref of the wrapper in case you need to manipulate it. */\n wrapperRef?: React.Ref<HTMLElement>\n /** Function to be called when the mouse enters the trigger. */\n onMouseEnter?: React.MouseEventHandler\n /** Function to be called when the mouse leaves the trigger. */\n onMouseLeave?: React.MouseEventHandler\n onClick?: React.MouseEventHandler\n /** Additional css class that is applied to the wrapper element. */\n wrapperClassName?: string\n /** Additional css class that is applied to the popover element. */\n popoverClassName?: string\n /** Additional css class that is applied to style the arrow. Not applied when `withArrow` is false. */\n arrowClassName?: string\n /** Content prop of the popover. */\n content?: (() => React.ReactNode) | React.ReactNode\n trigger?: React.ReactNode\n position: Position\n withArrow?: boolean\n /**\n * Whether vague positioning is allowed. When set to true the popover prefers to be fully visible over being correctly centered.\n */\n allowVaguePositioning?: boolean\n /** Gap between the popover wrapper and the arrow. */\n gapSize: number\n}\n\nclass Popover extends React.Component<Props> {\n public static displayName: string\n public static defaultProps: Props\n\n componentDidMount() {\n if (this.props.visible) {\n this._updatePopoverPosition()\n }\n }\n\n componentDidUpdate(prevProps: Props) {\n if (this.wrapper && this.props.visible) {\n const positionChanged = prevProps.position !== this.props.position\n const vaguePositioningChanged =\n prevProps.allowVaguePositioning !== this.props.allowVaguePositioning\n const visibilityChanged = prevProps.visible !== this.props.visible\n const arrowChanged = prevProps.withArrow !== this.props.withArrow\n const gapSizeChanged = prevProps.gapSize !== this.props.gapSize\n const contentChanged = prevProps.content !== this.props.content\n if (\n positionChanged ||\n vaguePositioningChanged ||\n visibilityChanged ||\n arrowChanged ||\n gapSizeChanged ||\n contentChanged\n ) {\n this._updatePopoverPosition()\n }\n }\n }\n\n popover!: HTMLElement\n wrapper!: HTMLElement\n\n _updatePopoverPosition = () => {\n const { position, allowVaguePositioning, gapSize } = this.props\n const wrapperRect = this.wrapper.getBoundingClientRect()\n const popoverRect = this.popover.getBoundingClientRect()\n\n // Instead of using the documentElement find the nearest absolutely positioned element\n const documentEl = document.documentElement\n let node = this.wrapper\n let foundParent = false\n while (!foundParent) {\n const styles = getComputedStyle(node)\n const position = styles.getPropertyValue('position')\n if (position === 'absolute' || node === documentEl || !node.parentElement) {\n foundParent = true\n } else {\n node = node.parentElement\n }\n }\n const nodeRect = node.getBoundingClientRect()\n const windowDimensions = {\n height: nodeRect.height,\n width: nodeRect.width,\n }\n\n const popoverDimensions = {\n height: popoverRect.height,\n width: popoverRect.width,\n }\n const wrapperDimensions = {\n height: wrapperRect.height,\n width: wrapperRect.width,\n }\n const wrapperPositionRelative = {\n x: wrapperRect.left - nodeRect.left,\n y: wrapperRect.top - nodeRect.top,\n }\n const wrapperPositionAbsolute = {\n x: wrapperRect.left,\n y: wrapperRect.top,\n }\n\n const positionsToTry: RelativePosition[] =\n position === 'auto'\n ? ['top', 'right', 'bottom', 'left', 'top']\n : position === 'vertical'\n ? ['top', 'bottom']\n : position === 'horizontal'\n ? ['left', 'right']\n : [position]\n\n for (let index = 0; index < positionsToTry.length; index++) {\n const currentPosition = positionsToTry[index]\n const enoughSpaceAtPosition =\n currentPosition != null\n ? hasEnoughSpace(\n windowDimensions,\n popoverDimensions,\n wrapperDimensions,\n wrapperPositionRelative,\n currentPosition,\n gapSize,\n )\n : false\n\n if (enoughSpaceAtPosition || index === positionsToTry.length - 1) {\n const popoverPosition =\n currentPosition != null\n ? calculatePosition(\n currentPosition,\n wrapperDimensions,\n wrapperPositionAbsolute,\n popoverDimensions,\n gapSize,\n )\n : wrapperPositionAbsolute\n this.popover.style.top = `${popoverPosition.y}px`\n this.popover.style.left = `${popoverPosition.x}px`\n\n /**\n * Correct placement if vague positioning is allowed.\n * When it's not allowed we \"cut off\" popovers and display them\n * out of the viewport to maintain their centered position.\n */\n if (allowVaguePositioning) {\n // correct horizontally\n if (popoverPosition.x < 0) {\n this.popover.style.left = `${2 * gapSize}px`\n }\n // correct vertically\n if (popoverPosition.y + popoverDimensions.height > windowDimensions.height) {\n this.popover.style.top = `${\n windowDimensions.height - popoverDimensions.height - 2 * gapSize\n }px`\n }\n }\n\n if (currentPosition !== position) {\n this.popover.className = this._getClassNameForPosition(currentPosition)\n }\n break\n }\n }\n }\n\n _getClassNameForPosition = (position: Position | undefined) => {\n const { visible, withArrow, arrowClassName } = this.props\n const className = classNames('reactist_popover', { visible })\n\n if (visible && withArrow) {\n return classNames(className, arrowClassName, {\n arrow_top: position === 'bottom',\n arrow_right: position === 'left',\n arrow_bottom: position === 'auto' || position === 'top',\n arrow_left: position === 'right',\n })\n }\n return className\n }\n\n _updatePopoverRef = (popover: HTMLElement) => {\n this.popover = popover\n if (typeof this.props.popoverRef === 'function') {\n this.props.popoverRef(popover)\n }\n }\n\n _updateWrapperRef = (wrapper: HTMLElement) => {\n this.wrapper = wrapper\n if (typeof this.props.wrapperRef === 'function') {\n this.props.wrapperRef(wrapper)\n }\n }\n\n render() {\n const {\n position,\n wrapperClassName,\n popoverClassName,\n onMouseEnter,\n onMouseLeave,\n onClick,\n trigger,\n content,\n } = this.props\n const popoverClass = position ? this._getClassNameForPosition(position) : ''\n const popoverContentClass = classNames('reactist_popover__content', popoverClassName)\n const wrapperClass = classNames('reactist_popover__wrapper', wrapperClassName)\n const triggerElement = React.Children.only<React.ReactElement>(\n trigger as React.ReactElement,\n )\n\n function handleTriggerClick(event: React.SyntheticEvent) {\n // @ts-expect-error This is temporary while we revisit the Popover interface\n if (onClick) onClick(event)\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (typeof triggerElement.props.onClick === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-call\n triggerElement.props.onClick(event)\n }\n }\n\n return (\n <span\n className={wrapperClass}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n ref={this._updateWrapperRef}\n >\n {React.cloneElement(triggerElement, { onClick: handleTriggerClick })}\n <span className={popoverClass} ref={this._updatePopoverRef}>\n {this.props.visible ? (\n <span className={popoverContentClass}>\n {typeof content === 'function' ? content() : content}\n </span>\n ) : null}\n </span>\n </span>\n )\n }\n}\nPopover.displayName = 'Popover'\nPopover.defaultProps = {\n position: 'auto',\n gapSize: 5, // default size of the arrow (see `tooltip.less`)\n}\n\nexport { Popover }\n"],"names":["Popover","React","Component","popover","wrapper","_updatePopoverPosition","position","allowVaguePositioning","gapSize","props","wrapperRect","getBoundingClientRect","popoverRect","documentEl","document","documentElement","node","foundParent","styles","getComputedStyle","getPropertyValue","parentElement","nodeRect","windowDimensions","height","width","popoverDimensions","wrapperDimensions","wrapperPositionRelative","x","left","y","top","wrapperPositionAbsolute","positionsToTry","index","length","currentPosition","enoughSpaceAtPosition","hasEnoughSpace","popoverPosition","calculatePosition","style","className","_getClassNameForPosition","visible","withArrow","arrowClassName","classNames","arrow_top","arrow_right","arrow_bottom","arrow_left","_updatePopoverRef","popoverRef","_updateWrapperRef","wrapperRef","componentDidMount","componentDidUpdate","prevProps","positionChanged","vaguePositioningChanged","visibilityChanged","arrowChanged","gapSizeChanged","contentChanged","content","render","wrapperClassName","popoverClassName","onMouseEnter","onMouseLeave","onClick","trigger","popoverClass","popoverContentClass","wrapperClass","triggerElement","Children","only","handleTriggerClick","event","ref","cloneElement","displayName","defaultProps"],"mappings":";;;;AA+CA,MAAMA,OAAN,SAAsBC,cAAK,CAACC,SAA5B;;;SAgCIC;SACAC;;SAEAC,yBAAyB;MACrB,MAAM;QAAEC,QAAF;QAAYC,qBAAZ;QAAmCC;UAAY,KAAKC,KAA1D;MACA,MAAMC,WAAW,GAAG,KAA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MAEb,IAAI,OAAOJ,cAAc,CAACpE,KAAf,CAAqB+D,OAA5B,KAAwC,UAA5C,EAAwD;;QAEpDK,cAAc,CAACpE,KAAf,CAAqB+D,OAArB,CAA6BS,KAA7B;;;;IAIR,oBACIhF,4BAAA,OAAA;MACI0C,SAAS,EAAEiC;MACXN,YAAY,EAAEA;MACdC,YAAY,EAAEA;MACdW,GAAG,EAAE,KAAK3B;KAJd,eAMKtD,cAAK,CAACkF,YAAN,CAAmBN,cAAnB,EAAmC;MAAEL,OAAO,EAAEQ;KAA9C,CANL,eAOI/E,4BAAA,OAAA;MAAM0C,SAAS,EAAE+B;MAAcQ,GAAG,EAAE,KAAK7B;KAAzC,EACK,KAAK5C,KAAL,CAAWoC,OAAX,gBACG5C,4BAAA,OAAA;MAAM0C,SAAS,EAAEgC;KAAjB,EACK,OAAOT,OAAP,KAAmB,UAAnB,GAAgCA,OAAO,EAAvC,GAA4CA,OADjD,CADH,GAIG,IALR,CAPJ,CADJ;;;;;AApMFlE,QACYoF;AADZpF,QAEYqF;AAqNlBrF,OAAO,CAACoF,WAAR,GAAsB,SAAtB;AACApF,OAAO,CAACqF,YAAR,GAAuB;EACnB/E,QAAQ,EAAE,MADS;EAEnBE,OAAO,EAAE,CAFU;;AAAA,CAAvB;;;;"}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
const hasEnoughSpace = (windowDimensions, elementDimensions, wrapperDimensions, wrapperPosition, position, gap = 0) => {
|
|
2
|
-
const {
|
|
3
|
-
height: windowHeight,
|
|
4
|
-
width: windowWidth
|
|
5
|
-
} = windowDimensions;
|
|
6
|
-
const {
|
|
7
|
-
height: elementHeight,
|
|
8
|
-
width: elementWidth
|
|
9
|
-
} = elementDimensions;
|
|
10
|
-
const {
|
|
11
|
-
height: wrapperHeight,
|
|
12
|
-
width: wrapperWidth
|
|
13
|
-
} = wrapperDimensions;
|
|
14
|
-
const {
|
|
15
|
-
x: wrapperX,
|
|
16
|
-
y: wrapperY
|
|
17
|
-
} = wrapperPosition;
|
|
18
|
-
|
|
19
|
-
const verticalPosition = _calculateVerticalPosition(wrapperPosition, wrapperDimensions, elementDimensions);
|
|
20
|
-
|
|
21
|
-
const horizontalPosition = _calculateHorizontalPosition(wrapperPosition, wrapperDimensions, elementDimensions);
|
|
22
|
-
|
|
23
|
-
const canPlaceVertically = verticalPosition >= 0 && verticalPosition + elementWidth <= windowWidth;
|
|
24
|
-
const canPlaceHorizontally = horizontalPosition >= 0 && horizontalPosition + elementHeight <= windowHeight;
|
|
25
|
-
|
|
26
|
-
if (position === 'top') {
|
|
27
|
-
return canPlaceVertically && wrapperY - elementHeight - gap >= 0;
|
|
28
|
-
} else if (position === 'right') {
|
|
29
|
-
return canPlaceHorizontally && wrapperX + wrapperWidth + elementWidth + gap <= windowWidth;
|
|
30
|
-
} else if (position === 'left') {
|
|
31
|
-
return canPlaceHorizontally && wrapperX - elementWidth - gap >= 0;
|
|
32
|
-
} else if (position === 'bottom') {
|
|
33
|
-
return canPlaceVertically && wrapperY + wrapperHeight + elementHeight + gap <= windowHeight;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return false;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
function _calculateVerticalPosition(wrapperPosition, wrapperDimensions, elementDimensions) {
|
|
40
|
-
return wrapperPosition.x + (wrapperDimensions.width - elementDimensions.width) / 2;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function _calculateHorizontalPosition(wrapperPosition, wrapperDimensions, elementDimensions) {
|
|
44
|
-
return wrapperPosition.y + (wrapperDimensions.height - elementDimensions.height) / 2;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const calculateTopCenterPosition = (wrapperDimensions, wrapperPosition, elementDimensions, gap = 0) => {
|
|
48
|
-
const x = _calculateVerticalPosition(wrapperPosition, wrapperDimensions, elementDimensions);
|
|
49
|
-
|
|
50
|
-
const y = wrapperPosition.y - elementDimensions.height - gap;
|
|
51
|
-
return {
|
|
52
|
-
x,
|
|
53
|
-
y
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const calculateBottomCenterPosition = (wrapperDimensions, wrapperPosition, elementDimensions, gap = 0) => {
|
|
58
|
-
const x = _calculateVerticalPosition(wrapperPosition, wrapperDimensions, elementDimensions);
|
|
59
|
-
|
|
60
|
-
const y = wrapperPosition.y + wrapperDimensions.height + gap;
|
|
61
|
-
return {
|
|
62
|
-
x,
|
|
63
|
-
y
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
const calculateRightCenterPosition = (wrapperDimensions, wrapperPosition, elementDimensions, gap = 0) => {
|
|
68
|
-
const x = wrapperPosition.x + wrapperDimensions.width + gap;
|
|
69
|
-
|
|
70
|
-
const y = _calculateHorizontalPosition(wrapperPosition, wrapperDimensions, elementDimensions);
|
|
71
|
-
|
|
72
|
-
return {
|
|
73
|
-
x,
|
|
74
|
-
y
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
const calculateLeftCenterPosition = (wrapperDimensions, wrapperPosition, elementDimensions, gap = 0) => {
|
|
79
|
-
const x = wrapperPosition.x - elementDimensions.width - gap;
|
|
80
|
-
|
|
81
|
-
const y = _calculateHorizontalPosition(wrapperPosition, wrapperDimensions, elementDimensions);
|
|
82
|
-
|
|
83
|
-
return {
|
|
84
|
-
x,
|
|
85
|
-
y
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
const calculatePosition = (position, wrapperDimensions, wrapperPosition, elementDimensions, gap = 0) => {
|
|
90
|
-
if (position === 'top') {
|
|
91
|
-
return calculateTopCenterPosition(wrapperDimensions, wrapperPosition, elementDimensions, gap);
|
|
92
|
-
} else if (position === 'right') {
|
|
93
|
-
return calculateRightCenterPosition(wrapperDimensions, wrapperPosition, elementDimensions, gap);
|
|
94
|
-
} else if (position === 'bottom') {
|
|
95
|
-
return calculateBottomCenterPosition(wrapperDimensions, wrapperPosition, elementDimensions, gap);
|
|
96
|
-
} else if (position === 'left') {
|
|
97
|
-
return calculateLeftCenterPosition(wrapperDimensions, wrapperPosition, elementDimensions, gap);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return wrapperPosition;
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
export { calculateBottomCenterPosition, calculateLeftCenterPosition, calculatePosition, calculateRightCenterPosition, calculateTopCenterPosition, hasEnoughSpace };
|
|
104
|
-
//# sourceMappingURL=positioning-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"positioning-utils.js","sources":["../../../src/components/popover/positioning-utils.ts"],"sourcesContent":["type Dimensions = { width: number; height: number }\ntype AbsolutePosition = { x: number; y: number }\ntype RelativePosition = 'top' | 'right' | 'bottom' | 'left'\n\ntype HasEnoughSpaceFn = (\n windowDimensions: Dimensions,\n elementDimensions: Dimensions,\n wrapperDimensions: Dimensions,\n wrapperPosition: AbsolutePosition,\n position: RelativePosition,\n gap: number,\n) => boolean\n\nconst hasEnoughSpace: HasEnoughSpaceFn = (\n windowDimensions,\n elementDimensions,\n wrapperDimensions,\n wrapperPosition,\n position,\n gap = 0,\n) => {\n const { height: windowHeight, width: windowWidth } = windowDimensions\n const { height: elementHeight, width: elementWidth } = elementDimensions\n const { height: wrapperHeight, width: wrapperWidth } = wrapperDimensions\n const { x: wrapperX, y: wrapperY } = wrapperPosition\n\n const verticalPosition = _calculateVerticalPosition(\n wrapperPosition,\n wrapperDimensions,\n elementDimensions,\n )\n const horizontalPosition = _calculateHorizontalPosition(\n wrapperPosition,\n wrapperDimensions,\n elementDimensions,\n )\n const canPlaceVertically =\n verticalPosition >= 0 && verticalPosition + elementWidth <= windowWidth\n const canPlaceHorizontally =\n horizontalPosition >= 0 && horizontalPosition + elementHeight <= windowHeight\n\n if (position === 'top') {\n return canPlaceVertically && wrapperY - elementHeight - gap >= 0\n } else if (position === 'right') {\n return canPlaceHorizontally && wrapperX + wrapperWidth + elementWidth + gap <= windowWidth\n } else if (position === 'left') {\n return canPlaceHorizontally && wrapperX - elementWidth - gap >= 0\n } else if (position === 'bottom') {\n return canPlaceVertically && wrapperY + wrapperHeight + elementHeight + gap <= windowHeight\n }\n return false\n}\n\nfunction _calculateVerticalPosition(\n wrapperPosition: AbsolutePosition,\n wrapperDimensions: Dimensions,\n elementDimensions: Dimensions,\n): number {\n return wrapperPosition.x + (wrapperDimensions.width - elementDimensions.width) / 2\n}\n\nfunction _calculateHorizontalPosition(\n wrapperPosition: AbsolutePosition,\n wrapperDimensions: Dimensions,\n elementDimensions: Dimensions,\n): number {\n return wrapperPosition.y + (wrapperDimensions.height - elementDimensions.height) / 2\n}\n\ntype CenterPositionFn = (\n wrapperDimensions: Dimensions,\n wrapperPosition: AbsolutePosition,\n elementDimensions: Dimensions,\n gap?: number,\n) => AbsolutePosition\n\nconst calculateTopCenterPosition: CenterPositionFn = (\n wrapperDimensions,\n wrapperPosition,\n elementDimensions,\n gap = 0,\n) => {\n const x = _calculateVerticalPosition(wrapperPosition, wrapperDimensions, elementDimensions)\n const y = wrapperPosition.y - elementDimensions.height - gap\n return { x, y }\n}\n\nconst calculateBottomCenterPosition: CenterPositionFn = (\n wrapperDimensions,\n wrapperPosition,\n elementDimensions,\n gap = 0,\n) => {\n const x = _calculateVerticalPosition(wrapperPosition, wrapperDimensions, elementDimensions)\n const y = wrapperPosition.y + wrapperDimensions.height + gap\n return { x, y }\n}\n\nconst calculateRightCenterPosition: CenterPositionFn = (\n wrapperDimensions,\n wrapperPosition,\n elementDimensions,\n gap = 0,\n) => {\n const x = wrapperPosition.x + wrapperDimensions.width + gap\n const y = _calculateHorizontalPosition(wrapperPosition, wrapperDimensions, elementDimensions)\n return { x, y }\n}\n\nconst calculateLeftCenterPosition: CenterPositionFn = (\n wrapperDimensions,\n wrapperPosition,\n elementDimensions,\n gap = 0,\n) => {\n const x = wrapperPosition.x - elementDimensions.width - gap\n const y = _calculateHorizontalPosition(wrapperPosition, wrapperDimensions, elementDimensions)\n return { x, y }\n}\n\ntype PositionFn = (\n position: 'top' | 'right' | 'bottom' | 'left',\n wrapperDimensions: Dimensions,\n wrapperPosition: AbsolutePosition,\n elementDimensions: Dimensions,\n gap?: number,\n) => AbsolutePosition\n\nconst calculatePosition: PositionFn = (\n position,\n wrapperDimensions,\n wrapperPosition,\n elementDimensions,\n gap = 0,\n) => {\n if (position === 'top') {\n return calculateTopCenterPosition(\n wrapperDimensions,\n wrapperPosition,\n elementDimensions,\n gap,\n )\n } else if (position === 'right') {\n return calculateRightCenterPosition(\n wrapperDimensions,\n wrapperPosition,\n elementDimensions,\n gap,\n )\n } else if (position === 'bottom') {\n return calculateBottomCenterPosition(\n wrapperDimensions,\n wrapperPosition,\n elementDimensions,\n gap,\n )\n } else if (position === 'left') {\n return calculateLeftCenterPosition(\n wrapperDimensions,\n wrapperPosition,\n elementDimensions,\n gap,\n )\n }\n return wrapperPosition\n}\n\nexport {\n hasEnoughSpace,\n calculatePosition,\n calculateTopCenterPosition,\n calculateBottomCenterPosition,\n calculateRightCenterPosition,\n calculateLeftCenterPosition,\n RelativePosition,\n}\n"],"names":["hasEnoughSpace","windowDimensions","elementDimensions","wrapperDimensions","wrapperPosition","position","gap","height","windowHeight","width","windowWidth","elementHeight","elementWidth","wrapperHeight","wrapperWidth","x","wrapperX","y","wrapperY","verticalPosition","_calculateVerticalPosition","horizontalPosition","_calculateHorizontalPosition","canPlaceVertically","canPlaceHorizontally","calculateTopCenterPosition","calculateBottomCenterPosition","calculateRightCenterPosition","calculateLeftCenterPosition","calculatePosition"],"mappings":"MAaMA,cAAc,GAAqB,CACrCC,gBADqC,EAErCC,iBAFqC,EAGrCC,iBAHqC,EAIrCC,eAJqC,EAKrCC,QALqC,EAMrCC,GAAG,GAAG,CAN+B;EAQrC,MAAM;IAAEC,MAAM,EAAEC,YAAV;IAAwBC,KAAK,EAAEC;MAAgBT,gBAArD;EACA,MAAM;IAAEM,MAAM,EAAEI,aAAV;IAAyBF,KAAK,EAAEG;MAAiBV,iB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iBADkD,EAElDC,eAFkD,EAGlDF,iBAHkD,EAIlDI,GAAG,GAAG,CAJ4C;EAMlD,MAAMS,CAAC,GAAGX,eAAe,CAACW,CAAhB,GAAoBb,iBAAiB,CAACO,KAAtC,GAA8CH,GAAxD;;EACA,MAAMW,CAAC,GAAGK,4BAA4B,CAAClB,eAAD,EAAkBD,iBAAlB,EAAqCD,iBAArC,CAAtC;;EACA,OAAO;IAAEa,CAAF;IAAKE;GAAZ;AACH;;MAUKY,iBAAiB,GAAe,CAClCxB,QADkC,EAElCF,iBAFkC,EAGlCC,eAHkC,EAIlCF,iBAJkC,EAKlCI,GAAG,GAAG,CAL4B;EAOlC,IAAID,QAAQ,KAAK,KAAjB,EAAwB;IACpB,OAAOoB,0BAA0B,CAC7BtB,iBAD6B,EAE7BC,eAF6B,EAG7BF,iBAH6B,EAI7BI,GAJ6B,CAAjC;GADJ,MAOO,IAAID,QAAQ,KAAK,OAAjB,EAA0B;IAC7B,OAAOsB,4BAA4B,CAC/BxB,iBAD+B,EAE/BC,eAF+B,EAG/BF,iBAH+B,EAI/BI,GAJ+B,CAAnC;GADG,MAOA,IAAID,QAAQ,KAAK,QAAjB,EAA2B;IAC9B,OAAOqB,6BAA6B,CAChCvB,iBADgC,EAEhCC,eAFgC,EAGhCF,iBAHgC,EAIhCI,GAJgC,CAApC;GADG,MAOA,IAAID,QAAQ,KAAK,MAAjB,EAAyB;IAC5B,OAAOuB,2BAA2B,CAC9BzB,iBAD8B,EAE9BC,eAF8B,EAG9BF,iBAH8B,EAI9BI,GAJ8B,CAAlC;;;EAOJ,OAAOF,eAAP;AACH;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sources":["../../../src/components/select/select.tsx"],"sourcesContent":["import React from 'react'\nimport classNames from 'classnames'\n\nimport './select.less'\n\ntype Option = {\n /** Optional key for each option. If not provided `value` is used. */\n key?: string | number\n /** Value of the option. */\n value: string | number\n /** Text to display for the option. */\n text?: string | number\n /** Whether the options is disabled or not. */\n disabled?: boolean\n}\n\ntype Props = {\n className?: string\n disabled?: boolean\n /** Currently selected value. */\n value?: string | number\n /** Callback for the change event. Will be called with the next value (not the full event). */\n onChange?: (value: string) => void\n /** Options that are rendered in the select. */\n options?: Option[]\n /** Value to initially be set */\n defaultValue?: string | number\n}\n\nfunction Select({\n value,\n options = [],\n onChange,\n disabled = true,\n className = '',\n defaultValue,\n ...otherProps\n}: Props) {\n const selectClassName = classNames('reactist_select', { disabled }, className)\n return (\n <select\n className={selectClassName}\n value={value}\n onChange={(event) => (onChange ? onChange(event.target.value) : undefined)}\n disabled={disabled}\n defaultValue={defaultValue}\n {...otherProps}\n >\n {options?.map((option) => (\n <option\n key={option.key || option.value}\n value={option.value}\n disabled={option.disabled}\n >\n {option.text}\n </option>\n ))}\n </select>\n )\n}\nSelect.displayName = 'Select'\nSelect.defaultProps = {\n options: [],\n disabled: false,\n}\n\nexport { Select }\n"],"names":["Select","value","options","onChange","disabled","className","defaultValue","otherProps","selectClassName","classNames","React","event","target","undefined","map","option","key","text","displayName","defaultProps"],"mappings":";;;;;;AA6BA,SAASA,MAAT;MAAgB;IACZC,KADY;IAEZC,OAAO,GAAG,EAFE;IAGZC,QAHY;IAIZC,QAAQ,GAAG,IAJC;IAKZC,SAAS,GAAG,EALA;IAMZC;;MACGC;;EAEH,MAAMC,eAAe,GAAGC,UAAU,CAAC,iBAAD,EAAoB;IAAEL;GAAtB,EAAkCC,SAAlC,CAAlC;EACA,oBACIK,4BAAA,SAAA;IACIL,SAAS,EAAEG,eADf;IAEIP,KAAK,EAAEA,KAFX;IAGIE,QAAQ,EAAGQ,KAAD,IAAYR,QAAQ,GAAGA,QAAQ,CAACQ,KAAK,CAACC,MAAN,CAAaX,KAAd,CAAX,GAAkCY,SAHpE;IAIIT,QAAQ,EAAEA,QAJd;IAKIE,YAAY,EAAEA;KACVC,UANR,GAQKL,OARL,oBAQKA,OAAO,CAAEY,GAAT,CAAcC,MAAD,iBACVL,4BAAA,SAAA;IACIM,GAAG,EAAED,MAAM,CAACC,GAAP,IAAcD,MAAM,CAACd;IAC1BA,KAAK,EAAEc,MAAM,CAACd;IACdG,QAAQ,EAAEW,MAAM,CAACX;GAHrB,EAKKW,MAAM,CAACE,IALZ,CADH,CARL,CADJ;AAoBH;;AACDjB,MAAM,CAACkB,WAAP,GAAqB,QAArB;AACAlB,MAAM,CAACmB,YAAP,GAAsB;EAClBjB,OAAO,EAAE,EADS;EAElBE,QAAQ,EAAE;AAFQ,CAAtB;;;;"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import './checkbox.less';
|
|
3
|
-
declare type Props = {
|
|
4
|
-
checked?: boolean;
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
onChange?: (checked: boolean) => void;
|
|
7
|
-
label?: string | number;
|
|
8
|
-
};
|
|
9
|
-
declare function Checkbox({ label, disabled, checked, onChange }: Props): JSX.Element;
|
|
10
|
-
declare namespace Checkbox {
|
|
11
|
-
var displayName: string;
|
|
12
|
-
}
|
|
13
|
-
export { Checkbox };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=(e=require("react"))&&"object"==typeof e&&"default"in e?e.default:e;function c({label:e,disabled:c,checked:a=!1,onChange:l}){return t.createElement("label",{className:"reactist_checkbox"},t.createElement("input",{className:"reactist_checkbox--input",value:e,checked:a,disabled:c,onChange:c||!l?void 0:e=>l(e.target.checked),type:"checkbox"}),e)}c.displayName="Checkbox",exports.Checkbox=c;
|
|
2
|
-
//# sourceMappingURL=checkbox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","sources":["../../../src/components/checkbox/checkbox.tsx"],"sourcesContent":["import React from 'react'\n\nimport './checkbox.less'\n\ntype Props = {\n checked?: boolean\n disabled?: boolean\n onChange?: (checked: boolean) => void\n label?: string | number\n}\n\nfunction Checkbox({ label, disabled, checked = false, onChange }: Props) {\n return (\n <label className=\"reactist_checkbox\">\n <input\n className=\"reactist_checkbox--input\"\n value={label}\n checked={checked}\n disabled={disabled}\n onChange={\n disabled || !onChange ? undefined : (event) => onChange(event.target.checked)\n }\n type=\"checkbox\"\n />\n {label}\n </label>\n )\n}\nCheckbox.displayName = 'Checkbox'\n\nexport { Checkbox }\n"],"names":["Checkbox","label","disabled","checked","onChange","React","className","value","undefined","event","target","type","displayName"],"mappings":"gJAWA,SAASA,GAASC,MAAEA,EAAFC,SAASA,EAATC,QAAmBA,GAAU,EAA7BC,SAAoCA,IAClD,OACIC,yBAAOC,UAAU,qBACbD,yBACIC,UAAU,2BACVC,MAAON,EACPE,QAASA,EACTD,SAAUA,EACVE,SACIF,IAAaE,OAAWI,EAAaC,GAAUL,EAASK,EAAMC,OAAOP,SAEzEQ,KAAK,aAERV,GAIbD,EAASY,YAAc"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import './deprecated-loading.less';
|
|
3
|
-
declare type Props = {
|
|
4
|
-
/** Additional css class that is applied to Loading. */
|
|
5
|
-
className?: string;
|
|
6
|
-
/** Hex code of the spinner color. */
|
|
7
|
-
spinnerColor?: string;
|
|
8
|
-
/** Hex code of the background color. */
|
|
9
|
-
bgColor?: string;
|
|
10
|
-
/** Circle diameter in pixels. */
|
|
11
|
-
size?: string | number;
|
|
12
|
-
'aria-label'?: string;
|
|
13
|
-
};
|
|
14
|
-
/** @deprecated */
|
|
15
|
-
declare function Loading({ className, spinnerColor, bgColor, size, 'aria-label': ariaLabel, }: Props): JSX.Element;
|
|
16
|
-
declare namespace Loading {
|
|
17
|
-
var displayName: string;
|
|
18
|
-
}
|
|
19
|
-
export { Loading };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var a=e(require("react")),l=e(require("classnames"));function t({className:e,spinnerColor:t="#3F82EF",bgColor:r="#D9E6FB",size:i=24,"aria-label":n="Loading"}){return a.createElement("div",{className:l("reactist_loading",e),"aria-label":n,"aria-live":"assertive",role:"alert"},a.createElement("span",{className:"reactist_loading--spinner"},a.createElement("svg",{width:i,height:i,viewBox:"0 0 24 24"},a.createElement("g",{fill:"none",fillRule:"nonzero"},a.createElement("path",{fill:t,d:"M17.945 3.958A9.955 9.955 0 0 0 12 2c-2.19 0-4.217.705-5.865 1.9L5.131 2.16A11.945 11.945 0 0 1 12 0c2.59 0 4.99.82 6.95 2.217l-1.005 1.741z"}),a.createElement("path",{fill:r,d:"M5.13 2.16L6.136 3.9A9.987 9.987 0 0 0 2 12c0 5.523 4.477 10 10 10s10-4.477 10-10a9.986 9.986 0 0 0-4.055-8.042l1.006-1.741A11.985 11.985 0 0 1 24 12c0 6.627-5.373 12-12 12S0 18.627 0 12c0-4.073 2.029-7.671 5.13-9.84z"})))))}t.displayName="Loading",exports.Loading=t;
|
|
2
|
-
//# sourceMappingURL=deprecated-loading.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deprecated-loading.js","sources":["../../../src/components/deprecated-loading/deprecated-loading.tsx"],"sourcesContent":["import React from 'react'\nimport classNames from 'classnames'\n\nimport './deprecated-loading.less'\n\ntype Props = {\n /** Additional css class that is applied to Loading. */\n className?: string\n /** Hex code of the spinner color. */\n spinnerColor?: string\n /** Hex code of the background color. */\n bgColor?: string\n /** Circle diameter in pixels. */\n size?: string | number\n\n 'aria-label'?: string\n}\n\n/** @deprecated */\nfunction Loading({\n className,\n spinnerColor = '#3F82EF',\n bgColor = '#D9E6FB',\n size = 24,\n 'aria-label': ariaLabel = 'Loading',\n}: Props) {\n return (\n <div\n className={classNames('reactist_loading', className)}\n aria-label={ariaLabel}\n aria-live=\"assertive\"\n role=\"alert\"\n >\n <span className=\"reactist_loading--spinner\">\n <svg width={size} height={size} viewBox={'0 0 24 24'}>\n <g fill=\"none\" fillRule=\"nonzero\">\n <path\n fill={spinnerColor}\n d=\"M17.945 3.958A9.955 9.955 0 0 0 12 2c-2.19 0-4.217.705-5.865 1.9L5.131 2.16A11.945 11.945 0 0 1 12 0c2.59 0 4.99.82 6.95 2.217l-1.005 1.741z\"\n />\n <path\n fill={bgColor}\n d=\"M5.13 2.16L6.136 3.9A9.987 9.987 0 0 0 2 12c0 5.523 4.477 10 10 10s10-4.477 10-10a9.986 9.986 0 0 0-4.055-8.042l1.006-1.741A11.985 11.985 0 0 1 24 12c0 6.627-5.373 12-12 12S0 18.627 0 12c0-4.073 2.029-7.671 5.13-9.84z\"\n />\n </g>\n </svg>\n </span>\n </div>\n )\n}\n\nLoading.displayName = 'Loading'\n\nexport { Loading }\n"],"names":["Loading","className","spinnerColor","bgColor","size","aria-label","ariaLabel","React","classNames","role","width","height","viewBox","fill","fillRule","d","displayName"],"mappings":"+LAmBA,SAASA,GAAQC,UACbA,EADaC,aAEbA,EAAe,UAFFC,QAGbA,EAAU,UAHGC,KAIbA,EAAO,GACPC,aAAcC,EAAY,YAE1B,OACIC,uBACIN,UAAWO,EAAW,mBAAoBP,gBAC9BK,cACF,YACVG,KAAK,SAELF,wBAAMN,UAAU,6BACZM,uBAAKG,MAAON,EAAMO,OAAQP,EAAMQ,QAAS,aACrCL,qBAAGM,KAAK,OAAOC,SAAS,WACpBP,wBACIM,KAAMX,EACNa,EAAE,iJAENR,wBACIM,KAAMV,EACNY,EAAE,kOAS9Bf,EAAQgB,YAAc"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Loading as DeprecatedLoading } from './deprecated-loading';
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './deprecated-modal.less';
|
|
3
|
-
declare type Props = {
|
|
4
|
-
/** Additional css class applied to the Modal.Box. */
|
|
5
|
-
className?: string;
|
|
6
|
-
/** Sometimes a class name is not enough so you can use this to set the style directly. */
|
|
7
|
-
style?: React.CSSProperties;
|
|
8
|
-
/** Large style. */
|
|
9
|
-
large: boolean;
|
|
10
|
-
/** Medium size syle. */
|
|
11
|
-
medium?: boolean;
|
|
12
|
-
/** Close the Modal when clicking on the overlay. */
|
|
13
|
-
closeOnOverlayClick: boolean;
|
|
14
|
-
};
|
|
15
|
-
/** @deprecated */
|
|
16
|
-
declare class Box extends React.Component<React.PropsWithChildren<Props>> {
|
|
17
|
-
static displayName: string;
|
|
18
|
-
static defaultProps: Props;
|
|
19
|
-
componentDidMount(): void;
|
|
20
|
-
componentWillUnmount(): void;
|
|
21
|
-
_closeModal: () => void;
|
|
22
|
-
_handleKeyDown: (event: Partial<KeyboardEvent>) => void;
|
|
23
|
-
_handleOverlayClick: (event: React.MouseEvent<Element>) => void;
|
|
24
|
-
render(): JSX.Element;
|
|
25
|
-
}
|
|
26
|
-
declare type HeaderProps = {
|
|
27
|
-
/** Title of the Modal.Header. */
|
|
28
|
-
title?: string | React.ReactNode;
|
|
29
|
-
/** Subtitle of the Modal.Header. */
|
|
30
|
-
subtitle?: string | React.ReactNode;
|
|
31
|
-
/** Function that is called right before the Modal unmounts itself. */
|
|
32
|
-
beforeClose?: () => void;
|
|
33
|
-
};
|
|
34
|
-
/** @deprecated */
|
|
35
|
-
declare class Header extends React.Component<React.PropsWithChildren<HeaderProps>> {
|
|
36
|
-
static displayName: string;
|
|
37
|
-
static defaultProps: HeaderProps;
|
|
38
|
-
_closeModal(event: React.MouseEvent): void;
|
|
39
|
-
render(): JSX.Element;
|
|
40
|
-
}
|
|
41
|
-
declare type BodyProps = {
|
|
42
|
-
/** Display an icon (or basically any component) on the right hand side of the Modal.Body. */
|
|
43
|
-
icon?: React.ReactNode;
|
|
44
|
-
/** Applies less styles on the body (e.g. no padding) */
|
|
45
|
-
plain?: boolean;
|
|
46
|
-
/** Sometimes a class name is not enough so you can use this to set the style directly. */
|
|
47
|
-
style?: React.CSSProperties;
|
|
48
|
-
/** Additionall css class applied to the Modal.Body. */
|
|
49
|
-
className?: string;
|
|
50
|
-
/**
|
|
51
|
-
* Render a close icon in the top right corner of the Modal.Body.
|
|
52
|
-
* Recommended to use when no Modal.Header is used.
|
|
53
|
-
*/
|
|
54
|
-
showCloseIcon?: boolean;
|
|
55
|
-
};
|
|
56
|
-
/** @deprecated */
|
|
57
|
-
declare class Body extends React.Component<React.PropsWithChildren<BodyProps>> {
|
|
58
|
-
static displayName: string;
|
|
59
|
-
static defaultProps: BodyProps;
|
|
60
|
-
_closeModal(event: React.MouseEvent): void;
|
|
61
|
-
render(): JSX.Element;
|
|
62
|
-
}
|
|
63
|
-
declare type ActionProps = {
|
|
64
|
-
/**
|
|
65
|
-
* Children to render inside the Modal.Actions. They can have an optional `close` property (boolean).
|
|
66
|
-
* When that is supplied and set to true it will close the modal after the onClick function
|
|
67
|
-
*/
|
|
68
|
-
children?: React.ReactNode;
|
|
69
|
-
};
|
|
70
|
-
declare type ActionChildrenProps = {
|
|
71
|
-
close?: boolean;
|
|
72
|
-
onClick?: () => void;
|
|
73
|
-
};
|
|
74
|
-
/** @deprecated */
|
|
75
|
-
declare class Actions extends React.Component<ActionProps> {
|
|
76
|
-
static displayName: string;
|
|
77
|
-
_onClick(onClick: ActionChildrenProps['onClick']): void;
|
|
78
|
-
render(): JSX.Element;
|
|
79
|
-
}
|
|
80
|
-
/** @deprecated */
|
|
81
|
-
declare type Modal = {
|
|
82
|
-
Box: Box;
|
|
83
|
-
Header: Header;
|
|
84
|
-
Body: Body;
|
|
85
|
-
Actions: Actions;
|
|
86
|
-
};
|
|
87
|
-
export type { Modal };
|
|
88
|
-
export { Box, Header, Body, Actions };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("react")),o=e(require("classnames")),l=e(require("react-dom")),s=require("../icons/CloseIcon.svg.js");class n extends t.Component{constructor(...e){super(...e),this._closeModal=()=>{const e=document.getElementById("modal_box");l.unmountComponentAtNode(e)},this._handleKeyDown=e=>{27===e.keyCode&&(this._closeModal(),e.preventDefault&&e.preventDefault())},this._handleOverlayClick=e=>{e.target instanceof Element&&("reactist-overlay"===e.target.id||"reactist-overlay-inner"===e.target.id)&&this._closeModal()}}componentDidMount(){window.addEventListener("keydown",this._handleKeyDown)}componentWillUnmount(){window.removeEventListener("keydown",this._handleKeyDown)}render(){const{large:e,medium:l,style:s,children:n,closeOnOverlayClick:a}=this.props,r=o("reactist_modal_box",{large:e,medium:l},this.props.className);return t.createElement("div",{className:"reactist_overlay",id:"reactist-overlay",onClick:a?this._handleOverlayClick:void 0},t.createElement("div",{className:"reactist_overlay_inner",id:"reactist-overlay-inner"},t.createElement("div",{style:s,className:r},n)))}}n.displayName=void 0,n.defaultProps=void 0,n.displayName="Modal.Box",n.defaultProps={large:!1,closeOnOverlayClick:!1};class a extends t.Component{_closeModal(e){e.preventDefault(),"function"==typeof this.props.beforeClose&&this.props.beforeClose();const t=document.getElementById("modal_box");l.unmountComponentAtNode(t)}render(){return t.createElement("div",{className:"reactist_modal_box__header"},t.createElement("p",null,this.props.title&&t.createElement("span",{className:"title"},this.props.title),this.props.subtitle&&t.createElement("span",{className:"subtitle"},this.props.subtitle),this.props.children),t.createElement("a",{className:"close",onClick:this._closeModal.bind(this),href:"#"},t.createElement(s.default,null)))}}a.displayName=void 0,a.defaultProps=void 0,a.displayName="Modal.Header";class r extends t.Component{_closeModal(e){e.preventDefault();const t=document.getElementById("modal_box");l.unmountComponentAtNode(t)}render(){const{icon:e,plain:l,children:n,style:a,showCloseIcon:r}=this.props,i=o("reactist_modal_box__body",{plain:l},this.props.className);return t.createElement("div",{className:i,style:a},r&&t.createElement("a",{className:"close",onClick:this._closeModal.bind(this),href:"#"},t.createElement(s.default,null)),e?t.createElement("div",{className:"dialog"},t.createElement("div",{className:"reactist_icon"},e),t.createElement("div",{className:"content"},n)):n)}}r.displayName=void 0,r.defaultProps=void 0,r.displayName="Modal.Body",r.defaultProps={showCloseIcon:!1};class i extends t.Component{_onClick(e){e&&e();const t=document.getElementById("modal_box");l.unmountComponentAtNode(t)}render(){const e=t.Children.map(this.props.children,e=>{var o;return null!=e&&null!=(o=e.props)&&o.close?t.cloneElement(e,{onClick:()=>this._onClick(e.props.onClick)}):e?t.cloneElement(e):t.createElement(t.Fragment,null)});return t.createElement("div",{className:"reactist_modal_box__actions"},e)}}i.displayName=void 0,i.displayName="Modal.Actions",exports.Actions=i,exports.Body=r,exports.Box=n,exports.Header=a;
|
|
2
|
-
//# sourceMappingURL=deprecated-modal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deprecated-modal.js","sources":["../../../src/components/deprecated-modal/deprecated-modal.tsx"],"sourcesContent":["import React from 'react'\nimport ReactDOM from 'react-dom'\nimport classnames from 'classnames'\n\nimport CloseIcon from '../icons/CloseIcon.svg'\n\nimport './deprecated-modal.less'\n\ntype Props = {\n /** Additional css class applied to the Modal.Box. */\n className?: string\n /** Sometimes a class name is not enough so you can use this to set the style directly. */\n style?: React.CSSProperties\n /** Large style. */\n large: boolean\n /** Medium size syle. */\n medium?: boolean\n /** Close the Modal when clicking on the overlay. */\n closeOnOverlayClick: boolean\n}\n\n/** @deprecated */\nclass Box extends React.Component<React.PropsWithChildren<Props>> {\n public static displayName: string\n public static defaultProps: Props\n\n componentDidMount() {\n window.addEventListener('keydown', this._handleKeyDown)\n }\n\n componentWillUnmount() {\n window.removeEventListener('keydown', this._handleKeyDown)\n }\n\n _closeModal = () => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const modalElement = document.getElementById('modal_box')!\n ReactDOM.unmountComponentAtNode(modalElement)\n }\n\n _handleKeyDown = (event: Partial<KeyboardEvent>) => {\n if (event.keyCode === 27) {\n // ESC\n this._closeModal()\n if (event.preventDefault) event.preventDefault()\n }\n }\n\n _handleOverlayClick = (event: React.MouseEvent<Element>) => {\n if (\n event.target instanceof Element &&\n (event.target.id === 'reactist-overlay' || event.target.id === 'reactist-overlay-inner')\n ) {\n this._closeModal()\n }\n }\n\n render() {\n const { large, medium, style, children, closeOnOverlayClick } = this.props\n\n const className = classnames('reactist_modal_box', { large, medium }, this.props.className)\n\n return (\n <div\n className=\"reactist_overlay\"\n id=\"reactist-overlay\"\n onClick={closeOnOverlayClick ? this._handleOverlayClick : undefined}\n >\n <div className=\"reactist_overlay_inner\" id=\"reactist-overlay-inner\">\n <div style={style} className={className}>\n {children}\n </div>\n </div>\n </div>\n )\n }\n}\nBox.displayName = 'Modal.Box'\nBox.defaultProps = {\n large: false,\n closeOnOverlayClick: false,\n}\n\ntype HeaderProps = {\n /** Title of the Modal.Header. */\n title?: string | React.ReactNode\n /** Subtitle of the Modal.Header. */\n subtitle?: string | React.ReactNode\n /** Function that is called right before the Modal unmounts itself. */\n beforeClose?: () => void\n}\n\n/** @deprecated */\nclass Header extends React.Component<React.PropsWithChildren<HeaderProps>> {\n public static displayName: string\n public static defaultProps: HeaderProps\n\n _closeModal(event: React.MouseEvent) {\n event.preventDefault()\n if (typeof this.props.beforeClose === 'function') {\n this.props.beforeClose()\n }\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const modalElement = document.getElementById('modal_box')!\n ReactDOM.unmountComponentAtNode(modalElement)\n }\n\n render() {\n return (\n /* eslint-disable jsx-a11y/anchor-is-valid */\n <div className=\"reactist_modal_box__header\">\n <p>\n {this.props.title && <span className=\"title\">{this.props.title}</span>}\n {this.props.subtitle && <span className=\"subtitle\">{this.props.subtitle}</span>}\n {this.props.children}\n </p>\n <a className=\"close\" onClick={this._closeModal.bind(this)} href=\"#\">\n <CloseIcon />\n </a>\n </div>\n /* eslint-enable jsx-a11y/anchor-is-valid */\n )\n }\n}\nHeader.displayName = 'Modal.Header'\n\ntype BodyProps = {\n /** Display an icon (or basically any component) on the right hand side of the Modal.Body. */\n icon?: React.ReactNode\n /** Applies less styles on the body (e.g. no padding) */\n plain?: boolean\n /** Sometimes a class name is not enough so you can use this to set the style directly. */\n style?: React.CSSProperties\n /** Additionall css class applied to the Modal.Body. */\n className?: string\n /**\n * Render a close icon in the top right corner of the Modal.Body.\n * Recommended to use when no Modal.Header is used.\n */\n showCloseIcon?: boolean\n}\n\n/** @deprecated */\nclass Body extends React.Component<React.PropsWithChildren<BodyProps>> {\n public static displayName: string\n public static defaultProps: BodyProps\n\n _closeModal(event: React.MouseEvent) {\n event.preventDefault()\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const modalElement = document.getElementById('modal_box')!\n ReactDOM.unmountComponentAtNode(modalElement)\n }\n\n render() {\n const { icon, plain, children, style, showCloseIcon } = this.props\n const className = classnames('reactist_modal_box__body', { plain }, this.props.className)\n\n return (\n /* eslint-disable jsx-a11y/anchor-is-valid */\n <div className={className} style={style}>\n {showCloseIcon && (\n <a className=\"close\" onClick={this._closeModal.bind(this)} href=\"#\">\n <CloseIcon />\n </a>\n )}\n {icon ? (\n <div className=\"dialog\">\n <div className=\"reactist_icon\">{icon}</div>\n <div className=\"content\">{children}</div>\n </div>\n ) : (\n children\n )}\n </div>\n /* eslint-enable jsx-a11y/anchor-is-valid */\n )\n }\n}\nBody.displayName = 'Modal.Body'\nBody.defaultProps = {\n showCloseIcon: false,\n}\n\ntype ActionProps = {\n /**\n * Children to render inside the Modal.Actions. They can have an optional `close` property (boolean).\n * When that is supplied and set to true it will close the modal after the onClick function\n */\n children?: React.ReactNode\n}\n\ntype ActionChildrenProps = {\n close?: boolean\n onClick?: () => void\n}\n\n/** @deprecated */\nclass Actions extends React.Component<ActionProps> {\n public static displayName: string\n\n _onClick(onClick: ActionChildrenProps['onClick']) {\n if (onClick) {\n onClick()\n }\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const modalElement = document.getElementById('modal_box')!\n ReactDOM.unmountComponentAtNode(modalElement)\n }\n\n render() {\n const children = React.Children.map(\n // see: https://github.com/microsoft/TypeScript/issues/21699\n // @ts-expect-error Children cannot be typed properly yet in React\n this.props.children,\n (child: React.ReactElement<ActionChildrenProps>) => {\n if (child?.props?.close) {\n return React.cloneElement(child, {\n onClick: () => this._onClick(child.props.onClick),\n })\n } else {\n return child ? React.cloneElement(child) : <></>\n }\n },\n )\n\n return <div className=\"reactist_modal_box__actions\">{children}</div>\n }\n}\n\nActions.displayName = 'Modal.Actions'\n\n/** @deprecated */\ntype Modal = {\n Box: Box\n Header: Header\n Body: Body\n Actions: Actions\n}\n\nexport type { Modal }\n\nexport { Box, Header, Body, Actions }\n"],"names":["Box","React","Component","_closeModal","modalElement","document","getElementById","ReactDOM","unmountComponentAtNode","_handleKeyDown","event","keyCode","this","preventDefault","_handleOverlayClick","target","Element","id","componentDidMount","window","addEventListener","componentWillUnmount","removeEventListener","render","large","medium","style","children","closeOnOverlayClick","props","className","classnames","onClick","undefined","displayName","defaultProps","Header","beforeClose","title","subtitle","bind","href","CloseIcon","Body","icon","plain","showCloseIcon","Actions","_onClick","Children","map","child","_child$props","close","cloneElement"],"mappings":"gQAsBA,MAAMA,UAAYC,EAAMC,6CAYpBC,YAAc,KAEV,MAAMC,EAAeC,SAASC,eAAe,aAC7CC,EAASC,uBAAuBJ,SAGpCK,eAAkBC,IACQ,KAAlBA,EAAMC,UAENC,KAAKT,cACDO,EAAMG,gBAAgBH,EAAMG,wBAIxCC,oBAAuBJ,IAEfA,EAAMK,kBAAkBC,UACH,qBAApBN,EAAMK,OAAOE,IAAiD,2BAApBP,EAAMK,OAAOE,KAExDL,KAAKT,eA3Bbe,oBACIC,OAAOC,iBAAiB,UAAWR,KAAKH,gBAG5CY,uBACIF,OAAOG,oBAAoB,UAAWV,KAAKH,gBA0B/Cc,SACI,MAAMC,MAAEA,EAAFC,OAASA,EAATC,MAAiBA,EAAjBC,SAAwBA,EAAxBC,oBAAkCA,GAAwBhB,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AAWA,EAAWJ,MAAOA,GAC7BoB,GACG7C,qBAAG6B,UAAU,QAAQE,QAASpB,KAAKT,YAAYqC,KAAK5B,MAAO6B,KAAK,KAC5DxC,gBAACyC,iBAGRE,EACG3C,uBAAK6B,UAAU,UACX7B,uBAAK6B,UAAU,iBAAiBc,GAChC3C,uBAAK6B,UAAU,WAAWH,IAG9BA,IA7BdgB,EACYT,mBADZS,EAEYR,oBAkClBQ,EAAKT,YAAc,aACnBS,EAAKR,aAAe,CAChBW,eAAe,GAiBnB,MAAMC,UAAgB9C,EAAMC,UAGxB8C,SAAShB,GACDA,GACAA,IAGJ,MAAM5B,EAAeC,SAASC,eAAe,aAC7CC,EAASC,uBAAuBJ,GAGpCmB,SACI,MAAMI,EAAW1B,EAAMgD,SAASC,IAG5BtC,KAAKiB,MAAMF,SACVwB,UACG,aAAIA,YAAAA,EAAOtB,QAAPuB,EAAcC,MACPpD,EAAMqD,aAAaH,EAAO,CAC7BnB,QAAS,IAAMpB,KAAKoC,SAASG,EAAMtB,MAAMG,WAGtCmB,EAAQlD,EAAMqD,aAAaH,GAASlD,mCAKvD,OAAOA,uBAAK6B,UAAU,+BAA+BH,IA5BvDoB,EACYb,mBA+BlBa,EAAQb,YAAc"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Box, Header, Body, Actions } from './deprecated-modal';
|
|
2
|
-
import type { Modal } from './deprecated-modal';
|
|
3
|
-
declare const _default: {
|
|
4
|
-
Box: typeof Box;
|
|
5
|
-
Header: typeof Header;
|
|
6
|
-
Body: typeof Body;
|
|
7
|
-
Actions: typeof Actions;
|
|
8
|
-
};
|
|
9
|
-
export default _default;
|
|
10
|
-
export type { Modal };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/deprecated-modal/index.ts"],"sourcesContent":["import { Box, Header, Body, Actions } from './deprecated-modal'\nimport type { Modal } from './deprecated-modal'\n\nexport default { Box, Header, Body, Actions }\nexport type { Modal }\n"],"names":["Box","Header","Body","Actions"],"mappings":"2HAGe,KAAEA,aAAKC,cAAQC,eAAMC"}
|