@mw-kit/mw-ui 1.8.13 → 1.8.14

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,16 +1,20 @@
1
1
  import type { GenericObject } from '../../../../../../interfaces';
2
2
  import type { CommonContext, CommonProps, Option } from '../interfaces';
3
+ import type { Limits } from './utils';
3
4
  export interface SelectProps<T extends GenericObject = GenericObject> extends CommonProps<T> {
4
5
  type: 'select-multiple';
5
6
  setValue: (value: string[], data: Option<T>['data'][]) => void;
6
7
  value: (Pick<Option<T>, 'value' | 'data'> | string)[];
7
8
  selectAll?: boolean;
8
9
  dirty?: (() => void) | Pick<Option<T>, 'value' | 'data'>[];
10
+ minSelected?: number;
11
+ maxSelected?: number;
9
12
  }
10
13
  export interface ContextInterface extends CommonContext<SelectProps> {
11
14
  checked: [
12
15
  Pick<Option, 'value' | 'data'>[],
13
16
  React.Dispatch<React.SetStateAction<Pick<Option, 'value' | 'data'>[]>>
14
17
  ];
18
+ limits: Limits;
15
19
  }
16
20
  export * from '../interfaces';
@@ -0,0 +1,7 @@
1
+ export declare const resolveLimits: (minSelected?: number, maxSelected?: number) => {
2
+ min?: number;
3
+ max?: number;
4
+ enabled: boolean;
5
+ error?: string;
6
+ };
7
+ export type Limits = ReturnType<typeof resolveLimits>;
package/dist/index.d.mts CHANGED
@@ -1350,6 +1350,8 @@ interface SelectProps$1<T extends GenericObject = GenericObject> extends CommonP
1350
1350
  value: (Pick<Option$1<T>, 'value' | 'data'> | string)[];
1351
1351
  selectAll?: boolean;
1352
1352
  dirty?: (() => void) | Pick<Option$1<T>, 'value' | 'data'>[];
1353
+ minSelected?: number;
1354
+ maxSelected?: number;
1353
1355
  }
1354
1356
 
1355
1357
  type SelectProps<T extends GenericObject = GenericObject> = SelectProps$2<T> | SelectProps$1<T>;