@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
  */
@@ -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
  */
@@ -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
  */
@@ -3232,12 +3232,21 @@ const createCoords = v => ({
3232
3232
  y: v
3233
3233
  });
3234
3234
  function rectToClientRect(rect) {
3235
+ const {
3236
+ x,
3237
+ y,
3238
+ width,
3239
+ height
3240
+ } = rect;
3235
3241
  return {
3236
- ...rect,
3237
- top: rect.y,
3238
- left: rect.x,
3239
- right: rect.x + rect.width,
3240
- bottom: rect.y + rect.height
3242
+ width,
3243
+ height,
3244
+ top: y,
3245
+ left: x,
3246
+ right: x + width,
3247
+ bottom: y + height,
3248
+ x,
3249
+ y
3241
3250
  };
3242
3251
  }
3243
3252
 
@@ -3330,10 +3339,14 @@ function getOverflowAncestors(node, list, traverseIframes) {
3330
3339
  const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
3331
3340
  const win = getWindow(scrollableAncestor);
3332
3341
  if (isBody) {
3333
- return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
3342
+ const frameElement = getFrameElement(win);
3343
+ return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
3334
3344
  }
3335
3345
  return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
3336
3346
  }
3347
+ function getFrameElement(win) {
3348
+ return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
3349
+ }
3337
3350
 
3338
3351
  function getCssDimensions(element) {
3339
3352
  const css = getComputedStyle$1(element);