@acrool/react-picker 0.1.0-test.3 → 0.1.1-alpha.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.
@@ -1,5 +1,5 @@
1
1
  import { RefObject } from 'react';
2
- import { EVertical } from '../types';
2
+ import { EVertical, IPosition } from '../types';
3
3
  /**
4
4
  * Get the closest scrollable parent of an element.
5
5
  * Caches results for performance.
@@ -9,6 +9,7 @@ export declare function getScrollParent(element: HTMLElement): HTMLElement | Win
9
9
  * Update the position of the picker element relative to the anchor element.
10
10
  * @param anchorRef Reference to the anchor element.
11
11
  * @param pickerRef Reference to the picker element.
12
- * @param setVertical Callback to set vertical alignment.
12
+ * @param importantPosition 強制指定位置
13
+ * @param setVertical 設定垂直(top/bottom, 讓選擇棄可以決定順序
13
14
  */
14
- export declare const updatePosition: (anchorRef: RefObject<HTMLElement>, pickerRef: RefObject<HTMLElement>, setVertical: (vertical: EVertical) => void) => void;
15
+ export declare const updatePosition: (anchorRef: RefObject<HTMLElement>, pickerRef: RefObject<HTMLElement>, setVertical: (vertical: EVertical) => void, importantPosition?: IPosition) => void;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { EVertical } from './types';
2
+ import { EVertical, IPosition } from './types';
3
3
  interface IContextProps<T = any> {
4
4
  hide: () => void;
5
5
  show: () => void;
@@ -9,6 +9,7 @@ interface IContextProps<T = any> {
9
9
  inputBlur: () => void;
10
10
  isInputFocus: boolean;
11
11
  value?: T;
12
+ importantPosition?: IPosition;
12
13
  vertical: EVertical;
13
14
  setVertical: (vertical: EVertical) => void;
14
15
  onChange: (value: T) => void;