@hai-dev/ui-kit 1.0.2 → 1.0.4
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.
- package/dist/{Button-0AB7oP6Y.js → Button-DDlVTM6i.js} +3 -2
- package/dist/ButtonBase-CXGZ-DBC.js +1346 -0
- package/dist/{CircularProgress-BD6BPlN2.js → CircularProgress-CscJm1An.js} +9 -8
- package/dist/{DialogTitle-iOQ7wKEt.js → DialogTitle-KN1sayHD.js} +453 -555
- package/dist/assets/photo-list.css +1 -0
- package/dist/assets/upload-dialog.css +1 -1
- package/dist/components/button/button.js +1 -1
- package/dist/components/photo-crop-uploader/components/error-upload-dialog/error-upload-dialog.js +87 -23
- package/dist/components/photo-crop-uploader/components/photo-list/constants.d.ts +1 -0
- package/dist/components/photo-crop-uploader/components/photo-list/constants.js +4 -0
- package/dist/components/photo-crop-uploader/components/photo-list/index.d.ts +1 -0
- package/dist/components/photo-crop-uploader/components/photo-list/index.js +4 -0
- package/dist/components/photo-crop-uploader/components/photo-list/photo-list.d.ts +3 -0
- package/dist/components/photo-crop-uploader/components/photo-list/photo-list.js +88 -0
- package/dist/components/photo-crop-uploader/components/photo-list/types.d.ts +8 -0
- package/dist/components/photo-crop-uploader/components/photo-list/types.js +1 -0
- package/dist/components/photo-crop-uploader/components/upload-button/types.d.ts +3 -1
- package/dist/components/photo-crop-uploader/components/upload-button/upload-button.js +72 -62
- package/dist/components/photo-crop-uploader/components/upload-dialog/constants.d.ts +1 -0
- package/dist/components/photo-crop-uploader/components/upload-dialog/constants.js +4 -0
- package/dist/components/photo-crop-uploader/components/upload-dialog/types.d.ts +5 -2
- package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog.js +170 -136
- package/dist/components/photo-crop-uploader/constants.d.ts +3 -0
- package/dist/components/photo-crop-uploader/constants.js +36 -33
- package/dist/components/photo-crop-uploader/locale.js +8 -2
- package/dist/components/photo-crop-uploader/photo-crop-uploader.js +163 -112
- package/dist/components/photo-crop-uploader/types.d.ts +3 -1
- package/dist/components/photo-crop-uploader/utils/get-default-cropped-photo.d.ts +3 -0
- package/dist/components/photo-crop-uploader/utils/get-default-cropped-photo.js +32 -0
- package/dist/components/photo-crop-uploader/utils/get-photo-crop.d.ts +1 -1
- package/dist/components/photo-crop-uploader/utils/get-photo-crop.js +12 -12
- package/dist/components/photo-crop-uploader/utils/index.d.ts +1 -0
- package/dist/components/photo-crop-uploader/utils/index.js +4 -2
- package/dist/components/photo-crop-uploader/utils/read-photo.js +33 -30
- package/dist/createTheme-DSHGFfg6.js +4124 -0
- package/dist/extendSxProp-CzeED7BH.js +49 -0
- package/package.json +1 -1
- package/dist/ButtonBase-Bw_3RZmN.js +0 -5453
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._photoList_rrp1z_1{display:flex;flex-direction:column;margin-left:12px}._photoList_rrp1z_1 ._item_rrp1z_6{width:80px;height:80px;border-radius:12px;background-color:#f2f3f5;display:flex;align-items:center;justify-content:center;text-align:center;color:#303030}._photoList_rrp1z_1 ._item_rrp1z_6._image_rrp1z_17{object-fit:cover;object-position:center}._photoList_rrp1z_1 ._item_rrp1z_6+._item_rrp1z_6{margin-top:16px}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._dialog_1d9zm_1 .MuiPaper-root{border-radius:24px;padding:48px;min-width:840px;max-width:100%}._dialog_1d9zm_1 .MuiPaper-root ._topActions_1d9zm_7{position:absolute;right:0;top:0;padding:32px}._dialog_1d9zm_1 .MuiPaper-root ._topActions_1d9zm_7 ._close_1d9zm_13{width:40px;height:40px}._dialog_1d9zm_1 .MuiPaper-root ._botActions_1d9zm_17{padding:0;display:flex;justify-content:space-between}._dialog_1d9zm_1 .MuiPaper-root ._botActions_1d9zm_17 ._button_1d9zm_22{width:100%;text-transform:none}._dialog_1d9zm_1 .MuiPaper-root ._title_1d9zm_26{padding:0;font-weight:600;font-size:32px;line-height:100%}._dialog_1d9zm_1 .MuiPaper-root ._content_1d9zm_32{margin:32px 0 24px;padding-bottom:0;display:flex;align-items:center;justify-content:center;overflow:visible}._dialog_1d9zm_1 .MuiPaper-root ._content_1d9zm_32._many_1d9zm_40{justify-content:space-between}._dialog_1d9zm_1 .MuiPaper-root ._content_1d9zm_32 ._photoList_1d9zm_43{display:flex;flex-direction:column}._dialog_1d9zm_1 .MuiPaper-root ._content_1d9zm_32 ._crop_1d9zm_47{max-height:670px}._dialog_1d9zm_1 .MuiPaper-root ._content_1d9zm_32 ._crop_1d9zm_47 .ReactCrop__child-wrapper,._dialog_1d9zm_1 .MuiPaper-root ._content_1d9zm_32 ._crop_1d9zm_47 .ReactCrop__crop-mask{border-radius:12px}._dialog_1d9zm_1 .MuiPaper-root ._dialogText_1d9zm_56{color:#e2402fe0}@keyframes marching-ants{0%{background-position:0 0,0 100%,0 0,100% 0}to{background-position:20px 0,-20px 100%,0 -20px,100% 20px}}:root{--rc-drag-handle-size: 12px;--rc-drag-handle-mobile-size: 24px;--rc-drag-handle-bg-colour: rgba(0, 0, 0, .2);--rc-drag-bar-size: 6px;--rc-border-color: rgba(255, 255, 255, .7);--rc-focus-color: #0088ff}.ReactCrop{position:relative;display:inline-block;cursor:crosshair;max-width:100%}.ReactCrop *,.ReactCrop *:before,.ReactCrop *:after{box-sizing:border-box}.ReactCrop--disabled,.ReactCrop--locked{cursor:inherit}.ReactCrop__child-wrapper{overflow:hidden;max-height:inherit}.ReactCrop__child-wrapper>img,.ReactCrop__child-wrapper>video{display:block;max-width:100%;max-height:inherit}.ReactCrop:not(.ReactCrop--disabled) .ReactCrop__child-wrapper>img,.ReactCrop:not(.ReactCrop--disabled) .ReactCrop__child-wrapper>video{touch-action:none}.ReactCrop:not(.ReactCrop--disabled) .ReactCrop__crop-selection{touch-action:none}.ReactCrop__crop-mask{position:absolute;inset:0;pointer-events:none;width:calc(100% + .5px);height:calc(100% + .5px)}.ReactCrop__crop-selection{position:absolute;top:0;left:0;transform:translateZ(0);cursor:move}.ReactCrop--disabled .ReactCrop__crop-selection{cursor:inherit}.ReactCrop--circular-crop .ReactCrop__crop-selection{border-radius:50%}.ReactCrop--circular-crop .ReactCrop__crop-selection:after{pointer-events:none;content:"";position:absolute;inset:-1px;border:1px solid var(--rc-border-color);opacity:.3}.ReactCrop--no-animate .ReactCrop__crop-selection{outline:1px dashed white}.ReactCrop__crop-selection:not(.ReactCrop--no-animate .ReactCrop__crop-selection){animation:marching-ants 1s;background-image:linear-gradient(to right,#fff 50%,#444 50%),linear-gradient(to right,#fff 50%,#444 50%),linear-gradient(to bottom,#fff 50%,#444 50%),linear-gradient(to bottom,#fff 50%,#444 50%);background-size:10px 1px,10px 1px,1px 10px,1px 10px;background-position:0 0,0 100%,0 0,100% 0;background-repeat:repeat-x,repeat-x,repeat-y,repeat-y;color:#fff;animation-play-state:running;animation-timing-function:linear;animation-iteration-count:infinite}.ReactCrop__crop-selection:focus{outline:2px solid var(--rc-focus-color);outline-offset:-1px}.ReactCrop--invisible-crop .ReactCrop__crop-mask,.ReactCrop--invisible-crop .ReactCrop__crop-selection{display:none}.ReactCrop__rule-of-thirds-vt:before,.ReactCrop__rule-of-thirds-vt:after,.ReactCrop__rule-of-thirds-hz:before,.ReactCrop__rule-of-thirds-hz:after{content:"";display:block;position:absolute;background-color:#fff6}.ReactCrop__rule-of-thirds-vt:before,.ReactCrop__rule-of-thirds-vt:after{width:1px;height:100%}.ReactCrop__rule-of-thirds-vt:before{left:33.3333333333%}.ReactCrop__rule-of-thirds-vt:after{left:66.6666666667%}.ReactCrop__rule-of-thirds-hz:before,.ReactCrop__rule-of-thirds-hz:after{width:100%;height:1px}.ReactCrop__rule-of-thirds-hz:before{top:33.3333333333%}.ReactCrop__rule-of-thirds-hz:after{top:66.6666666667%}.ReactCrop__drag-handle{position:absolute;width:var(--rc-drag-handle-size);height:var(--rc-drag-handle-size);background-color:var(--rc-drag-handle-bg-colour);border:1px solid var(--rc-border-color)}.ReactCrop__drag-handle:focus{background:var(--rc-focus-color)}.ReactCrop .ord-nw{top:0;left:0;transform:translate(-50%,-50%);cursor:nw-resize}.ReactCrop .ord-n{top:0;left:50%;transform:translate(-50%,-50%);cursor:n-resize}.ReactCrop .ord-ne{top:0;right:0;transform:translate(50%,-50%);cursor:ne-resize}.ReactCrop .ord-e{top:50%;right:0;transform:translate(50%,-50%);cursor:e-resize}.ReactCrop .ord-se{bottom:0;right:0;transform:translate(50%,50%);cursor:se-resize}.ReactCrop .ord-s{bottom:0;left:50%;transform:translate(-50%,50%);cursor:s-resize}.ReactCrop .ord-sw{bottom:0;left:0;transform:translate(-50%,50%);cursor:sw-resize}.ReactCrop .ord-w{top:50%;left:0;transform:translate(-50%,-50%);cursor:w-resize}.ReactCrop__disabled .ReactCrop__drag-handle{cursor:inherit}.ReactCrop__drag-bar{position:absolute}.ReactCrop__drag-bar.ord-n{top:0;left:0;width:100%;height:var(--rc-drag-bar-size);transform:translateY(-50%)}.ReactCrop__drag-bar.ord-e{right:0;top:0;width:var(--rc-drag-bar-size);height:100%;transform:translate(50%)}.ReactCrop__drag-bar.ord-s{bottom:0;left:0;width:100%;height:var(--rc-drag-bar-size);transform:translateY(50%)}.ReactCrop__drag-bar.ord-w{top:0;left:0;width:var(--rc-drag-bar-size);height:100%;transform:translate(-50%)}.ReactCrop--new-crop .ReactCrop__drag-bar,.ReactCrop--new-crop .ReactCrop__drag-handle,.ReactCrop--fixed-aspect .ReactCrop__drag-bar,.ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-n,.ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-e,.ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-s,.ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-w{display:none}@media (pointer: coarse){.ReactCrop .ord-n,.ReactCrop .ord-e,.ReactCrop .ord-s,.ReactCrop .ord-w{display:none}.ReactCrop__drag-handle{width:var(--rc-drag-handle-mobile-size);height:var(--rc-drag-handle-mobile-size)}}
|
|
@@ -3,7 +3,7 @@ import { c as U } from "../../index-B2JRaoNz.js";
|
|
|
3
3
|
import { ButtonContent as a } from "./button-content.js";
|
|
4
4
|
import { BUTTON_COLOR_GRAY as h, BUTTON_SIZE_DEFAULT as I, BUTTON_VARIANT_OUTLINED as x, MIN_WIDTH_DEFAULT as C, BUTTON_WEIGHT_MEDIUM as E } from "./constants.js";
|
|
5
5
|
import { s as A } from "../../button.module-BZPPmSAS.js";
|
|
6
|
-
import { B as D } from "../../ButtonBase-
|
|
6
|
+
import { B as D } from "../../ButtonBase-CXGZ-DBC.js";
|
|
7
7
|
import { getButtonClassnames as L } from "./utils/get-button-classnames.js";
|
|
8
8
|
const F = (m) => {
|
|
9
9
|
const {
|
package/dist/components/photo-crop-uploader/components/error-upload-dialog/error-upload-dialog.js
CHANGED
|
@@ -1,34 +1,98 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as
|
|
3
|
-
import { localizedText as
|
|
4
|
-
import { EN_LOCALE as
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsx as r, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { c as p } from "../../../../index-B2JRaoNz.js";
|
|
3
|
+
import { localizedText as d } from "../../locale.js";
|
|
4
|
+
import { EN_LOCALE as f } from "../../../../constants.js";
|
|
5
|
+
import { T as x, D as T, a as C, b as y, c as D } from "../../../../DialogTitle-KN1sayHD.js";
|
|
6
|
+
import * as h from "react";
|
|
7
|
+
import { g as E, a as N, b, P as o } from "../../../../createTheme-DSHGFfg6.js";
|
|
8
|
+
import { u as _, s as P, c as j, r as v } from "../../../../ButtonBase-CXGZ-DBC.js";
|
|
9
|
+
import { B as w } from "../../../../Button-DDlVTM6i.js";
|
|
10
|
+
import '../../../../assets/error-upload-dialog.css';function O(s) {
|
|
11
|
+
return E("MuiDialogContentText", s);
|
|
12
|
+
}
|
|
13
|
+
N("MuiDialogContentText", ["root"]);
|
|
14
|
+
const U = (s) => {
|
|
15
|
+
const {
|
|
16
|
+
classes: e
|
|
17
|
+
} = s, t = j({
|
|
18
|
+
root: ["root"]
|
|
19
|
+
}, O, e);
|
|
20
|
+
return {
|
|
21
|
+
...e,
|
|
22
|
+
// forward classes to the Typography
|
|
23
|
+
...t
|
|
24
|
+
};
|
|
25
|
+
}, M = P(x, {
|
|
26
|
+
shouldForwardProp: (s) => v(s) || s === "classes",
|
|
27
|
+
name: "MuiDialogContentText",
|
|
28
|
+
slot: "Root"
|
|
29
|
+
})({}), m = /* @__PURE__ */ h.forwardRef(function(e, a) {
|
|
30
|
+
const t = _({
|
|
31
|
+
props: e,
|
|
32
|
+
name: "MuiDialogContentText"
|
|
33
|
+
}), {
|
|
34
|
+
children: n,
|
|
35
|
+
className: l,
|
|
36
|
+
...i
|
|
37
|
+
} = t, c = U(i);
|
|
38
|
+
return /* @__PURE__ */ r(M, {
|
|
39
|
+
component: "p",
|
|
40
|
+
variant: "body1",
|
|
41
|
+
color: "textSecondary",
|
|
42
|
+
ref: a,
|
|
43
|
+
ownerState: i,
|
|
44
|
+
className: b(c.root, l),
|
|
45
|
+
...t,
|
|
46
|
+
classes: c
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
process.env.NODE_ENV !== "production" && (m.propTypes = {
|
|
50
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
51
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
52
|
+
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
53
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
54
|
+
/**
|
|
55
|
+
* The content of the component.
|
|
56
|
+
*/
|
|
57
|
+
children: o.node,
|
|
58
|
+
/**
|
|
59
|
+
* Override or extend the styles applied to the component.
|
|
60
|
+
*/
|
|
61
|
+
classes: o.object,
|
|
62
|
+
/**
|
|
63
|
+
* @ignore
|
|
64
|
+
*/
|
|
65
|
+
className: o.string,
|
|
66
|
+
/**
|
|
67
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
68
|
+
*/
|
|
69
|
+
sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object])
|
|
70
|
+
});
|
|
71
|
+
const R = "_dialog_lyvu5_1", S = "_dialogErrorText_lyvu5_1", g = {
|
|
72
|
+
dialog: R,
|
|
73
|
+
dialogErrorText: S
|
|
74
|
+
}, G = (s) => {
|
|
11
75
|
const {
|
|
12
76
|
photoError: e,
|
|
13
|
-
onCloseErrorDialog:
|
|
14
|
-
locale:
|
|
15
|
-
className:
|
|
16
|
-
...
|
|
77
|
+
onCloseErrorDialog: a,
|
|
78
|
+
locale: t = f,
|
|
79
|
+
className: n,
|
|
80
|
+
...l
|
|
17
81
|
} = s;
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
|
|
82
|
+
return /* @__PURE__ */ u(
|
|
83
|
+
T,
|
|
20
84
|
{
|
|
21
|
-
className:
|
|
22
|
-
onClose:
|
|
23
|
-
...
|
|
85
|
+
className: p(g.dialog, n),
|
|
86
|
+
onClose: a,
|
|
87
|
+
...l,
|
|
24
88
|
children: [
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ r(C, { children: d[t].error }),
|
|
90
|
+
/* @__PURE__ */ r(y, { children: /* @__PURE__ */ r(m, { className: p(g.dialogErrorText), children: e }) }),
|
|
91
|
+
/* @__PURE__ */ r(D, { children: /* @__PURE__ */ r(w, { onClick: a, children: d[t].back }) })
|
|
28
92
|
]
|
|
29
93
|
}
|
|
30
94
|
);
|
|
31
95
|
};
|
|
32
96
|
export {
|
|
33
|
-
|
|
97
|
+
G as ErrorUploadDialog
|
|
34
98
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MAX_ITEMS_COUNT = 7;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PhotoList } from './photo-list';
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { jsx as i, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { c as n } from "../../../../index-B2JRaoNz.js";
|
|
3
|
+
import { MAX_ITEMS_COUNT as u } from "./constants.js";
|
|
4
|
+
import { s as y, f as C, b as B, a as b, C as L, h as P, j, P as e } from "../../../../createTheme-DSHGFfg6.js";
|
|
5
|
+
import * as v from "react";
|
|
6
|
+
import { u as E, e as I } from "../../../../extendSxProp-CzeED7BH.js";
|
|
7
|
+
import '../../../../assets/photo-list.css';function M(l = {}) {
|
|
8
|
+
const {
|
|
9
|
+
themeId: m,
|
|
10
|
+
defaultTheme: p,
|
|
11
|
+
defaultClassName: a = "MuiBox-root",
|
|
12
|
+
generateClassName: r
|
|
13
|
+
} = l, s = y("div", {
|
|
14
|
+
shouldForwardProp: (c) => c !== "theme" && c !== "sx" && c !== "as"
|
|
15
|
+
})(C);
|
|
16
|
+
return /* @__PURE__ */ v.forwardRef(function(x, N) {
|
|
17
|
+
const h = E(p), {
|
|
18
|
+
className: g,
|
|
19
|
+
component: _ = "div",
|
|
20
|
+
...T
|
|
21
|
+
} = I(x);
|
|
22
|
+
return /* @__PURE__ */ i(s, {
|
|
23
|
+
as: _,
|
|
24
|
+
ref: N,
|
|
25
|
+
className: B(g, r ? r(a) : a),
|
|
26
|
+
theme: m && h[m] || h,
|
|
27
|
+
...T
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
const O = b("MuiBox", ["root"]), S = j(), d = M({
|
|
32
|
+
themeId: P,
|
|
33
|
+
defaultTheme: S,
|
|
34
|
+
defaultClassName: O.root,
|
|
35
|
+
generateClassName: L.generate
|
|
36
|
+
});
|
|
37
|
+
process.env.NODE_ENV !== "production" && (d.propTypes = {
|
|
38
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
39
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
40
|
+
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
41
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
42
|
+
/**
|
|
43
|
+
* @ignore
|
|
44
|
+
*/
|
|
45
|
+
children: e.node,
|
|
46
|
+
/**
|
|
47
|
+
* The component used for the root node.
|
|
48
|
+
* Either a string to use a HTML element or a component.
|
|
49
|
+
*/
|
|
50
|
+
component: e.elementType,
|
|
51
|
+
/**
|
|
52
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
53
|
+
*/
|
|
54
|
+
sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object])
|
|
55
|
+
});
|
|
56
|
+
const z = "_photoList_rrp1z_1", R = "_item_rrp1z_6", q = "_image_rrp1z_17", o = {
|
|
57
|
+
photoList: z,
|
|
58
|
+
item: R,
|
|
59
|
+
image: q
|
|
60
|
+
}, G = (l) => {
|
|
61
|
+
const { photoSources: m, photoIndex: p, className: a, ...r } = l, s = m.slice(p);
|
|
62
|
+
return s.length > u ? /* @__PURE__ */ f(d, { className: n(o.photoList, a), ...r, children: [
|
|
63
|
+
s.slice(0, u - 1).map((t) => /* @__PURE__ */ i(
|
|
64
|
+
"img",
|
|
65
|
+
{
|
|
66
|
+
className: n(o.item, o.image),
|
|
67
|
+
src: t,
|
|
68
|
+
alt: "photo in queue"
|
|
69
|
+
},
|
|
70
|
+
t
|
|
71
|
+
)),
|
|
72
|
+
/* @__PURE__ */ f("div", { className: n(o.item), children: [
|
|
73
|
+
"Еще ",
|
|
74
|
+
s.length - u + 1
|
|
75
|
+
] })
|
|
76
|
+
] }) : /* @__PURE__ */ i(d, { className: n(o.photoList, a), ...r, children: s.map((t) => /* @__PURE__ */ i(
|
|
77
|
+
"img",
|
|
78
|
+
{
|
|
79
|
+
className: n(o.item, o.image),
|
|
80
|
+
src: t,
|
|
81
|
+
alt: "photo in queue"
|
|
82
|
+
},
|
|
83
|
+
t
|
|
84
|
+
)) });
|
|
85
|
+
};
|
|
86
|
+
export {
|
|
87
|
+
G as PhotoList
|
|
88
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { DragEvent, InputHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { Locale } from '../../../../types';
|
|
3
|
-
import { PhotoExtension } from '../../types';
|
|
3
|
+
import { PhotoDataUrl, PhotoExtension } from '../../types';
|
|
4
4
|
type UploadButtonCustonProps = {
|
|
5
5
|
buttonClassname?: string;
|
|
6
6
|
buttonDisabled?: boolean;
|
|
7
7
|
locale?: Locale;
|
|
8
8
|
width?: number | string;
|
|
9
9
|
allowedExtensions?: PhotoExtension[];
|
|
10
|
+
fromSources?: PhotoDataUrl[];
|
|
11
|
+
onPhotoDataLoaded?: (photos: PhotoDataUrl[]) => void;
|
|
10
12
|
onDragOver?: (event: DragEvent<HTMLDivElement>) => unknown;
|
|
11
13
|
onDragLeave?: (event: DragEvent<HTMLDivElement>) => unknown;
|
|
12
14
|
onDragDrop?: (event: DragEvent<HTMLDivElement>) => unknown;
|
|
@@ -1,105 +1,115 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { c as
|
|
4
|
-
import { localizedText as
|
|
5
|
-
import { EN_LOCALE as
|
|
6
|
-
import { SUPPORTED_IMAGE_EXTENSIONS as
|
|
7
|
-
import { UPLOAD_BUTTON_WIDTH_DEFAULT as
|
|
8
|
-
import { B as
|
|
9
|
-
import '../../../../assets/upload-button.css';const
|
|
10
|
-
dragDropWrapper:
|
|
11
|
-
input:
|
|
12
|
-
},
|
|
1
|
+
import { jsx as r, jsxs as v, Fragment as b } from "react/jsx-runtime";
|
|
2
|
+
import { useState as k, useRef as R } from "react";
|
|
3
|
+
import { c as n } from "../../../../index-B2JRaoNz.js";
|
|
4
|
+
import { localizedText as x } from "../../locale.js";
|
|
5
|
+
import { EN_LOCALE as V } from "../../../../constants.js";
|
|
6
|
+
import { SUPPORTED_IMAGE_EXTENSIONS as y } from "../../constants.js";
|
|
7
|
+
import { UPLOAD_BUTTON_WIDTH_DEFAULT as W, UPLOAD_BUTTON_TAB_INDEX as j, UPLOAD_BUTTON_IMAGE_SIZE as T } from "./constants.js";
|
|
8
|
+
import { B as H } from "../../../../Button-DDlVTM6i.js";
|
|
9
|
+
import '../../../../assets/upload-button.css';const M = "data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Transformed%20by:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20width='800px'%20height='800px'%20viewBox='0%200%201024%201024'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23000000'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'/%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3cpath%20fill='%23ffffff'%20d='M544%20864V672h128L512%20480%20352%20672h128v192H320v-1.6c-5.376.32-10.496%201.6-16%201.6A240%20240%200%200%201%2064%20624c0-123.136%2093.12-223.488%20212.608-237.248A239.808%20239.808%200%200%201%20512%20192a239.872%20239.872%200%200%201%20235.456%20194.752c119.488%2013.76%20212.48%20114.112%20212.48%20237.248a240%20240%200%200%201-240%20240c-5.376%200-10.56-1.28-16-1.6v1.6H544z'/%3e%3c/g%3e%3c/svg%3e", F = "_dragDropWrapper_cgx9x_1", z = "_input_cgx9x_4", a = {
|
|
10
|
+
dragDropWrapper: F,
|
|
11
|
+
input: z
|
|
12
|
+
}, ee = (w) => {
|
|
13
13
|
const {
|
|
14
|
-
buttonClassname:
|
|
15
|
-
buttonDisabled:
|
|
16
|
-
children:
|
|
17
|
-
className:
|
|
14
|
+
buttonClassname: C,
|
|
15
|
+
buttonDisabled: i = !1,
|
|
16
|
+
children: E,
|
|
17
|
+
className: p,
|
|
18
18
|
onChange: o,
|
|
19
|
-
locale:
|
|
20
|
-
width:
|
|
21
|
-
allowedExtensions: d =
|
|
22
|
-
onDragOver:
|
|
19
|
+
locale: g = V,
|
|
20
|
+
width: O = W,
|
|
21
|
+
allowedExtensions: d = y,
|
|
22
|
+
onDragOver: N = () => {
|
|
23
23
|
},
|
|
24
|
-
onDragLeave:
|
|
24
|
+
onDragLeave: S = () => {
|
|
25
25
|
},
|
|
26
|
-
onDragDrop:
|
|
26
|
+
onDragDrop: I = () => {
|
|
27
27
|
},
|
|
28
28
|
button: s,
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
multiple: f,
|
|
30
|
+
onPhotoDataLoaded: L = () => {
|
|
31
|
+
},
|
|
32
|
+
fromSources: t,
|
|
33
|
+
...u
|
|
34
|
+
} = w, [P, l] = k(!1), c = R(null), h = (e) => {
|
|
31
35
|
e && e.length > 0 && o && o({
|
|
32
36
|
target: {
|
|
33
37
|
files: e,
|
|
34
38
|
value: ""
|
|
35
39
|
}
|
|
36
40
|
});
|
|
37
|
-
},
|
|
38
|
-
e.preventDefault(), e.stopPropagation(),
|
|
39
|
-
},
|
|
40
|
-
e.preventDefault(), e.stopPropagation(),
|
|
41
|
-
},
|
|
42
|
-
if (e.preventDefault(), e.stopPropagation(),
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
s &&
|
|
47
|
-
},
|
|
48
|
-
|
|
41
|
+
}, U = (e) => {
|
|
42
|
+
t?.length || (e.preventDefault(), e.stopPropagation(), N(e), i || l(!0));
|
|
43
|
+
}, A = (e) => {
|
|
44
|
+
t?.length || (e.preventDefault(), e.stopPropagation(), S(e), l(!1));
|
|
45
|
+
}, B = (e) => {
|
|
46
|
+
if (t?.length || (e.preventDefault(), e.stopPropagation(), I(e), l(!1), i)) return;
|
|
47
|
+
const _ = e.dataTransfer?.files;
|
|
48
|
+
h(_);
|
|
49
|
+
}, G = () => {
|
|
50
|
+
t?.length ? L(t) : s && c.current?.click();
|
|
51
|
+
}, D = (e) => {
|
|
52
|
+
t?.length && e.preventDefault();
|
|
53
|
+
}, m = (e) => {
|
|
54
|
+
h(e.target.files), o && o(e);
|
|
49
55
|
};
|
|
50
56
|
return /* @__PURE__ */ r(
|
|
51
57
|
"div",
|
|
52
58
|
{
|
|
53
|
-
className:
|
|
54
|
-
onDragOver:
|
|
55
|
-
onDragLeave:
|
|
56
|
-
onDrop:
|
|
57
|
-
onClick:
|
|
58
|
-
children: s ? /* @__PURE__ */
|
|
59
|
+
className: n(a.dragDropWrapper),
|
|
60
|
+
onDragOver: U,
|
|
61
|
+
onDragLeave: A,
|
|
62
|
+
onDrop: B,
|
|
63
|
+
onClick: G,
|
|
64
|
+
children: s ? /* @__PURE__ */ v(b, { children: [
|
|
59
65
|
s,
|
|
60
66
|
/* @__PURE__ */ r(
|
|
61
67
|
"input",
|
|
62
68
|
{
|
|
63
|
-
|
|
64
|
-
|
|
69
|
+
onClick: D,
|
|
70
|
+
ref: c,
|
|
71
|
+
className: n(a.input, p),
|
|
65
72
|
type: "file",
|
|
66
73
|
accept: d.join(", "),
|
|
67
|
-
onChange:
|
|
68
|
-
|
|
74
|
+
onChange: m,
|
|
75
|
+
multiple: f,
|
|
76
|
+
...u
|
|
69
77
|
}
|
|
70
78
|
)
|
|
71
|
-
] }) : /* @__PURE__ */
|
|
72
|
-
|
|
79
|
+
] }) : /* @__PURE__ */ v(
|
|
80
|
+
H,
|
|
73
81
|
{
|
|
74
82
|
component: "label",
|
|
75
83
|
sx: {
|
|
76
|
-
width:
|
|
84
|
+
width: O
|
|
77
85
|
},
|
|
78
86
|
role: "none",
|
|
79
87
|
variant: "contained",
|
|
80
|
-
disabled:
|
|
81
|
-
tabIndex:
|
|
82
|
-
className:
|
|
88
|
+
disabled: i,
|
|
89
|
+
tabIndex: j,
|
|
90
|
+
className: n(a.uploadButton, C),
|
|
83
91
|
startIcon: /* @__PURE__ */ r(
|
|
84
92
|
"img",
|
|
85
93
|
{
|
|
86
|
-
width:
|
|
87
|
-
height:
|
|
88
|
-
src:
|
|
89
|
-
alt:
|
|
94
|
+
width: T,
|
|
95
|
+
height: T,
|
|
96
|
+
src: M,
|
|
97
|
+
alt: x[g].upload
|
|
90
98
|
}
|
|
91
99
|
),
|
|
92
100
|
children: [
|
|
93
|
-
|
|
101
|
+
P ? x[g].drop : E,
|
|
94
102
|
/* @__PURE__ */ r(
|
|
95
103
|
"input",
|
|
96
104
|
{
|
|
97
|
-
|
|
98
|
-
|
|
105
|
+
onClick: D,
|
|
106
|
+
ref: c,
|
|
107
|
+
className: n(a.input, p),
|
|
99
108
|
type: "file",
|
|
100
109
|
accept: d.join(", "),
|
|
101
|
-
onChange:
|
|
102
|
-
|
|
110
|
+
onChange: m,
|
|
111
|
+
multiple: f,
|
|
112
|
+
...u
|
|
103
113
|
}
|
|
104
114
|
)
|
|
105
115
|
]
|
|
@@ -109,5 +119,5 @@ import '../../../../assets/upload-button.css';const y = "data:image/svg+xml,%3c!
|
|
|
109
119
|
);
|
|
110
120
|
};
|
|
111
121
|
export {
|
|
112
|
-
|
|
122
|
+
ee as UploadButton
|
|
113
123
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CLOSE_ICON_SIZE = 40;
|
|
@@ -9,19 +9,22 @@ type ImageRef = {
|
|
|
9
9
|
current: HTMLImageElement | null;
|
|
10
10
|
};
|
|
11
11
|
type UploadDialogCustomProps = {
|
|
12
|
-
|
|
12
|
+
photoSources: PhotoDataUrl[];
|
|
13
13
|
photoError?: string;
|
|
14
14
|
imageRef?: ImageRef;
|
|
15
15
|
onCloseDialogHandler?: () => void;
|
|
16
16
|
onPhotoLoad?: OnPhotoLoad;
|
|
17
17
|
onCropChange?: OnCropChange;
|
|
18
18
|
onPhotoCrop?: () => void;
|
|
19
|
-
|
|
19
|
+
onNextPhoto?: () => void;
|
|
20
|
+
onSkipCrop?: () => void;
|
|
21
|
+
photoCrops: Crop[];
|
|
20
22
|
minDimension?: number;
|
|
21
23
|
aspectRatio?: number;
|
|
22
24
|
locale?: Locale;
|
|
23
25
|
circular?: boolean;
|
|
24
26
|
keepSelection?: boolean;
|
|
27
|
+
photoIndex: number;
|
|
25
28
|
};
|
|
26
29
|
export type UploadDialogProps = UploadDialogCustomProps & DialogProps;
|
|
27
30
|
export {};
|