react-ui-basics 0.0.192 → 0.0.193
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/DNDContainer.js +6 -2
- package/DNDContainer.js.map +1 -1
- package/DatePicker.js +13 -4
- package/DatePicker.js.map +1 -1
- package/Tools.d.ts +3 -3
- package/Tools.js.map +1 -1
- package/bundle.css +675 -675
- package/package.json +1 -1
- package/src/DNDContainer.tsx +6 -2
- package/src/DatePicker.tsx +14 -4
- package/src/ResizeObserver.ts +1 -0
- package/src/Tools.ts +1 -1
package/package.json
CHANGED
package/src/DNDContainer.tsx
CHANGED
|
@@ -27,8 +27,12 @@ const clearSelection = () => {
|
|
|
27
27
|
} else if (getSelection().removeAllRanges) { // Firefox
|
|
28
28
|
getSelection().removeAllRanges();
|
|
29
29
|
}
|
|
30
|
-
} else
|
|
31
|
-
|
|
30
|
+
} else {
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
if (DOCUMENT.selection) { // IE?
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
DOCUMENT.selection.empty();
|
|
35
|
+
}
|
|
32
36
|
}
|
|
33
37
|
};
|
|
34
38
|
|
package/src/DatePicker.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import ReactDOM from "react-dom";
|
|
|
3
3
|
import './DatePicker.css'
|
|
4
4
|
import TextField from "./TextField";
|
|
5
5
|
import * as DateTools from "./DateTools";
|
|
6
|
-
import {orNoop, classNames, preventDefault, ref} from "./Tools";
|
|
6
|
+
import {orNoop, classNames, preventDefault, ref, WINDOW} from "./Tools";
|
|
7
7
|
import Button from './Button'
|
|
8
8
|
import CalendarMonthView from "./CalendarMonthView";
|
|
9
9
|
import MaterialIcon from "./MaterialIcon";
|
|
@@ -92,10 +92,20 @@ class DatePicker extends React.Component<DatePickerProps, DatePickerState> {
|
|
|
92
92
|
};
|
|
93
93
|
|
|
94
94
|
private getPopupStyles = () => {
|
|
95
|
-
const
|
|
95
|
+
const textInputBoundingRect = this.el.getBoundingClientRect();
|
|
96
|
+
const popupBoundingRect = this.popup.getBoundingClientRect();
|
|
97
|
+
let left = textInputBoundingRect.left;
|
|
98
|
+
let top = textInputBoundingRect.bottom;
|
|
99
|
+
if (left + popupBoundingRect.width > WINDOW.innerWidth) {
|
|
100
|
+
left = textInputBoundingRect.right - popupBoundingRect.width;
|
|
101
|
+
}
|
|
102
|
+
if (top + popupBoundingRect.height > WINDOW.innerHeight) {
|
|
103
|
+
top = textInputBoundingRect.top - popupBoundingRect.height;
|
|
104
|
+
}
|
|
105
|
+
|
|
96
106
|
return {
|
|
97
|
-
left:
|
|
98
|
-
top:
|
|
107
|
+
left: left + 'px',
|
|
108
|
+
top: top + 'px',
|
|
99
109
|
}
|
|
100
110
|
};
|
|
101
111
|
|
package/src/ResizeObserver.ts
CHANGED
package/src/Tools.ts
CHANGED