indicator-ui 0.0.206 → 0.0.207

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.
@@ -0,0 +1,2 @@
1
+ import { CascadeSelectorOptionsType, CascadeSelectorValueType } from "../types";
2
+ export declare function getAllValues(options: CascadeSelectorOptionsType): CascadeSelectorValueType;
@@ -0,0 +1 @@
1
+ export * from './getAllValues';
@@ -1,9 +1,11 @@
1
1
  import React from "react";
2
2
  import { CascadeSelectorOptionsType } from "./CascadeSelectorTypes";
3
3
  export type CascadeBlockPropsType = {
4
- value: any[];
5
- onClick: (value: any) => void;
6
4
  options: CascadeSelectorOptionsType;
5
+ value: any[];
6
+ changeValue?: (value: any) => void;
7
+ addValues?: (values: any[]) => void;
8
+ removeValues?: (values: any[]) => void;
7
9
  label?: React.ReactNode;
8
10
  supportingText?: React.ReactNode;
9
11
  noWrapper?: boolean;
@@ -10,13 +10,19 @@ export type CascadeSelectorOptionsCascadeType = {
10
10
  options?: CascadeSelectorOptionsType;
11
11
  };
12
12
  export type CascadeSelectorOptionsType = (CascadeSelectorOptionsCascadeType | CascadeSelectorOptionsItemType)[];
13
+ export type CascadeSelectorValueItemType = any;
14
+ export type CascadeSelectorValueType = CascadeSelectorValueItemType[];
13
15
  export type CascadeSelectorPropsType = {
14
16
  /**
15
17
  * Учтите, что переменные сравниваются без глубокого сравнения, то есть словари, массивы будут сравниваться по значению указателя.
16
18
  * */
17
- value?: any | any[];
18
- onChange?: (value: any[]) => void;
19
+ value?: CascadeSelectorValueItemType | CascadeSelectorValueType;
20
+ onChange?: (value: CascadeSelectorValueType) => void;
19
21
  options?: CascadeSelectorOptionsType;
20
22
  multiple?: boolean;
21
23
  defaultAllHidden?: boolean;
24
+ /**
25
+ * Максимальное количество выбираемых опций.
26
+ * */
27
+ maxChosenOptions?: number;
22
28
  };
@@ -1,2 +1,2 @@
1
1
  import { CascadeBlockPropsType } from "../types";
2
- export declare function CascadeBlock({ options, onClick, label, supportingText, noWrapper, defaultAllHidden, value }: CascadeBlockPropsType): import("react/jsx-runtime").JSX.Element | import("react/jsx-runtime").JSX.Element[];
2
+ export declare function CascadeBlock({ options, changeValue, addValues, removeValues, label, supportingText, noWrapper, defaultAllHidden, value }: CascadeBlockPropsType): import("react/jsx-runtime").JSX.Element | import("react/jsx-runtime").JSX.Element[];
@@ -1,2 +1,2 @@
1
1
  import { CascadeSelectorPropsType } from "../types";
2
- export declare function CascadeSelector({ value, options, onChange, multiple, defaultAllHidden }: CascadeSelectorPropsType): import("react/jsx-runtime").JSX.Element;
2
+ export declare function CascadeSelector({ value, options, onChange, multiple, defaultAllHidden, maxChosenOptions, }: CascadeSelectorPropsType): import("react/jsx-runtime").JSX.Element;
@@ -25,6 +25,10 @@ export type CheckboxPropsType = {
25
25
  disabled?: boolean;
26
26
  text?: React.ReactNode;
27
27
  onClick?: () => void;
28
+ /**
29
+ * Клик именно на значок checkbox. Предотвращает ```onClick```.
30
+ * */
31
+ onCheckboxMarkClick?: () => void;
28
32
  supportingText?: React.ReactNode;
29
33
  width?: 'fill' | 'hug';
30
34
  height?: 'fill' | 'hug';
@@ -1,2 +1,2 @@
1
1
  import { CheckboxPropsType } from "../types";
2
- export declare function Checkbox({ checked, type, error, subtype, disabled, text, supportingText, indeterminate, onClick, width, height, className, }: CheckboxPropsType): import("react/jsx-runtime").JSX.Element;
2
+ export declare function Checkbox({ checked, type, error, subtype, disabled, text, supportingText, indeterminate, onClick, width, height, onCheckboxMarkClick, additionStyle, }: CheckboxPropsType): import("react/jsx-runtime").JSX.Element;
@@ -38,6 +38,6 @@ export type CheckboxMarkPropsType = {
38
38
  * Добавочные имена стилей. ```className="main-style addition-style-1 addition-style-2..."```
39
39
  * */
40
40
  additionStyle?: string | string[];
41
- onClick?: () => void;
41
+ onClick?: React.MouseEventHandler<HTMLElement>;
42
42
  className?: CheckboxMarkClassNameType;
43
43
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "indicator-ui",
3
- "version": "0.0.206",
3
+ "version": "0.0.207",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/types/src/index.d.ts",
6
6
  "style": "dist/index.css",