@vchasno/ui-kit 0.3.12 → 0.3.13

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.
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- import type { DatePickerProps as ReactDatePickerProps } from 'react-datepicker';
2
+ import type { ReactDatePickerProps } from 'react-datepicker';
3
3
  import { MaskedInputProps } from 'react-text-mask';
4
4
  import type { ErrorFeedback, LoadingFeedback, WithHint } from '../types';
5
5
  import './DatePicker.global.css';
6
- export type DatePickerProps = {
6
+ export interface DatePickerProps extends ReactDatePickerProps, Partial<LoadingFeedback & WithHint & ErrorFeedback> {
7
7
  label?: string;
8
8
  className?: string;
9
9
  showMask?: boolean;
@@ -11,7 +11,7 @@ export type DatePickerProps = {
11
11
  onChange: ReactDatePickerProps['onChange'];
12
12
  isClearable: ReactDatePickerProps['isClearable'];
13
13
  dateFormat?: ReactDatePickerProps['dateFormat'];
14
- } & ReactDatePickerProps & Partial<LoadingFeedback & WithHint & ErrorFeedback>;
14
+ }
15
15
  /**
16
16
  * @see <https://reactdatepicker.com/>
17
17
  */
@@ -3163,12 +3163,21 @@ const createCoords = v => ({
3163
3163
  y: v
3164
3164
  });
3165
3165
  function rectToClientRect(rect) {
3166
+ const {
3167
+ x,
3168
+ y,
3169
+ width,
3170
+ height
3171
+ } = rect;
3166
3172
  return {
3167
- ...rect,
3168
- top: rect.y,
3169
- left: rect.x,
3170
- right: rect.x + rect.width,
3171
- bottom: rect.y + rect.height
3173
+ width,
3174
+ height,
3175
+ top: y,
3176
+ left: x,
3177
+ right: x + width,
3178
+ bottom: y + height,
3179
+ x,
3180
+ y
3172
3181
  };
3173
3182
  }
3174
3183
 
@@ -3261,10 +3270,14 @@ function getOverflowAncestors(node, list, traverseIframes) {
3261
3270
  const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
3262
3271
  const win = getWindow(scrollableAncestor);
3263
3272
  if (isBody) {
3264
- return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
3273
+ const frameElement = getFrameElement(win);
3274
+ return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
3265
3275
  }
3266
3276
  return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
3267
3277
  }
3278
+ function getFrameElement(win) {
3279
+ return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
3280
+ }
3268
3281
 
3269
3282
  function getCssDimensions(element) {
3270
3283
  const css = getComputedStyle$1(element);