@hai-dev/ui-kit 1.0.5 → 1.0.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.
- package/dist/Box-D8oKffw9.js +57 -0
- package/dist/{Button-DDlVTM6i.js → Button-BBF8hp7e.js} +30 -27
- package/dist/ButtonBase-T2KH9jsD.js +966 -0
- package/dist/CircularProgress-BQQkuSse.js +273 -0
- package/dist/{DialogTitle-KN1sayHD.js → Dialog-B97c7WYP.js} +910 -1401
- package/dist/DialogTitle-Du4tqTs0.js +254 -0
- package/dist/Typography-r_TXEM1e.js +257 -0
- package/dist/assets/circular-progress-loader.css +1 -0
- package/dist/assets/upload-dialog-errors.css +1 -0
- package/dist/assets/upload-dialog.css +1 -1
- package/dist/chainPropTypes-KIxDwPzf.js +387 -0
- package/dist/components/button/button.js +1 -1
- package/dist/components/circular-progress-loader/circular-progress-loader.d.ts +3 -0
- package/dist/components/circular-progress-loader/circular-progress-loader.js +44 -0
- package/dist/components/circular-progress-loader/circular-progress-loader.stories.d.ts +7 -0
- package/dist/components/circular-progress-loader/constants.d.ts +2 -0
- package/dist/components/circular-progress-loader/constants.js +5 -0
- package/dist/components/circular-progress-loader/index.d.ts +1 -0
- package/dist/components/circular-progress-loader/index.js +4 -0
- package/dist/components/circular-progress-loader/types.d.ts +6 -0
- package/dist/components/circular-progress-loader/types.js +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +6 -4
- package/dist/components/photo-crop-uploader/components/error-upload-dialog/error-upload-dialog.js +41 -39
- package/dist/components/photo-crop-uploader/components/photo-list/photo-list.js +22 -73
- package/dist/components/photo-crop-uploader/components/upload-button/upload-button.js +17 -17
- package/dist/components/photo-crop-uploader/components/upload-dialog/types.d.ts +12 -1
- package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog-errors.d.ts +3 -0
- package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog-errors.js +10 -0
- package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog.js +152 -127
- package/dist/components/photo-crop-uploader/constants.d.ts +3 -0
- package/dist/components/photo-crop-uploader/constants.js +35 -32
- package/dist/components/photo-crop-uploader/locale.js +8 -2
- package/dist/components/photo-crop-uploader/photo-crop-uploader.js +169 -145
- package/dist/components/photo-crop-uploader/types.d.ts +4 -0
- package/dist/constants.d.ts +2 -0
- package/dist/constants.js +3 -1
- package/dist/createSimplePaletteValueFilter-nb0wSOzC.js +30 -0
- package/dist/{createTheme-DSHGFfg6.js → createTheme-RvzX1VSA.js} +4 -4
- package/dist/decorators/centered-decorator.d.ts +3 -0
- package/dist/decorators/centered-decorator.js +16 -0
- package/dist/decorators/index.d.ts +1 -0
- package/dist/decorators/index.js +4 -0
- package/dist/decorators/types.d.ts +4 -0
- package/dist/decorators/types.js +1 -0
- package/dist/extendSxProp-BW9e6LtL.js +36 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +16 -14
- package/dist/upload-dialog-errors-ku54UrUb.js +365 -0
- package/dist/useId-CK6Kn3Tn.js +21 -0
- package/dist/useTheme-CsjkCBFJ.js +16 -0
- package/package.json +8 -8
- package/dist/ButtonBase-CXGZ-DBC.js +0 -1346
- package/dist/CircularProgress-CscJm1An.js +0 -291
- package/dist/extendSxProp-CzeED7BH.js +0 -49
|
@@ -1,42 +1,48 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { jsxs as L, jsx as a, Fragment as _ } from "react/jsx-runtime";
|
|
2
|
+
import * as P from "react";
|
|
3
|
+
import { S as $ } from "../../../../index-BiffjjQq.js";
|
|
4
|
+
import { c as i } from "../../../../index-B2JRaoNz.js";
|
|
5
|
+
import { s as n, U as V } from "../../../../upload-dialog-errors-ku54UrUb.js";
|
|
6
|
+
import { PhotoList as H } from "../photo-list/photo-list.js";
|
|
5
7
|
import { localizedText as p } from "../../locale.js";
|
|
6
|
-
import { EN_LOCALE as
|
|
7
|
-
import { CLOSE_ICON_SIZE as
|
|
8
|
-
import { DEFAULT_MIN_DIMENSION as
|
|
9
|
-
import { D as
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
|
|
8
|
+
import { EN_LOCALE as Z } from "../../../../constants.js";
|
|
9
|
+
import { CLOSE_ICON_SIZE as w } from "./constants.js";
|
|
10
|
+
import { DEFAULT_MIN_DIMENSION as Y, DEFAULT_ASPECT_RATIO as q } from "../../constants.js";
|
|
11
|
+
import { D as T } from "../../../../Dialog-B97c7WYP.js";
|
|
12
|
+
import { a as D, b as O, D as G } from "../../../../DialogTitle-Du4tqTs0.js";
|
|
13
|
+
import { CircularProgressLoader as J } from "../../../circular-progress-loader/circular-progress-loader.js";
|
|
14
|
+
import { a as K, g as Q, c as X, b as m, P as t } from "../../../../createTheme-RvzX1VSA.js";
|
|
15
|
+
import { m as A, c as M } from "../../../../createSimplePaletteValueFilter-nb0wSOzC.js";
|
|
16
|
+
import { u as oo, s as W, c as eo, b as to } from "../../../../chainPropTypes-KIxDwPzf.js";
|
|
17
|
+
import { u as ao } from "../../../../useId-CK6Kn3Tn.js";
|
|
18
|
+
import { B as ro } from "../../../../ButtonBase-T2KH9jsD.js";
|
|
19
|
+
import { C as no } from "../../../../CircularProgress-BQQkuSse.js";
|
|
20
|
+
import { Button as E } from "../../../button/button.js";
|
|
21
|
+
import '../../../../assets/upload-dialog.css';function io(o) {
|
|
22
|
+
return Q("MuiIconButton", o);
|
|
17
23
|
}
|
|
18
|
-
const
|
|
24
|
+
const U = K("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary", "colorSecondary", "colorError", "colorInfo", "colorSuccess", "colorWarning", "edgeStart", "edgeEnd", "sizeSmall", "sizeMedium", "sizeLarge", "loading", "loadingIndicator", "loadingWrapper"]), so = (o) => {
|
|
19
25
|
const {
|
|
20
26
|
classes: e,
|
|
21
|
-
disabled:
|
|
27
|
+
disabled: r,
|
|
22
28
|
color: c,
|
|
23
29
|
edge: g,
|
|
24
|
-
size:
|
|
25
|
-
loading:
|
|
30
|
+
size: f,
|
|
31
|
+
loading: b
|
|
26
32
|
} = o, u = {
|
|
27
|
-
root: ["root",
|
|
33
|
+
root: ["root", b && "loading", r && "disabled", c !== "default" && `color${m(c)}`, g && `edge${m(g)}`, `size${m(f)}`],
|
|
28
34
|
loadingIndicator: ["loadingIndicator"],
|
|
29
35
|
loadingWrapper: ["loadingWrapper"]
|
|
30
36
|
};
|
|
31
|
-
return
|
|
32
|
-
},
|
|
37
|
+
return eo(u, io, e);
|
|
38
|
+
}, lo = W(ro, {
|
|
33
39
|
name: "MuiIconButton",
|
|
34
40
|
slot: "Root",
|
|
35
41
|
overridesResolver: (o, e) => {
|
|
36
42
|
const {
|
|
37
|
-
ownerState:
|
|
43
|
+
ownerState: r
|
|
38
44
|
} = o;
|
|
39
|
-
return [e.root,
|
|
45
|
+
return [e.root, r.loading && e.loading, r.color !== "default" && e[`color${m(r.color)}`], r.edge && e[`edge${m(r.edge)}`], e[`size${m(r.size)}`]];
|
|
40
46
|
}
|
|
41
47
|
})(A(({
|
|
42
48
|
theme: o
|
|
@@ -103,14 +109,14 @@ const k = H("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary"
|
|
|
103
109
|
style: {
|
|
104
110
|
color: "inherit"
|
|
105
111
|
}
|
|
106
|
-
}, ...Object.entries(o.palette).filter(
|
|
112
|
+
}, ...Object.entries(o.palette).filter(M()).map(([e]) => ({
|
|
107
113
|
props: {
|
|
108
114
|
color: e
|
|
109
115
|
},
|
|
110
116
|
style: {
|
|
111
117
|
color: (o.vars || o).palette[e].main
|
|
112
118
|
}
|
|
113
|
-
})), ...Object.entries(o.palette).filter(
|
|
119
|
+
})), ...Object.entries(o.palette).filter(M()).map(([e]) => ({
|
|
114
120
|
props: {
|
|
115
121
|
color: e
|
|
116
122
|
},
|
|
@@ -134,14 +140,14 @@ const k = H("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary"
|
|
|
134
140
|
fontSize: o.typography.pxToRem(28)
|
|
135
141
|
}
|
|
136
142
|
}],
|
|
137
|
-
[`&.${
|
|
143
|
+
[`&.${U.disabled}`]: {
|
|
138
144
|
backgroundColor: "transparent",
|
|
139
145
|
color: (o.vars || o).palette.action.disabled
|
|
140
146
|
},
|
|
141
|
-
[`&.${
|
|
147
|
+
[`&.${U.loading}`]: {
|
|
142
148
|
color: "transparent"
|
|
143
149
|
}
|
|
144
|
-
}))),
|
|
150
|
+
}))), co = W("span", {
|
|
145
151
|
name: "MuiIconButton",
|
|
146
152
|
slot: "LoadingIndicator"
|
|
147
153
|
})(({
|
|
@@ -162,60 +168,60 @@ const k = H("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary"
|
|
|
162
168
|
display: "flex"
|
|
163
169
|
}
|
|
164
170
|
}]
|
|
165
|
-
})),
|
|
166
|
-
const c =
|
|
171
|
+
})), j = /* @__PURE__ */ P.forwardRef(function(e, r) {
|
|
172
|
+
const c = oo({
|
|
167
173
|
props: e,
|
|
168
174
|
name: "MuiIconButton"
|
|
169
175
|
}), {
|
|
170
176
|
edge: g = !1,
|
|
171
|
-
children:
|
|
172
|
-
className:
|
|
177
|
+
children: f,
|
|
178
|
+
className: b,
|
|
173
179
|
color: u = "default",
|
|
174
|
-
disabled:
|
|
180
|
+
disabled: y = !1,
|
|
175
181
|
disableFocusRipple: I = !1,
|
|
176
|
-
size:
|
|
177
|
-
id:
|
|
178
|
-
loading:
|
|
179
|
-
loadingIndicator:
|
|
180
|
-
...
|
|
181
|
-
} = c,
|
|
182
|
-
"aria-labelledby":
|
|
182
|
+
size: z = "medium",
|
|
183
|
+
id: v,
|
|
184
|
+
loading: l = null,
|
|
185
|
+
loadingIndicator: R,
|
|
186
|
+
...s
|
|
187
|
+
} = c, N = ao(v), B = R ?? /* @__PURE__ */ a(no, {
|
|
188
|
+
"aria-labelledby": N,
|
|
183
189
|
color: "inherit",
|
|
184
190
|
size: 16
|
|
185
|
-
}),
|
|
191
|
+
}), h = {
|
|
186
192
|
...c,
|
|
187
193
|
edge: g,
|
|
188
194
|
color: u,
|
|
189
|
-
disabled:
|
|
195
|
+
disabled: y,
|
|
190
196
|
disableFocusRipple: I,
|
|
191
|
-
loading:
|
|
192
|
-
loadingIndicator:
|
|
193
|
-
size:
|
|
194
|
-
},
|
|
195
|
-
return /* @__PURE__ */
|
|
196
|
-
id:
|
|
197
|
-
className:
|
|
197
|
+
loading: l,
|
|
198
|
+
loadingIndicator: B,
|
|
199
|
+
size: z
|
|
200
|
+
}, d = so(h);
|
|
201
|
+
return /* @__PURE__ */ L(lo, {
|
|
202
|
+
id: l ? N : v,
|
|
203
|
+
className: X(d.root, b),
|
|
198
204
|
centerRipple: !0,
|
|
199
205
|
focusRipple: !I,
|
|
200
|
-
disabled:
|
|
201
|
-
ref:
|
|
202
|
-
...
|
|
203
|
-
ownerState:
|
|
204
|
-
children: [typeof
|
|
206
|
+
disabled: y || l,
|
|
207
|
+
ref: r,
|
|
208
|
+
...s,
|
|
209
|
+
ownerState: h,
|
|
210
|
+
children: [typeof l == "boolean" && // use plain HTML span to minimize the runtime overhead
|
|
205
211
|
/* @__PURE__ */ a("span", {
|
|
206
|
-
className:
|
|
212
|
+
className: d.loadingWrapper,
|
|
207
213
|
style: {
|
|
208
214
|
display: "contents"
|
|
209
215
|
},
|
|
210
|
-
children: /* @__PURE__ */ a(
|
|
211
|
-
className:
|
|
212
|
-
ownerState:
|
|
213
|
-
children:
|
|
216
|
+
children: /* @__PURE__ */ a(co, {
|
|
217
|
+
className: d.loadingIndicator,
|
|
218
|
+
ownerState: h,
|
|
219
|
+
children: l && B
|
|
214
220
|
})
|
|
215
|
-
}),
|
|
221
|
+
}), f]
|
|
216
222
|
});
|
|
217
223
|
});
|
|
218
|
-
process.env.NODE_ENV !== "production" && (
|
|
224
|
+
process.env.NODE_ENV !== "production" && (j.propTypes = {
|
|
219
225
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
220
226
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
221
227
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
@@ -223,7 +229,7 @@ process.env.NODE_ENV !== "production" && (P.propTypes = {
|
|
|
223
229
|
/**
|
|
224
230
|
* The icon to display.
|
|
225
231
|
*/
|
|
226
|
-
children:
|
|
232
|
+
children: to(t.node, (o) => P.Children.toArray(o.children).some((r) => /* @__PURE__ */ P.isValidElement(r) && r.props.onClick) ? new Error(["MUI: You are providing an onClick event listener to a child of a button element.", "Prefer applying it to the IconButton directly.", "This guarantees that the whole <button> will be responsive to click events."].join(`
|
|
227
233
|
`)) : null),
|
|
228
234
|
/**
|
|
229
235
|
* Override or extend the styles applied to the component.
|
|
@@ -294,127 +300,146 @@ process.env.NODE_ENV !== "production" && (P.propTypes = {
|
|
|
294
300
|
*/
|
|
295
301
|
sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object])
|
|
296
302
|
});
|
|
297
|
-
const
|
|
298
|
-
dialog: io,
|
|
299
|
-
topActions: ro,
|
|
300
|
-
close: so,
|
|
301
|
-
botActions: lo,
|
|
302
|
-
button: co,
|
|
303
|
-
title: po,
|
|
304
|
-
content: go,
|
|
305
|
-
many: uo,
|
|
306
|
-
crop: mo,
|
|
307
|
-
dialogText: bo
|
|
308
|
-
}, Lo = (o) => {
|
|
303
|
+
const po = "data:image/svg+xml,%3csvg%20width='46'%20height='46'%20viewBox='0%200%2046%2046'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.3434%2015.4595C16.8227%2014.9388%2015.9785%2014.9388%2015.4578%2015.4595C14.9371%2015.9802%2014.9371%2016.8244%2015.4578%2017.3451L21.1146%2023.002L15.4578%2028.6588C14.9371%2029.1795%2014.9371%2030.0237%2015.4578%2030.5444C15.9785%2031.0651%2016.8227%2031.0651%2017.3434%2030.5444L23.0002%2024.8876L28.6571%2030.5444C29.1778%2031.0651%2030.022%2031.0651%2030.5427%2030.5444C31.0634%2030.0237%2031.0634%2029.1795%2030.5427%2028.6588L24.8858%2023.002L30.5427%2017.3451C31.0634%2016.8244%2031.0634%2015.9802%2030.5427%2015.4595C30.022%2014.9388%2029.1778%2014.9388%2028.6571%2015.4595L23.0002%2021.1163L17.3434%2015.4595Z'%20fill='%233AA8FF'/%3e%3c/svg%3e", Eo = (o) => {
|
|
309
304
|
const {
|
|
310
305
|
onCloseDialogHandler: e,
|
|
311
|
-
photoSources:
|
|
306
|
+
photoSources: r = [],
|
|
312
307
|
photoCrops: c = [],
|
|
313
308
|
onCropChange: g = () => {
|
|
314
309
|
},
|
|
315
|
-
onPhotoLoad:
|
|
316
|
-
imageRef:
|
|
310
|
+
onPhotoLoad: f,
|
|
311
|
+
imageRef: b,
|
|
317
312
|
photoError: u,
|
|
318
|
-
onPhotoCrop:
|
|
313
|
+
onPhotoCrop: y,
|
|
319
314
|
onNextPhoto: I,
|
|
320
|
-
onSkipCrop:
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
315
|
+
onSkipCrop: z,
|
|
316
|
+
onClearErrors: v,
|
|
317
|
+
minDimension: l = Y,
|
|
318
|
+
aspectRatio: R = q,
|
|
319
|
+
locale: s = Z,
|
|
320
|
+
circular: N,
|
|
321
|
+
keepSelection: B = !0,
|
|
322
|
+
photoSourceLoading: h,
|
|
323
|
+
className: d,
|
|
324
|
+
photoIndex: C,
|
|
325
|
+
loadingValue: F,
|
|
326
|
+
errors: k,
|
|
327
|
+
...x
|
|
328
|
+
} = o, S = r.slice(C).length > 1;
|
|
329
|
+
return h ? /* @__PURE__ */ a(
|
|
330
|
+
T,
|
|
332
331
|
{
|
|
333
|
-
className:
|
|
332
|
+
className: i(n.dialog, d),
|
|
334
333
|
onClose: e,
|
|
335
|
-
...
|
|
334
|
+
...x,
|
|
335
|
+
children: /* @__PURE__ */ a(D, { className: i(n.content), children: /* @__PURE__ */ a(J, { value: F }) })
|
|
336
|
+
}
|
|
337
|
+
) : k?.length ? /* @__PURE__ */ a(
|
|
338
|
+
T,
|
|
339
|
+
{
|
|
340
|
+
className: i(n.dialog, d),
|
|
341
|
+
onClose: e,
|
|
342
|
+
...x,
|
|
343
|
+
children: /* @__PURE__ */ a(
|
|
344
|
+
V,
|
|
345
|
+
{
|
|
346
|
+
locale: s,
|
|
347
|
+
photoSources: r,
|
|
348
|
+
errors: k,
|
|
349
|
+
onCloseDialogHandler: e,
|
|
350
|
+
onClearErrors: v
|
|
351
|
+
}
|
|
352
|
+
)
|
|
353
|
+
}
|
|
354
|
+
) : /* @__PURE__ */ L(
|
|
355
|
+
T,
|
|
356
|
+
{
|
|
357
|
+
className: i(n.dialog, d),
|
|
358
|
+
onClose: e,
|
|
359
|
+
...x,
|
|
336
360
|
children: [
|
|
337
|
-
/* @__PURE__ */ a(
|
|
338
|
-
|
|
361
|
+
/* @__PURE__ */ a(O, { className: i(n.topActions), children: /* @__PURE__ */ a(
|
|
362
|
+
j,
|
|
339
363
|
{
|
|
340
364
|
onClick: e,
|
|
341
|
-
className:
|
|
365
|
+
className: i(n.close),
|
|
342
366
|
"aria-label": p[s].back,
|
|
343
367
|
children: /* @__PURE__ */ a(
|
|
344
368
|
"img",
|
|
345
369
|
{
|
|
346
|
-
width:
|
|
347
|
-
height:
|
|
348
|
-
src:
|
|
370
|
+
width: w,
|
|
371
|
+
height: w,
|
|
372
|
+
src: po,
|
|
349
373
|
alt: p[s].back
|
|
350
374
|
}
|
|
351
375
|
)
|
|
352
376
|
}
|
|
353
377
|
) }),
|
|
354
|
-
/* @__PURE__ */ a(
|
|
355
|
-
/* @__PURE__ */
|
|
356
|
-
|
|
357
|
-
!!
|
|
358
|
-
|
|
378
|
+
/* @__PURE__ */ a(G, { className: i(n.title), children: p[s]["photo-crop"] }),
|
|
379
|
+
/* @__PURE__ */ L(D, { className: i(n.content, S && n.many), children: [
|
|
380
|
+
S && /* @__PURE__ */ a("span", {}),
|
|
381
|
+
!!r.length && /* @__PURE__ */ a(
|
|
382
|
+
$,
|
|
359
383
|
{
|
|
360
|
-
className:
|
|
361
|
-
crop: c[
|
|
362
|
-
circularCrop:
|
|
363
|
-
keepSelection:
|
|
364
|
-
aspect:
|
|
365
|
-
minWidth:
|
|
366
|
-
minHeight:
|
|
384
|
+
className: i(n.crop),
|
|
385
|
+
crop: c[C],
|
|
386
|
+
circularCrop: N,
|
|
387
|
+
keepSelection: B,
|
|
388
|
+
aspect: R,
|
|
389
|
+
minWidth: l,
|
|
390
|
+
minHeight: l,
|
|
367
391
|
onChange: g,
|
|
368
392
|
children: /* @__PURE__ */ a(
|
|
369
393
|
"img",
|
|
370
394
|
{
|
|
371
|
-
onLoad:
|
|
372
|
-
src:
|
|
373
|
-
ref:
|
|
395
|
+
onLoad: f,
|
|
396
|
+
src: r[C],
|
|
397
|
+
ref: b,
|
|
374
398
|
alt: p[s]["photo-crop"],
|
|
375
399
|
draggable: !1
|
|
376
|
-
}
|
|
400
|
+
},
|
|
401
|
+
C
|
|
377
402
|
)
|
|
378
403
|
}
|
|
379
404
|
),
|
|
380
|
-
|
|
405
|
+
S && /* @__PURE__ */ a(H, { photoSources: r, photoIndex: C })
|
|
381
406
|
] }),
|
|
382
|
-
u && /* @__PURE__ */ a(
|
|
383
|
-
/* @__PURE__ */ a(
|
|
407
|
+
u && /* @__PURE__ */ a(O, { className: i(n.dialogText), children: u }),
|
|
408
|
+
/* @__PURE__ */ a(O, { className: i(n.botActions), children: S ? /* @__PURE__ */ L(_, { children: [
|
|
384
409
|
/* @__PURE__ */ a(
|
|
385
|
-
|
|
410
|
+
E,
|
|
386
411
|
{
|
|
387
412
|
buttonSize: "small",
|
|
388
413
|
buttonColor: "blue",
|
|
389
414
|
buttonVariant: "outlined",
|
|
390
415
|
buttonWeight: 500,
|
|
391
|
-
className:
|
|
392
|
-
onClick:
|
|
416
|
+
className: i(n.button),
|
|
417
|
+
onClick: z,
|
|
393
418
|
children: p[s].skip
|
|
394
419
|
}
|
|
395
420
|
),
|
|
396
421
|
/* @__PURE__ */ a(
|
|
397
|
-
|
|
422
|
+
E,
|
|
398
423
|
{
|
|
399
424
|
buttonSize: "small",
|
|
400
425
|
buttonColor: "blue",
|
|
401
426
|
buttonVariant: "filled",
|
|
402
427
|
buttonWeight: 500,
|
|
403
|
-
className:
|
|
428
|
+
className: i(n.button),
|
|
404
429
|
onClick: I,
|
|
405
430
|
children: p[s].continue
|
|
406
431
|
}
|
|
407
432
|
)
|
|
408
433
|
] }) : /* @__PURE__ */ a(
|
|
409
|
-
|
|
434
|
+
E,
|
|
410
435
|
{
|
|
411
436
|
minWidth: "100%",
|
|
412
437
|
buttonSize: "small",
|
|
413
438
|
buttonColor: "blue",
|
|
414
439
|
buttonVariant: "filled",
|
|
415
440
|
buttonWeight: 500,
|
|
416
|
-
className:
|
|
417
|
-
onClick:
|
|
441
|
+
className: i(n.button),
|
|
442
|
+
onClick: y,
|
|
418
443
|
children: p[s].crop
|
|
419
444
|
}
|
|
420
445
|
) })
|
|
@@ -423,5 +448,5 @@ const ao = "data:image/svg+xml,%3csvg%20width='46'%20height='46'%20viewBox='0%20
|
|
|
423
448
|
);
|
|
424
449
|
};
|
|
425
450
|
export {
|
|
426
|
-
|
|
451
|
+
Eo as UploadDialog
|
|
427
452
|
};
|
|
@@ -42,3 +42,6 @@ export declare const MB_FRACTION_DIGITS = 1;
|
|
|
42
42
|
export declare const FULL_CROP_SIZE = 100;
|
|
43
43
|
export declare const MAX_ASPECT_RATIO = 2;
|
|
44
44
|
export declare const MIN_ASPECT_RATIO = 0.5;
|
|
45
|
+
export declare const FULL_PROGRESS_VALUE = 100;
|
|
46
|
+
export declare const PHOTO_LOADING_DELAY = 100;
|
|
47
|
+
export declare const RESET_DATA_DELAY = 500;
|
|
@@ -1,67 +1,70 @@
|
|
|
1
|
-
import { BYTE_TO_KILOBYTE as
|
|
2
|
-
const m = 1,
|
|
1
|
+
import { BYTE_TO_KILOBYTE as I } from "../../constants.js";
|
|
2
|
+
const m = 1, L = 670, _ = ".jpg", E = ".jpeg", A = ".png", P = ".svg", G = ".bmp", M = ".gif", T = ".ico", o = ".webp", C = [
|
|
3
3
|
_,
|
|
4
4
|
E,
|
|
5
|
-
|
|
5
|
+
A,
|
|
6
6
|
P,
|
|
7
7
|
G,
|
|
8
|
-
|
|
8
|
+
M,
|
|
9
9
|
o,
|
|
10
|
-
|
|
11
|
-
], n = "image/jpg", c = "image/jpeg", s = "image/png", t = "image/svg+xml", O = "image/bmp", Y = "image/gif",
|
|
10
|
+
T
|
|
11
|
+
], n = "image/jpg", c = "image/jpeg", s = "image/png", t = "image/svg+xml", O = "image/bmp", Y = "image/gif", S = "image/webp", g = "image/x-icon", N = "image/vnd.microsoft.icon", U = [
|
|
12
12
|
n,
|
|
13
13
|
c,
|
|
14
14
|
s,
|
|
15
15
|
t,
|
|
16
16
|
O,
|
|
17
17
|
Y,
|
|
18
|
-
g,
|
|
19
18
|
S,
|
|
19
|
+
g,
|
|
20
20
|
N
|
|
21
|
-
],
|
|
21
|
+
], e = {
|
|
22
22
|
JPEG_IMAGE_TYPE: [_, E],
|
|
23
23
|
JPG_IMAGE_TYPE: [_, E],
|
|
24
|
-
PNG_IMAGE_TYPE: [
|
|
25
|
-
GIF_IMAGE_TYPE: [
|
|
24
|
+
PNG_IMAGE_TYPE: [A],
|
|
25
|
+
GIF_IMAGE_TYPE: [M],
|
|
26
26
|
SVG_IMAGE_TYPE: [P],
|
|
27
27
|
BMP_IMAGE_TYPE: [G],
|
|
28
28
|
WEBP_IMAGE_TYPE: [o],
|
|
29
|
-
ICO_IMAGE_TYPE: [
|
|
30
|
-
MICROSOFT_ICO_IMAGE_TYPE: [
|
|
31
|
-
},
|
|
29
|
+
ICO_IMAGE_TYPE: [T],
|
|
30
|
+
MICROSOFT_ICO_IMAGE_TYPE: [T]
|
|
31
|
+
}, X = 500, p = 5 * I * I, F = "2d", R = "high", D = "%", B = "px", a = "ms", J = "mb", b = 1, V = 100, f = 2, j = 0.5, r = 100, x = 100, H = 500;
|
|
32
32
|
export {
|
|
33
33
|
G as BMP_IMAGE_EXT,
|
|
34
34
|
O as BMP_IMAGE_TYPE,
|
|
35
35
|
m as DEFAULT_ASPECT_RATIO,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
p as DEFAULT_FILE_MAX_SIZE,
|
|
37
|
+
L as DEFAULT_MIN_DIMENSION,
|
|
38
|
+
X as DEFAULT_TIMEOUT,
|
|
39
|
+
V as FULL_CROP_SIZE,
|
|
40
|
+
r as FULL_PROGRESS_VALUE,
|
|
41
|
+
M as GIF_IMAGE_EXT,
|
|
41
42
|
Y as GIF_IMAGE_TYPE,
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
T as ICO_IMAGE_EXT,
|
|
44
|
+
g as ICO_IMAGE_TYPE,
|
|
44
45
|
E as JPEG_IMAGE_EXT,
|
|
45
46
|
c as JPEG_IMAGE_TYPE,
|
|
46
47
|
_ as JPG_IMAGE_EXT,
|
|
47
48
|
n as JPG_IMAGE_TYPE,
|
|
48
|
-
|
|
49
|
+
f as MAX_ASPECT_RATIO,
|
|
49
50
|
b as MB_FRACTION_DIGITS,
|
|
50
51
|
J as MB_UNIT,
|
|
51
52
|
N as MICROSOFT_ICO_IMAGE_TYPE,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
e as MIME_TO_EXT,
|
|
54
|
+
j as MIN_ASPECT_RATIO,
|
|
55
|
+
a as MS_UNIT,
|
|
56
|
+
F as PHOTO_CANVAS_CONTEXT,
|
|
57
|
+
x as PHOTO_LOADING_DELAY,
|
|
58
|
+
R as PHOTO_SMOOTHING_QUALITY,
|
|
59
|
+
B as PIXEL_UNIT,
|
|
60
|
+
A as PNG_IMAGE_EXT,
|
|
59
61
|
s as PNG_IMAGE_TYPE,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
D as PRECENT_UNIT,
|
|
63
|
+
H as RESET_DATA_DELAY,
|
|
64
|
+
C as SUPPORTED_IMAGE_EXTENSIONS,
|
|
65
|
+
U as SUPPORTED_IMAGE_MIME_TYPES,
|
|
63
66
|
P as SVG_IMAGE_EXT,
|
|
64
67
|
t as SVG_IMAGE_TYPE,
|
|
65
68
|
o as WEBP_IMAGE_EXT,
|
|
66
|
-
|
|
69
|
+
S as WEBP_IMAGE_TYPE
|
|
67
70
|
};
|
|
@@ -21,7 +21,10 @@ const e = {
|
|
|
21
21
|
"paint-abort": "Rendering of photo was interrupted",
|
|
22
22
|
continue: "Continue",
|
|
23
23
|
skip: "Skip area selection",
|
|
24
|
-
aspect: "The aspect ratio of the cropped image must not be greater than 2"
|
|
24
|
+
aspect: "The aspect ratio of the cropped image must not be greater than 2",
|
|
25
|
+
close: "Close",
|
|
26
|
+
"not-uploaded": "Photos were not uploaded",
|
|
27
|
+
"some-not-uploaded": "Some photos were not uploaded"
|
|
25
28
|
},
|
|
26
29
|
ru: {
|
|
27
30
|
upload: "Загрузить фото",
|
|
@@ -45,7 +48,10 @@ const e = {
|
|
|
45
48
|
"paint-abort": "Отрисовка фотографии была прервана",
|
|
46
49
|
continue: "Продолжить",
|
|
47
50
|
skip: "Пропустить выбор области",
|
|
48
|
-
aspect: "Соотношение сторон обрезаемого изображения не должно быть больше 2"
|
|
51
|
+
aspect: "Соотношение сторон обрезаемого изображения не должно быть больше 2",
|
|
52
|
+
close: "Закрыть",
|
|
53
|
+
"not-uploaded": "Фотографии не были загружены",
|
|
54
|
+
"some-not-uploaded": "Некоторые фотографии не были загружены"
|
|
49
55
|
}
|
|
50
56
|
};
|
|
51
57
|
export {
|