@homecode/ui 4.27.5 → 4.27.7

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.
@@ -35,6 +35,19 @@ const STORE = createStore('router', {
35
35
  this.queryString = applyQueryParams(this.path, queryParams);
36
36
  onRouteChange();
37
37
  },
38
+ addQuery(query) {
39
+ this.query = { ...this.query, ...query };
40
+ this.queryString = applyQueryParams(this.path, this.query);
41
+ onRouteChange();
42
+ },
43
+ removeQuery(fields) {
44
+ const newQuery = { ...this.query };
45
+ for (const field of fields)
46
+ delete newQuery[field];
47
+ this.query = newQuery;
48
+ this.queryString = applyQueryParams(this.path, newQuery);
49
+ onRouteChange();
50
+ },
38
51
  back() {
39
52
  history.back();
40
53
  onRouteChange();
@@ -3,7 +3,7 @@ import { useRef, useEffect } from 'react';
3
3
  import S from './Tooltip.styl.js';
4
4
  import cn from 'classnames';
5
5
 
6
- const Tooltip = ({ children, content, delay = 0, direction = 'top', blur = false, }) => {
6
+ const Tooltip = ({ className, contentClassName, children, content, delay = 0, direction = 'top', blur = false, }) => {
7
7
  const triggerRef = useRef(null);
8
8
  const tooltipRef = useRef(null);
9
9
  const timeoutRef = useRef();
@@ -66,7 +66,7 @@ const Tooltip = ({ children, content, delay = 0, direction = 'top', blur = false
66
66
  }, [content, delay, direction]);
67
67
  if (!content)
68
68
  return jsx(Fragment, { children: children });
69
- return (jsxs(Fragment, { children: [jsx("div", { ref: triggerRef, className: S.trigger, children: children }), jsx("div", { ref: tooltipRef, popover: "manual", className: cn(S.tooltip, blur && S.blur), "data-direction": direction, children: content })] }));
69
+ return (jsxs(Fragment, { children: [jsx("div", { ref: triggerRef, className: cn(S.trigger, className), children: children }), jsx("div", { ref: tooltipRef, popover: "manual", className: cn(S.tooltip, blur && S.blur, contentClassName), "data-direction": direction, children: content })] }));
70
70
  };
71
71
 
72
72
  export { Tooltip };
@@ -13,6 +13,8 @@ declare const STORE: import("justorm/dist/esm/proxy").ProxyStore<{
13
13
  un(cb: any): void;
14
14
  go(path?: any, query?: Record<string, any> | string, params?: GoParams): void;
15
15
  setParams(queryParams: Record<string, any>): void;
16
+ addQuery(query: Record<string, any>): void;
17
+ removeQuery(fields: string[]): void;
16
18
  back(): void;
17
19
  replaceState(href: string, params?: ReplaceStateParams): void;
18
20
  }>;
@@ -26,6 +28,8 @@ declare const _default: import("justorm/dist/esm/proxy").ProxyStore<{
26
28
  un(cb: any): void;
27
29
  go(path?: any, query?: string | Record<string, any>, params?: GoParams): void;
28
30
  setParams(queryParams: Record<string, any>): void;
31
+ addQuery(query: Record<string, any>): void;
32
+ removeQuery(fields: string[]): void;
29
33
  back(): void;
30
34
  replaceState(href: string, params?: ReplaceStateParams): void;
31
35
  }>;
@@ -1,5 +1,7 @@
1
1
  /// <reference types="uilib/components/tooltip/types" />
2
2
  export interface TooltipProps {
3
+ className?: string;
4
+ contentClassName?: string;
3
5
  children: React.ReactNode;
4
6
  content?: React.ReactNode;
5
7
  delay?: number;
@@ -11,4 +13,4 @@ declare module 'react' {
11
13
  popover?: string;
12
14
  }
13
15
  }
14
- export declare const Tooltip: ({ children, content, delay, direction, blur, }: TooltipProps) => JSX.Element;
16
+ export declare const Tooltip: ({ className, contentClassName, children, content, delay, direction, blur, }: TooltipProps) => JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homecode/ui",
3
- "version": "4.27.5",
3
+ "version": "4.27.7",
4
4
  "description": "React UI components library",
5
5
  "scripts": {
6
6
  "tests": "jest",