@homecode/ui 4.19.8 → 4.20.0-beta-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.
Files changed (31) hide show
  1. package/dist/esm/index.js +1 -0
  2. package/dist/esm/src/components/Autocomplete/Autocomplete.js +3 -1
  3. package/dist/esm/src/components/Draggable/Draggable.js +1 -1
  4. package/dist/esm/src/components/Draggable/Draggable.styl.js +2 -2
  5. package/dist/esm/src/components/Input/Input.js +150 -200
  6. package/dist/esm/src/components/Input/Input.styl.js +2 -2
  7. package/dist/esm/src/components/InputFile/InputFile.js +2 -1
  8. package/dist/esm/src/components/Notifications/Notifications.js +7 -7
  9. package/dist/esm/src/components/Popup/Popup.js +28 -31
  10. package/dist/esm/src/components/Router/Link/Link.js +4 -3
  11. package/dist/esm/src/components/Router/Route.js +3 -1
  12. package/dist/esm/src/components/Router/Router.js +4 -2
  13. package/dist/esm/src/components/Select/Select.js +4 -4
  14. package/dist/esm/src/components/Select/Select2.js +305 -0
  15. package/dist/esm/src/hooks/useThrottle.js +28 -0
  16. package/dist/esm/src/services/i18n.js +13 -7
  17. package/dist/esm/types/src/components/Icon/Icon.d.ts +2 -0
  18. package/dist/esm/types/src/components/Input/Input.d.ts +1 -42
  19. package/dist/esm/types/src/components/Lazy/Lazy.d.ts +1 -0
  20. package/dist/esm/types/src/components/Notifications/Notifications.d.ts +5 -1
  21. package/dist/esm/types/src/components/Popup/Popup.d.ts +8 -1
  22. package/dist/esm/types/src/components/Router/Link/Link.d.ts +2 -1
  23. package/dist/esm/types/src/components/Router/Route.d.ts +4 -4
  24. package/dist/esm/types/src/components/Select/Select.d.ts +1 -2
  25. package/dist/esm/types/src/components/Select/Select.helpers.d.ts +1 -1
  26. package/dist/esm/types/src/components/Select/Select.types.d.ts +5 -3
  27. package/dist/esm/types/src/components/Select/Select2.d.ts +2 -0
  28. package/dist/esm/types/src/components/index.d.ts +1 -0
  29. package/dist/esm/types/src/hooks/useThrottle.d.ts +5 -0
  30. package/dist/esm/types/src/services/i18n.d.ts +14 -4
  31. package/package.json +2 -2
@@ -1,44 +1,3 @@
1
- import { Component, ChangeEvent } from 'react';
2
1
  import * as T from './Input.types';
3
2
  export type InputProps = T.Props;
4
- export declare class Input extends Component<T.Props> {
5
- inputRef: import("react").RefObject<HTMLInputElement>;
6
- isClearPressed: boolean;
7
- cursorPos: number;
8
- prevLabelText: string;
9
- store: any;
10
- uid: any;
11
- static defaultProps: {
12
- type: string;
13
- size: string;
14
- variant: string;
15
- };
16
- constructor(props: T.Props);
17
- componentDidMount(): void;
18
- componentDidUpdate(prevProps: T.Props): void;
19
- updateAutoComplete(): void;
20
- updateSelection(): void;
21
- updateLabelPosition(): void;
22
- updateHasValue(): void;
23
- hasValue(value?: any): boolean;
24
- isTextArea: () => boolean;
25
- isNumber: () => boolean;
26
- isLabelOnTop(hasValue?: any): any;
27
- getValue(val?: any): any;
28
- onTextareaPaste: (e: any) => void;
29
- pasteToTextarea: any;
30
- onClearPress: (e: any) => void;
31
- onDocKeyUp: (e: KeyboardEvent) => void;
32
- handleChange: (e: ChangeEvent<HTMLInputElement>) => void;
33
- onChange: (value: string, e?: ChangeEvent<HTMLInputElement>) => void;
34
- onNumberWheel: (delta: any) => void;
35
- onTextAreaInput: (e: any) => void;
36
- onLabelClipPathChange: (clipPath: string) => string;
37
- onTypingEnd: () => void;
38
- onFocus: (e: any) => void;
39
- onBlur: (e: any) => void;
40
- getControlProps(): T.ControlProps;
41
- wrapControll(control: any): JSX.Element;
42
- renderAddon(type: 'right' | 'left'): JSX.Element;
43
- render(): JSX.Element;
44
- }
3
+ export declare const Input: (props: T.Props) => JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import { Component, ComponentType } from 'react';
2
2
  import * as T from './Lazy.types';
3
+ export type LazyProps = T.Props;
3
4
  export declare class Lazy extends Component<T.Props> {
4
5
  store: T.State;
5
6
  Node?: ComponentType<any>;
@@ -1,2 +1,6 @@
1
+ type Props = {
2
+ store?: any;
3
+ };
1
4
  export declare const NotificationsStore: any;
2
- export declare const Notifications: any;
5
+ export declare const Notifications: (props: Props) => JSX.Element;
6
+ export {};
@@ -16,7 +16,6 @@ export declare class Popup extends Component<T.Props> {
16
16
  needDropOffset: boolean;
17
17
  id: any;
18
18
  parentPopupContent: any;
19
- store: any;
20
19
  timers: any;
21
20
  scrollParent: any;
22
21
  offset: {
@@ -28,6 +27,14 @@ export declare class Popup extends Component<T.Props> {
28
27
  direction: string;
29
28
  animated: boolean;
30
29
  };
30
+ state: {
31
+ rootPopupId: any;
32
+ isOpen: boolean;
33
+ isContentVisible: boolean;
34
+ animating: boolean;
35
+ direction: T.Direction;
36
+ triggerBounds: any;
37
+ };
31
38
  constructor(props: any);
32
39
  componentDidMount(): void;
33
40
  componentDidUpdate(prevProps: T.Props): void;
@@ -1 +1,2 @@
1
- export declare const Link: any;
1
+ import * as T from './Link.types';
2
+ export declare const Link: ({ className, exactClassName, children, href: hrefProp, isClear, isDisabled, disableExternalIcon, inline, isPartialExact, onClick, ...rest }: T.Props) => JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import * as T from './Router.types';
2
- export declare const Route: {
3
- (props: T.RouteProps): any;
4
- displayName: string;
5
- };
2
+ export declare function Route<T extends T.RouteProps>(props: T.RouteProps): any;
3
+ export declare namespace Route {
4
+ var displayName: string;
5
+ }
@@ -1,11 +1,10 @@
1
1
  import * as H from './Select.helpers';
2
2
  import * as T from './Select.types';
3
3
  import { Component, ReactNode } from 'react';
4
- import { Input } from 'uilib/components/Input/Input';
5
4
  export declare const SelectHelpers: typeof H;
6
5
  export declare class Select extends Component<T.Props, T.State> {
7
6
  store: any;
8
- inputRef: import("react").RefObject<Input>;
7
+ inputRef: import("react").RefObject<(props: import("../Input/Input.types").Props) => JSX.Element>;
9
8
  triggerInputRef: import("react").RefObject<HTMLDivElement>;
10
9
  contentRef: import("react").RefObject<HTMLDivElement>;
11
10
  scrollInnerElem: HTMLDivElement;
@@ -10,5 +10,5 @@ type IdsMap = {
10
10
  [key: string]: Option['id'][];
11
11
  };
12
12
  };
13
- export declare function mapById(options: any): IdsMap;
13
+ export declare function mapById(options: Option[]): IdsMap;
14
14
  export {};
@@ -30,13 +30,14 @@ type InheritedInputProps = Partial<Pick<InputProps, 'onFocus' | 'onBlur'>>;
30
30
  export type Props = FormControl<Value> & InheritedInputProps & {
31
31
  className?: string;
32
32
  isOpen?: boolean;
33
+ closeOnSelect?: boolean;
33
34
  optionsClassName?: string;
34
35
  optionClassName?: string;
35
36
  additionalLabel?: ReactNode;
36
37
  size?: Size;
37
38
  variant?: 'default' | 'outlined';
38
39
  showSelectedCount?: boolean;
39
- disableLable?: boolean;
40
+ disableLabel?: boolean;
40
41
  blur?: boolean;
41
42
  options: Option[];
42
43
  additionalOptions?: Option[];
@@ -47,7 +48,7 @@ export type Props = FormControl<Value> & InheritedInputProps & {
47
48
  searchValue?: string;
48
49
  expandSelected?: boolean;
49
50
  onChange: (value: Value) => void;
50
- onSeachChange?: (value: string) => void;
51
+ onSearchChange?: (value: string) => void;
51
52
  onOpen?: () => void;
52
53
  onClose?: () => void;
53
54
  isSearchable?: boolean;
@@ -68,7 +69,8 @@ export type State = {
68
69
  searchVal: string;
69
70
  options: Option[];
70
71
  labelClipPath: string;
71
- optionsTreeUpd: number;
72
+ optionsUpdated: number;
73
+ focusedItemIndex: number;
72
74
  };
73
75
  export type OptionElemProps = HTMLAttributes<HTMLDivElement> & {
74
76
  className: string;
@@ -0,0 +1,2 @@
1
+ import * as T from './Select.types';
2
+ export declare function Select2(props: T.Props): JSX.Element;
@@ -28,6 +28,7 @@ export * from './PopupMenu/PopupMenu';
28
28
  export * from './Router/Router';
29
29
  export * from './RequiredStar/RequiredStar';
30
30
  export * from './Select/Select';
31
+ export * from './Select/Select2';
31
32
  export * from './Scroll/Scroll';
32
33
  export * from './Shimmer/Shimmer';
33
34
  export * from './Spinner/Spinner';
@@ -0,0 +1,5 @@
1
+ type ThrottleOptions = {
2
+ trailing?: boolean;
3
+ };
4
+ export declare function useThrottle<T extends any[]>(cb: (...args: T) => void, limit: number, options?: ThrottleOptions, deps?: any[]): (...args: T) => void;
5
+ export {};
@@ -4,12 +4,22 @@ type LangLoader = () => Promise<{
4
4
  type RegisterConfig = {
5
5
  [lang: string]: LangLoader;
6
6
  };
7
- export declare const store: any;
7
+ type I18NProps = {
8
+ id?: string;
9
+ children?: React.ReactNode;
10
+ props?: number | Record<string, any>;
11
+ };
12
+ export declare const store: import("justorm/dist/esm/proxy").ProxyStore<{
13
+ lang: string | void;
14
+ changeLang(lang: any): Promise<void>;
15
+ }>;
8
16
  export declare function init(config: RegisterConfig): {
9
17
  storeName: string;
10
- componentStore: any;
11
- withI18N: (Component: any) => any;
18
+ componentStore: import("justorm/dist/esm/proxy").ProxyStore<{
19
+ _updated: string;
20
+ }>;
21
+ withI18N: (Component: any) => (props: any) => JSX.Element;
12
22
  i18n: (key: any, props?: any) => any;
13
- I18N: import("react").MemoExoticComponent<any>;
23
+ I18N: import("react").NamedExoticComponent<I18NProps>;
14
24
  };
15
25
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homecode/ui",
3
- "version": "4.19.8",
3
+ "version": "4.20.0-beta-0",
4
4
  "description": "React UI components library",
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -49,7 +49,7 @@
49
49
  "fastest-validator": "^1.16.0",
50
50
  "favicons": "^7.1.3",
51
51
  "favicons-webpack-plugin": "^6.0.0",
52
- "justorm": "^3.0.0-beta-10",
52
+ "justorm": "3.0.0-beta-24",
53
53
  "lodash.omit": "^4.5.0",
54
54
  "lodash.pick": "^4.4.0",
55
55
  "moment": "^2.29.4",