@scbt-ecom/ui 0.48.0 → 0.49.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.
@@ -6,6 +6,10 @@ type UploaderBaseClasses = {
6
6
  input?: UploaderInputClasses;
7
7
  files?: UploaderFilesClasses;
8
8
  };
9
+ export type ExternalHandlers = {
10
+ onChange?: (files: File[]) => void;
11
+ onClick?: (event: React.MouseEvent<HTMLInputElement>) => void;
12
+ };
9
13
  export interface UploaderBaseProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'placeholder' | 'value' | 'onChange'> {
10
14
  /**
11
15
  * Опции uploader-а, в нем можно валидировать файлы, указывать максимум и минимум для файлов
@@ -33,6 +37,10 @@ export interface UploaderBaseProps extends Omit<InputHTMLAttributes<HTMLInputEle
33
37
  * Значение
34
38
  */
35
39
  value?: File[];
40
+ /**
41
+ * Внешние объект handlers
42
+ */
43
+ externalHandlers?: ExternalHandlers;
36
44
  }
37
45
  export declare const UploaderBase: import('react').ForwardRefExoticComponent<UploaderBaseProps & import('react').RefAttributes<HTMLInputElement>>;
38
46
  export {};
@@ -1,10 +1,12 @@
1
1
  import { DropzoneOptions } from 'react-dropzone';
2
+ import { ExternalHandlers } from '../../UploaderBase';
2
3
  export type TUseUploader = {
3
4
  controlledFiles?: File[];
4
5
  dropzoneOptions: DropzoneOptions;
5
6
  onChange?: (files: File[]) => void;
7
+ externalHandlers?: ExternalHandlers;
6
8
  };
7
- export declare const useUploader: ({ dropzoneOptions, controlledFiles, onChange }: TUseUploader) => {
9
+ export declare const useUploader: ({ dropzoneOptions, controlledFiles, onChange, externalHandlers }: TUseUploader) => {
8
10
  filesStatus: Record<string, "error" | "success" | "loading">;
9
11
  removeFile: (index: number) => void;
10
12
  dropzoneState: import('react-dropzone').DropzoneState;
@@ -1,4 +1,5 @@
1
1
  import { DropzoneRootProps } from 'react-dropzone';
2
+ import { ExternalHandlers } from '../UploaderBase';
2
3
  export type UploaderInputClasses = {
3
4
  root?: string;
4
5
  input?: string;
@@ -13,5 +14,6 @@ export interface UploaderInputProps {
13
14
  invalid?: boolean;
14
15
  classes?: UploaderInputClasses;
15
16
  name?: string;
17
+ externalHandlers?: ExternalHandlers;
16
18
  }
17
19
  export declare const UploaderInput: import('react').ForwardRefExoticComponent<UploaderInputProps & import('react').RefAttributes<HTMLDivElement>>;
package/dist/ui.js CHANGED
@@ -1,5 +1,5 @@
1
- import { j as p, c as We, R as Ye, B as E, u as Je, f as Qe, g as Ze, h as et, i as k, k as ve, l as tt, m as nt, n as U, o as ot, A as rt, H as it, I as N, p as lt, q as me, D as ut, V as st, O as at } from "./index-jk9y4fVq.js";
2
- import { d as Kn, r as Xn, e as Wn, C as Yn, s as Jn, K as Qn, L as Zn, N as eo, P as to, a as no, S as oo, t as ro, U as io, b as lo } from "./index-jk9y4fVq.js";
1
+ import { j as p, c as We, R as Ye, B as E, u as Je, f as Qe, g as Ze, h as et, i as k, k as ve, l as tt, m as nt, n as U, o as ot, A as rt, H as it, I as N, p as lt, q as me, D as ut, V as st, O as at } from "./index-BiAdttkO.js";
2
+ import { d as Kn, r as Xn, e as Wn, C as Yn, s as Jn, K as Qn, L as Zn, N as eo, P as to, a as no, S as oo, t as ro, U as io, b as lo } from "./index-BiAdttkO.js";
3
3
  import * as P from "react";
4
4
  import { forwardRef as D, useState as he, useEffect as gt } from "react";
5
5
  import { c as w, T as Se } from "./typeGuards-BigW-JS1.js";
package/dist/widget.js CHANGED
@@ -1,4 +1,4 @@
1
- import { j as t, B as y, H as j, c as h, R as k, P as F, b as D, I as f, C as I, S as G, a as U, L as Z, d as B, A as v, e as $ } from "./index-jk9y4fVq.js";
1
+ import { j as t, B as y, H as j, c as h, R as k, P as F, b as D, I as f, C as I, S as G, a as U, L as Z, d as B, A as v, e as $ } from "./index-BiAdttkO.js";
2
2
  import { s as q, c as L } from "./scrollToElement-BjUPRtGF.js";
3
3
  import { c as p, T as c } from "./typeGuards-BigW-JS1.js";
4
4
  import { a as g } from "./useDebounce-QgEEiWs9.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scbt-ecom/ui",
3
- "version": "0.48.0",
3
+ "version": "0.49.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {