@dgshahr/ui-kit 0.0.79 → 0.0.80
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/Accordion/index.cjs +1 -1
- package/dist/Accordion/index.js +1 -1
- package/dist/AccordionItem-BYDG8XVW.cjs +1 -0
- package/dist/{AccordionItem-BBAVaF6W.js → AccordionItem-DhYhZ3vW.js} +1 -1
- package/dist/Alert/index.cjs +1 -1
- package/dist/Alert/index.js +1 -1
- package/dist/Breadcrumb/index.cjs +1 -1
- package/dist/Breadcrumb/index.d.ts.map +1 -1
- package/dist/Breadcrumb/index.js +1 -1
- package/dist/Drawer/index.cjs +1 -1
- package/dist/Drawer/index.js +1 -1
- package/dist/FieldBottomInfo-7YeZbp0-.cjs +1 -0
- package/dist/FieldBottomInfo-B1n-gK3T.js +78 -0
- package/dist/Form/Common/FieldBottomInfo/FieldBottomInfo.d.ts +11 -0
- package/dist/Form/Common/FieldBottomInfo/FieldBottomInfo.d.ts.map +1 -0
- package/dist/Form/Common/FieldLabel/FieldLabel.d.ts +14 -0
- package/dist/Form/Common/FieldLabel/FieldLabel.d.ts.map +1 -0
- package/dist/Form/Datepicker/Days.d.ts.map +1 -1
- package/dist/Form/Datepicker/Header.d.ts.map +1 -1
- package/dist/Form/Datepicker/Months.d.ts.map +1 -1
- package/dist/Form/Datepicker/Years.d.ts.map +1 -1
- package/dist/Form/Datepicker/index.cjs +1 -1
- package/dist/Form/Datepicker/index.js +41 -37
- package/dist/Form/FileUploader/Input/FileInput.d.ts +8 -0
- package/dist/Form/FileUploader/Input/FileInput.d.ts.map +1 -0
- package/dist/Form/FileUploader/Input/FileInputIcon.d.ts +4 -0
- package/dist/Form/FileUploader/Input/FileInputIcon.d.ts.map +1 -0
- package/dist/Form/FileUploader/Preview/FilePreview.d.ts +10 -0
- package/dist/Form/FileUploader/Preview/FilePreview.d.ts.map +1 -0
- package/dist/Form/FileUploader/Preview/MultipleMode/Grid/GridTypePreview.d.ts +6 -0
- package/dist/Form/FileUploader/Preview/MultipleMode/Grid/GridTypePreview.d.ts.map +1 -0
- package/dist/Form/FileUploader/Preview/MultipleMode/List/ListTypePreview.d.ts +6 -0
- package/dist/Form/FileUploader/Preview/MultipleMode/List/ListTypePreview.d.ts.map +1 -0
- package/dist/Form/FileUploader/Preview/MultipleMode/MultipleModePreveiw.d.ts +6 -0
- package/dist/Form/FileUploader/Preview/MultipleMode/MultipleModePreveiw.d.ts.map +1 -0
- package/dist/Form/FileUploader/Preview/SingleMode/SingleModePreview.d.ts +7 -0
- package/dist/Form/FileUploader/Preview/SingleMode/SingleModePreview.d.ts.map +1 -0
- package/dist/Form/FileUploader/Preview/types.d.ts +5 -0
- package/dist/Form/FileUploader/Preview/types.d.ts.map +1 -0
- package/dist/Form/FileUploader/Preview/utils.d.ts +7 -0
- package/dist/Form/FileUploader/Preview/utils.d.ts.map +1 -0
- package/dist/Form/FileUploader/constants.d.ts +10 -0
- package/dist/Form/FileUploader/constants.d.ts.map +1 -0
- package/dist/Form/FileUploader/index.cjs +1 -0
- package/dist/Form/FileUploader/index.d.ts +5 -0
- package/dist/Form/FileUploader/index.d.ts.map +1 -0
- package/dist/Form/FileUploader/index.js +608 -0
- package/dist/Form/FileUploader/types.d.ts +51 -0
- package/dist/Form/FileUploader/types.d.ts.map +1 -0
- package/dist/Form/Input/index.cjs +1 -1
- package/dist/Form/Input/index.d.ts.map +1 -1
- package/dist/Form/Input/index.js +38 -62
- package/dist/Form/OtpInput/index.cjs +1 -1
- package/dist/Form/OtpInput/index.d.ts.map +1 -1
- package/dist/Form/OtpInput/index.js +9 -8
- package/dist/Form/Select/OptionItem.d.ts.map +1 -1
- package/dist/Form/Select/Options.d.ts.map +1 -1
- package/dist/Form/Select/index.cjs +1 -1
- package/dist/Form/Select/index.js +3 -1
- package/dist/Form/Textarea/index.cjs +1 -1
- package/dist/Form/Textarea/index.js +1 -1
- package/dist/Form/Wrappers/PickerWrapper/PickerWrapper.d.ts.map +1 -1
- package/dist/Form/Wrappers/TextFieldWrapper/TextFieldWrapper.d.ts +4 -13
- package/dist/Form/Wrappers/TextFieldWrapper/TextFieldWrapper.d.ts.map +1 -1
- package/dist/{ArrowDown2-CMeKw_vj.js → IconArrowDown2-7ddwV5IE.js} +1 -1
- package/dist/{ArrowDown2-O11Hxz6e.cjs → IconArrowDown2-C1dLVveG.cjs} +1 -1
- package/dist/{ArrowLeft2-B76dkC-C.cjs → IconArrowLeft2-CNA3H0xY.cjs} +1 -1
- package/dist/{ArrowLeft2-jP2w1vwt.js → IconArrowLeft2-cxcPyDqS.js} +1 -1
- package/dist/{ArrowRight2-CcHdxGRE.js → IconArrowRight2-BoXg0Gkw.js} +1 -1
- package/dist/{ArrowRight2-CYowPzS8.cjs → IconArrowRight2-CF_bdH81.cjs} +1 -1
- package/dist/{CloseRemove-BzqPxkjk.js → IconCloseRemove-BPEWBqGA.js} +1 -1
- package/dist/{CloseRemove-BUG0Hjfl.cjs → IconCloseRemove-DwCc4o3b.cjs} +1 -1
- package/dist/IconEye-DATABBb3.js +31 -0
- package/dist/IconEye-sBk4Mro2.cjs +1 -0
- package/dist/Pagination/index.cjs +1 -1
- package/dist/Pagination/index.js +8 -8
- package/dist/{PickerWrapper-EWtj7K7M.js → PickerWrapper-BrMn3Ldu.js} +25 -24
- package/dist/PickerWrapper-CoDy6coa.cjs +1 -0
- package/dist/Progress/Doughnut/index.cjs +1 -0
- package/dist/Progress/Doughnut/index.d.ts +5 -0
- package/dist/Progress/Doughnut/index.d.ts.map +1 -0
- package/dist/Progress/Doughnut/index.js +85 -0
- package/dist/Progress/Doughnut/types.d.ts +21 -0
- package/dist/Progress/Doughnut/types.d.ts.map +1 -0
- package/dist/Slide-BhtrgZAI.cjs +1 -0
- package/dist/{Slide-DsdG_6vc.js → Slide-CFSk8Dlg.js} +13 -13
- package/dist/Slider/index.cjs +1 -1
- package/dist/Slider/index.js +1 -1
- package/dist/Step-CcJeR_kj.cjs +1 -0
- package/dist/Step-pWxkk9vq.js +159 -0
- package/dist/Stepper/Horizontal/Step.d.ts +3 -0
- package/dist/Stepper/Horizontal/Step.d.ts.map +1 -1
- package/dist/Stepper/Horizontal/Stepper.d.ts +1 -0
- package/dist/Stepper/Horizontal/Stepper.d.ts.map +1 -1
- package/dist/Stepper/Horizontal/index.cjs +1 -1
- package/dist/Stepper/Horizontal/index.js +1 -1
- package/dist/TextFieldWrapper-44165bs_.js +106 -0
- package/dist/TextFieldWrapper-K0g1kAl1.cjs +1 -0
- package/dist/assets/styles.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +34 -30
- package/package.json +21 -1
- package/dist/AccordionItem-CpjwOEDp.cjs +0 -1
- package/dist/Form/Wrappers/TextFieldWrapper/FieldBottomInfo.d.ts +0 -9
- package/dist/Form/Wrappers/TextFieldWrapper/FieldBottomInfo.d.ts.map +0 -1
- package/dist/Form/Wrappers/TextFieldWrapper/FieldLabel.d.ts +0 -9
- package/dist/Form/Wrappers/TextFieldWrapper/FieldLabel.d.ts.map +0 -1
- package/dist/PickerWrapper-CY7PJM50.cjs +0 -1
- package/dist/Slide-aMCvZQnM.cjs +0 -1
- package/dist/Step-CZp-RQhJ.js +0 -129
- package/dist/Step-CtqJxQMY.cjs +0 -1
- package/dist/TextFieldWrapper-CmSiS8zD.cjs +0 -1
- package/dist/TextFieldWrapper-Crap8mNo.js +0 -178
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as h, jsxs as N, Fragment as vt } from "react/jsx-runtime";
|
|
2
|
-
import { c as
|
|
2
|
+
import { c as A } from "../../clsx-OuTLNxxd.js";
|
|
3
3
|
import { createContext as Nt, useState as ot, useContext as Wt } from "react";
|
|
4
4
|
import $ from "../../Button/index.js";
|
|
5
|
-
import { u as Yt, P as St } from "../../PickerWrapper-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { u as Yt, P as St } from "../../PickerWrapper-BrMn3Ldu.js";
|
|
6
|
+
import { I as Tt } from "../../IconArrowDown2-7ddwV5IE.js";
|
|
7
|
+
import { I as Ct } from "../../IconArrowLeft2-cxcPyDqS.js";
|
|
8
|
+
import { I as Et } from "../../IconArrowRight2-BoXg0Gkw.js";
|
|
9
9
|
import '../../assets/styles.css';/* empty css */
|
|
10
10
|
const Ft = {
|
|
11
11
|
lessThanXSeconds: {
|
|
@@ -80,12 +80,12 @@ function G(t) {
|
|
|
80
80
|
return t.formats[n] || t.formats[t.defaultWidth];
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
-
const
|
|
83
|
+
const It = {
|
|
84
84
|
full: "EEEE do MMMM y",
|
|
85
85
|
long: "do MMMM y",
|
|
86
86
|
medium: "d MMM y",
|
|
87
87
|
short: "yyyy/MM/dd"
|
|
88
|
-
},
|
|
88
|
+
}, Ht = {
|
|
89
89
|
full: "h:mm:ss a zzzz",
|
|
90
90
|
long: "h:mm:ss a z",
|
|
91
91
|
medium: "h:mm:ss a",
|
|
@@ -97,11 +97,11 @@ const Ht = {
|
|
|
97
97
|
short: "{{date}}, {{time}}"
|
|
98
98
|
}, qt = {
|
|
99
99
|
date: G({
|
|
100
|
-
formats:
|
|
100
|
+
formats: It,
|
|
101
101
|
defaultWidth: "full"
|
|
102
102
|
}),
|
|
103
103
|
time: G({
|
|
104
|
-
formats:
|
|
104
|
+
formats: Ht,
|
|
105
105
|
defaultWidth: "full"
|
|
106
106
|
}),
|
|
107
107
|
dateTime: G({
|
|
@@ -234,7 +234,7 @@ const Bt = {
|
|
|
234
234
|
evening: "عصر",
|
|
235
235
|
night: "شب"
|
|
236
236
|
}
|
|
237
|
-
},
|
|
237
|
+
}, Vt = {
|
|
238
238
|
narrow: {
|
|
239
239
|
am: "ق",
|
|
240
240
|
pm: "ب",
|
|
@@ -265,8 +265,8 @@ const Bt = {
|
|
|
265
265
|
evening: "عصر",
|
|
266
266
|
night: "شب"
|
|
267
267
|
}
|
|
268
|
-
},
|
|
269
|
-
ordinalNumber:
|
|
268
|
+
}, At = (t, e) => Number(t) + "-ام", zt = {
|
|
269
|
+
ordinalNumber: At,
|
|
270
270
|
era: C({
|
|
271
271
|
values: Bt,
|
|
272
272
|
defaultWidth: "wide"
|
|
@@ -287,7 +287,7 @@ const Bt = {
|
|
|
287
287
|
dayPeriod: C({
|
|
288
288
|
values: Gt,
|
|
289
289
|
defaultWidth: "wide",
|
|
290
|
-
formattingValues:
|
|
290
|
+
formattingValues: Vt,
|
|
291
291
|
defaultFormattingWidth: "wide"
|
|
292
292
|
})
|
|
293
293
|
};
|
|
@@ -558,7 +558,7 @@ function ut(t) {
|
|
|
558
558
|
);
|
|
559
559
|
return n.setUTCFullYear(e.getFullYear()), +t - +n;
|
|
560
560
|
}
|
|
561
|
-
function
|
|
561
|
+
function I(t, ...e) {
|
|
562
562
|
const n = w.bind(
|
|
563
563
|
null,
|
|
564
564
|
e.find((r) => typeof r == "object")
|
|
@@ -570,7 +570,7 @@ function q(t, e) {
|
|
|
570
570
|
return n.setHours(0, 0, 0, 0), n;
|
|
571
571
|
}
|
|
572
572
|
function Me(t, e, n) {
|
|
573
|
-
const [r, i] =
|
|
573
|
+
const [r, i] = I(
|
|
574
574
|
n?.in,
|
|
575
575
|
t,
|
|
576
576
|
e
|
|
@@ -1272,16 +1272,16 @@ function _e(t, e, n) {
|
|
|
1272
1272
|
const r = t[0] === "Y" ? "years" : "days of the month";
|
|
1273
1273
|
return `Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
1274
1274
|
}
|
|
1275
|
-
function
|
|
1275
|
+
function Ie(t) {
|
|
1276
1276
|
return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
|
|
1277
1277
|
}
|
|
1278
|
-
function
|
|
1279
|
-
return !(!
|
|
1278
|
+
function He(t) {
|
|
1279
|
+
return !(!Ie(t) && typeof t != "number" || isNaN(+f(t)));
|
|
1280
1280
|
}
|
|
1281
1281
|
const $e = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, qe = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, je = /^'([^]*?)'?$/, Re = /''/g, Be = /[a-zA-Z]/;
|
|
1282
1282
|
function b(t, e, n) {
|
|
1283
1283
|
const r = _(), i = r.locale ?? le, a = r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, s = r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 6, c = f(t, n?.in);
|
|
1284
|
-
if (!
|
|
1284
|
+
if (!He(c))
|
|
1285
1285
|
throw new RangeError("Invalid time value");
|
|
1286
1286
|
let o = e.match(qe).map((u) => {
|
|
1287
1287
|
const g = u[0];
|
|
@@ -1360,10 +1360,10 @@ function J(t, e, n) {
|
|
|
1360
1360
|
return isNaN(e) ? w(n?.in || t, NaN) : (e && S(r, x(r) + e), r);
|
|
1361
1361
|
}
|
|
1362
1362
|
function Z(t, e) {
|
|
1363
|
-
const [n, r] =
|
|
1363
|
+
const [n, r] = I(t, e.start, e.end);
|
|
1364
1364
|
return { start: n, end: r };
|
|
1365
1365
|
}
|
|
1366
|
-
function
|
|
1366
|
+
function V(t, e) {
|
|
1367
1367
|
const { start: n, end: r } = Z(e?.in, t);
|
|
1368
1368
|
let i = +n > +r;
|
|
1369
1369
|
const a = i ? +n : +r, s = i ? r : n;
|
|
@@ -1391,8 +1391,8 @@ function tt(t, e) {
|
|
|
1391
1391
|
function et(t, e) {
|
|
1392
1392
|
return +f(t) < +f(e);
|
|
1393
1393
|
}
|
|
1394
|
-
function
|
|
1395
|
-
const [r, i] =
|
|
1394
|
+
function H(t, e, n) {
|
|
1395
|
+
const [r, i] = I(
|
|
1396
1396
|
n?.in,
|
|
1397
1397
|
t,
|
|
1398
1398
|
e
|
|
@@ -1413,15 +1413,15 @@ function B(t, e) {
|
|
|
1413
1413
|
function xt(t, e, n) {
|
|
1414
1414
|
return J(t, -e, n);
|
|
1415
1415
|
}
|
|
1416
|
-
const
|
|
1417
|
-
function
|
|
1416
|
+
const Ve = ["ش", "ی", "د", "س", "چ", "پ", "ج"];
|
|
1417
|
+
function Ae(t) {
|
|
1418
1418
|
let e = [];
|
|
1419
|
-
const n = R(t), r = B(t), i =
|
|
1419
|
+
const n = R(t), r = B(t), i = V({
|
|
1420
1420
|
start: B(t),
|
|
1421
1421
|
end: R(t)
|
|
1422
1422
|
}).map((c) => ({ date: c, isInMonth: !0 })), a = gt(r), s = gt(n);
|
|
1423
1423
|
if (a !== 6 ? e = [
|
|
1424
|
-
...
|
|
1424
|
+
...V({
|
|
1425
1425
|
start: W(r),
|
|
1426
1426
|
end: xt(r, 1)
|
|
1427
1427
|
}).map((o) => ({
|
|
@@ -1430,7 +1430,7 @@ function Ve(t) {
|
|
|
1430
1430
|
})),
|
|
1431
1431
|
...i
|
|
1432
1432
|
] : e = [...i], s != 5) {
|
|
1433
|
-
const c =
|
|
1433
|
+
const c = V({
|
|
1434
1434
|
start: J(n, 1),
|
|
1435
1435
|
end: Ge(n)
|
|
1436
1436
|
}).map((o) => ({
|
|
@@ -1451,15 +1451,15 @@ function ze({
|
|
|
1451
1451
|
}) {
|
|
1452
1452
|
const s = e || n;
|
|
1453
1453
|
if (!s) return "dgs-ui-kit-pointer-events-none";
|
|
1454
|
-
const c =
|
|
1454
|
+
const c = H(/* @__PURE__ */ new Date(), t), o = (i ? tt(t, i) : !0) && (a ? et(t, a) : !0), l = "!dgs-ui-kit-bg-primary-500 !dgs-ui-kit-text-white dgs-ui-kit-border-none";
|
|
1455
1455
|
let u = "dgs-ui-kit-py-1 dgs-ui-kit-rounded-2xl dgs-ui-kit-transition hover:dgs-ui-kit-bg-primary-50 hover:dgs-ui-kit-text-primary-500";
|
|
1456
|
-
return c && (u = `${u} dgs-ui-kit-border dgs-ui-kit-border-primary-300`), !e && s ? u = `${u} dgs-ui-kit-text-gray-400` : u = `${u} dgs-ui-kit-text-gray-600`, o || (u = `${u} dgs-ui-kit-line-through dgs-ui-kit-pointer-events-none`), r instanceof Date ?
|
|
1456
|
+
return c && (u = `${u} dgs-ui-kit-border dgs-ui-kit-border-primary-300`), !e && s ? u = `${u} dgs-ui-kit-text-gray-400` : u = `${u} dgs-ui-kit-text-gray-600`, o || (u = `${u} dgs-ui-kit-line-through dgs-ui-kit-pointer-events-none`), r instanceof Date ? H(r, t) && (u = `${u} ${l}`) : r.start && H(r.start, t) ? u = `${u} dgs-ui-kit-rounded-l-none ${l}` : r.end && H(r.end, t) ? u = `${u} dgs-ui-kit-rounded-r-none ${l}` : r.start && r.end && nt(t, {
|
|
1457
1457
|
start: r.start,
|
|
1458
1458
|
end: r.end
|
|
1459
1459
|
}) && (u = `${u} dgs-ui-kit-rounded-none dgs-ui-kit-border-none dgs-ui-kit-bg-primary-50 dgs-ui-kit-text-primary-500`), u;
|
|
1460
1460
|
}
|
|
1461
1461
|
const Ke = () => {
|
|
1462
|
-
const { internalDate: t, datepickerProps: e } = T(), { showExtraDays: n, onChange: r, acceptRange: i, value: a } = e, s =
|
|
1462
|
+
const { internalDate: t, datepickerProps: e } = T(), { showExtraDays: n, onChange: r, acceptRange: i, value: a } = e, s = Ae(t);
|
|
1463
1463
|
function c(o) {
|
|
1464
1464
|
i ? !a.start || a.end ? r({ start: o, end: null }) : r({
|
|
1465
1465
|
start: a.start,
|
|
@@ -1467,10 +1467,11 @@ const Ke = () => {
|
|
|
1467
1467
|
}) : r(o);
|
|
1468
1468
|
}
|
|
1469
1469
|
return /* @__PURE__ */ N(vt, { children: [
|
|
1470
|
-
/* @__PURE__ */ h("div", { className: "dgs-ui-kit-bg-gray-50 dgs-ui-kit-p-3 dgs-ui-kit-font-button-small dgs-ui-kit-text-gray-600 dgs-ui-kit-text-center dgs-ui-kit-grid dgs-ui-kit-grid-rows-1 dgs-ui-kit-grid-cols-7", children:
|
|
1470
|
+
/* @__PURE__ */ h("div", { className: "dgs-ui-kit-bg-gray-50 dgs-ui-kit-p-3 dgs-ui-kit-font-button-small dgs-ui-kit-text-gray-600 dgs-ui-kit-text-center dgs-ui-kit-grid dgs-ui-kit-grid-rows-1 dgs-ui-kit-grid-cols-7", children: Ve.map((o) => /* @__PURE__ */ h("span", { children: o }, o)) }),
|
|
1471
1471
|
/* @__PURE__ */ h("div", { className: "dgs-ui-kit-grid dgs-ui-kit-grid-cols-7 dgs-ui-kit-text-center dgs-ui-kit-font-p3-medium ss02 dgs-ui-kit-p-3 dgs-ui-kit-gap-y-2", children: s.map((o) => /* @__PURE__ */ h(
|
|
1472
1472
|
"button",
|
|
1473
1473
|
{
|
|
1474
|
+
type: "button",
|
|
1474
1475
|
className: ze({ ...o, ...e }),
|
|
1475
1476
|
onClick: () => c(o.date),
|
|
1476
1477
|
children: o.isInMonth || n ? b(o.date, "d") : ""
|
|
@@ -1499,7 +1500,7 @@ function K(t, e) {
|
|
|
1499
1500
|
return P(n, r + 1, 0, 0), n.setHours(23, 59, 59, 999), n;
|
|
1500
1501
|
}
|
|
1501
1502
|
function L(t, e, n) {
|
|
1502
|
-
const [r, i] =
|
|
1503
|
+
const [r, i] = I(
|
|
1503
1504
|
n?.in,
|
|
1504
1505
|
t,
|
|
1505
1506
|
e
|
|
@@ -1527,6 +1528,7 @@ const Ze = () => {
|
|
|
1527
1528
|
}).map((a) => /* @__PURE__ */ h(
|
|
1528
1529
|
"button",
|
|
1529
1530
|
{
|
|
1531
|
+
type: "button",
|
|
1530
1532
|
className: Je({ month: a, ...e }),
|
|
1531
1533
|
onClick: () => i(a),
|
|
1532
1534
|
children: b(a, "MMMM")
|
|
@@ -1546,7 +1548,7 @@ function tn(t, e) {
|
|
|
1546
1548
|
return i ? o.reverse() : o;
|
|
1547
1549
|
}
|
|
1548
1550
|
function X(t, e, n) {
|
|
1549
|
-
const [r, i] =
|
|
1551
|
+
const [r, i] = I(
|
|
1550
1552
|
n?.in,
|
|
1551
1553
|
t,
|
|
1552
1554
|
e
|
|
@@ -1590,6 +1592,7 @@ const an = () => {
|
|
|
1590
1592
|
}).map((a) => /* @__PURE__ */ h(
|
|
1591
1593
|
"button",
|
|
1592
1594
|
{
|
|
1595
|
+
type: "button",
|
|
1593
1596
|
onClick: () => i(a),
|
|
1594
1597
|
className: rn({ year: a, ...r }),
|
|
1595
1598
|
children: b(a, "yyyy")
|
|
@@ -1613,7 +1616,7 @@ const an = () => {
|
|
|
1613
1616
|
return /* @__PURE__ */ N(
|
|
1614
1617
|
"div",
|
|
1615
1618
|
{
|
|
1616
|
-
className:
|
|
1619
|
+
className: A(
|
|
1617
1620
|
"dgs-ui-kit-flex dgs-ui-kit-p-3 dgs-ui-kit-items-center dgs-ui-kit-border-t dgs-ui-kit-border-gray-200 dgs-ui-kit-gap-4",
|
|
1618
1621
|
a ? "dgs-ui-kit-justify-between" : "dgs-ui-kit-justify-end"
|
|
1619
1622
|
),
|
|
@@ -1736,6 +1739,7 @@ const ln = () => {
|
|
|
1736
1739
|
/* @__PURE__ */ N(
|
|
1737
1740
|
"button",
|
|
1738
1741
|
{
|
|
1742
|
+
type: "button",
|
|
1739
1743
|
className: "dgs-ui-kit-bg-gray-100 dgs-ui-kit-rounded-lg dgs-ui-kit-p-3 dgs-ui-kit-min-w-[50%] dgs-ui-kit-flex dgs-ui-kit-justify-between dgs-ui-kit-items-center disabled:dgs-ui-kit-cursor-not-allowed",
|
|
1740
1744
|
disabled: e === m.Year,
|
|
1741
1745
|
onClick: () => e !== m.Year && n(e + 1),
|
|
@@ -1781,8 +1785,8 @@ const xn = (t) => {
|
|
|
1781
1785
|
const { showSubmitButton: e = !0, showTodayButton: n = !0, value: r } = t, i = { ...t };
|
|
1782
1786
|
return i.dropdownType === "drawer" ? i.drawerProps = {
|
|
1783
1787
|
...i.drawerProps,
|
|
1784
|
-
containerClassName:
|
|
1785
|
-
} : i.popoverClassName =
|
|
1788
|
+
containerClassName: A("!dgs-ui-kit-p-0", i.drawerProps?.containerClassName)
|
|
1789
|
+
} : i.popoverClassName = A(
|
|
1786
1790
|
"!dgs-ui-kit-p-0 dgs-ui-kit-max-h-max",
|
|
1787
1791
|
i.popoverClassName
|
|
1788
1792
|
), i.customInput || (i.inputProps = {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { FileInputProps, FilePreviewProps } from '../types';
|
|
3
|
+
interface Props extends FileInputProps {
|
|
4
|
+
previewtype?: FilePreviewProps['type'];
|
|
5
|
+
}
|
|
6
|
+
declare const FileInput: FC<Props>;
|
|
7
|
+
export default FileInput;
|
|
8
|
+
//# sourceMappingURL=FileInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileInput.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/FileUploader/Input/FileInput.tsx"],"names":[],"mappings":"AACA,OAAO,EAA4B,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAa1D,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAwBjE,UAAU,KAAM,SAAQ,cAAc;IACpC,WAAW,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;CACxC;AAED,QAAA,MAAM,SAAS,EAAE,EAAE,CAAC,KAAK,CAmExB,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileInputIcon.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/FileUploader/Input/FileInputIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,QAAA,MAAM,aAAa,EAAE,EA4EpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { FileType } from '../types';
|
|
3
|
+
interface FilePreviewProps {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
file: FileType;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const FilePreview: FC<FilePreviewProps>;
|
|
9
|
+
export default FilePreview;
|
|
10
|
+
//# sourceMappingURL=FilePreview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilePreview.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/FileUploader/Preview/FilePreview.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAkB,MAAM,OAAO,CAAC;AAI3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,UAAU,gBAAgB;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAwDrC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridTypePreview.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/FileUploader/Preview/MultipleMode/Grid/GridTypePreview.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,QAAA,MAAM,eAAe,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAiC/C,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListTypePreview.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/FileUploader/Preview/MultipleMode/List/ListTypePreview.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAKhC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,QAAA,MAAM,eAAe,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAuE/C,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultipleModePreveiw.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/FileUploader/Preview/MultipleMode/MultipleModePreveiw.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAM7C,QAAA,MAAM,mBAAmB,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAuBrD,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { FileType } from '../../types';
|
|
3
|
+
import { PreviewProps } from '../types';
|
|
4
|
+
export declare function getTitleClass(loading: FileType['loading'], errorMessage: FileType['errorMessage'], status?: FileType['status']): string;
|
|
5
|
+
declare const SingleModePreview: FC<PreviewProps<FileType>>;
|
|
6
|
+
export default SingleModePreview;
|
|
7
|
+
//# sourceMappingURL=SingleModePreview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SingleModePreview.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/FileUploader/Preview/SingleMode/SingleModePreview.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAG7C,wBAAgB,aAAa,CAC3B,OAAO,EAAE,QAAQ,CAAC,SAAS,CAAC,EAC5B,YAAY,EAAE,QAAQ,CAAC,cAAc,CAAC,EACtC,MAAM,GAAE,QAAQ,CAAC,QAAQ,CAAa,UAOvC;AAED,QAAA,MAAM,iBAAiB,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAmEjD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/FileUploader/Preview/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE3D,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ,EAAE,CAAE,SAAQ,gBAAgB;IACrF,KAAK,EAAE,CAAC,CAAC;CACV"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ButtonProps } from '../../../Button';
|
|
2
|
+
import { FilePreviewProps, FileType } from '../types';
|
|
3
|
+
export declare function renderPreviewDefaultAction(button: FilePreviewProps['leftButton'], file: FileType, defaults?: Omit<ButtonProps, 'rightIcon' | 'leftIcon'> & {
|
|
4
|
+
icon?: ButtonProps['rightIcon'];
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
6
|
+
export declare function getPreviewBorder(loading: FileType['loading'], status: FileType['status']): string;
|
|
7
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/FileUploader/Preview/utils.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE3D,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,EACtC,IAAI,EAAE,QAAQ,EACd,QAAQ,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,UAAU,CAAC,GAAG;IACvD,IAAI,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;CACjC,kDAwBF;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,UASxF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FileType } from './types';
|
|
2
|
+
export declare const DEFAULT_SIZE_CLASS = "dgs-ui-kit-h-[190px] dgs-ui-kit-w-[330px]";
|
|
3
|
+
export declare const DEFAULT_GRID_SIZE_CLASS = "dgs-ui-kit-size-[120px]";
|
|
4
|
+
export declare const ABSOLUTE_CENTER = "!dgs-ui-kit-absolute dgs-ui-kit-top-1/2 dgs-ui-kit-left-1/2 -dgs-ui-kit-translate-y-1/2 -dgs-ui-kit-translate-x-1/2";
|
|
5
|
+
export declare const FOCUS_CLASS = "dgs-ui-kit-ring-offset-1 dgs-ui-kit-ring-offset-transparent has-[:focus]:dgs-ui-kit-ring-offset-white dgs-ui-kit-ring-[3px] dgs-ui-kit-ring-transparent has-[:focus]:dgs-ui-kit-ring-primary-300";
|
|
6
|
+
export declare const ERROR_CLASS = "!dgs-ui-kit-border-error-500 dgs-ui-kit-ring-4 !dgs-ui-kit-ring-error-50";
|
|
7
|
+
export declare const DRAG_CLASS = "!dgs-ui-kit-border-primary-500 dgs-ui-kit-ring-4 !dgs-ui-kit-ring-gray-100 !dgs-ui-kit-bg-gray-50";
|
|
8
|
+
export declare const DISABLED_CLASS = "has-[:disabled]:dgs-ui-kit-opacity-50";
|
|
9
|
+
export declare const TITLE_CLASS: Record<Required<FileType>['status'] | 'loading', string>;
|
|
10
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/Form/FileUploader/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,eAAO,MAAM,kBAAkB,8CAA8C,CAAC;AAC9E,eAAO,MAAM,uBAAuB,4BAA4B,CAAC;AACjE,eAAO,MAAM,eAAe,wHAC2F,CAAC;AACxH,eAAO,MAAM,WAAW,qMAC4K,CAAC;AACrM,eAAO,MAAM,WAAW,6EACoD,CAAC;AAC7E,eAAO,MAAM,UAAU,sGAC8E,CAAC;AACtG,eAAO,MAAM,cAAc,0CAA0C,CAAC;AACtE,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,GAAG,SAAS,EAAE,MAAM,CAKhF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";require('../../assets/styles.css');const i=require("react/jsx-runtime"),o=require("../../clsx-C11secjj.cjs"),L=require("react"),f=require("../../Button/index.cjs"),v=require("../../FieldBottomInfo-7YeZbp0-.cjs"),S=require("../../Progress/Doughnut/index.cjs"),R=require("../../IconEye-sBk4Mro2.cjs");;/* empty css */const A=s=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 24 24",...s,children:i.jsx("path",{fill:"currentColor",d:"M12 5a.75.75 0 0 1 .75.75V11H18a.75.75 0 0 1 0 1.5h-5.25v5.25a.75.75 0 0 1-1.5 0V12.5H6A.75.75 0 0 1 6 11h5.25V5.75A.75.75 0 0 1 12 5"})}),E=()=>i.jsxs("svg",{className:"!dgs-ui-kit-mt-0 dgs-ui-kit-absolute dgs-ui-kit-bottom-0 dgs-ui-kit-left-1/2 -dgs-ui-kit-translate-x-1/2",width:"81",height:"27",viewBox:"0 0 81 27",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("rect",{width:"33.7825",height:"29.7449",rx:"5.5752",transform:"matrix(0.983147 0.182818 -0.186455 0.982463 40.3638 14.8927)",stroke:"#F0F3FF",strokeWidth:"3.7168",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("ellipse",{cx:"3.75361",cy:"3.71811",rx:"3.75361",ry:"3.71811",transform:"matrix(0.983147 0.182818 -0.186455 0.982463 46.3579 23.571)",stroke:"#F0F3FF",strokeWidth:"3.7168",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M61.1192 26.3159L64.8095 27.0022",stroke:"#F0F3FF",strokeWidth:"3.7168",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("rect",{width:"33.7586",height:"29.7452",rx:"5.5752",transform:"matrix(0.98127 -0.192639 0.196195 0.980565 7.47998 15.3789)",fill:"white",stroke:"#F0F3FF",strokeWidth:"3.7168",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("ellipse",{cx:"3.75096",cy:"3.71815",rx:"3.75096",ry:"3.71815",transform:"matrix(0.98127 -0.192639 0.196195 0.980565 16.2998 21.2255)",stroke:"#F0F3FF",strokeWidth:"3.7168",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M31.0227 18.3353L34.7034 17.6127",stroke:"#F0F3FF",strokeWidth:"3.7168",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M32.4822 25.627L36.1629 24.9045",stroke:"#F0F3FF",strokeWidth:"3.7168",strokeLinecap:"round",strokeLinejoin:"round"})]}),F="dgs-ui-kit-h-[190px] dgs-ui-kit-w-[330px]",b="dgs-ui-kit-size-[120px]",y="!dgs-ui-kit-absolute dgs-ui-kit-top-1/2 dgs-ui-kit-left-1/2 -dgs-ui-kit-translate-y-1/2 -dgs-ui-kit-translate-x-1/2",D="dgs-ui-kit-ring-offset-1 dgs-ui-kit-ring-offset-transparent has-[:focus]:dgs-ui-kit-ring-offset-white dgs-ui-kit-ring-[3px] dgs-ui-kit-ring-transparent has-[:focus]:dgs-ui-kit-ring-primary-300",H="!dgs-ui-kit-border-error-500 dgs-ui-kit-ring-4 !dgs-ui-kit-ring-error-50",z="!dgs-ui-kit-border-primary-500 dgs-ui-kit-ring-4 !dgs-ui-kit-ring-gray-100 !dgs-ui-kit-bg-gray-50",P="has-[:disabled]:dgs-ui-kit-opacity-50",C={default:"dgs-ui-kit-bg-primary-50 dgs-ui-kit-text-primary-500",loading:"dgs-ui-kit-bg-gray-500 dgs-ui-kit-text-white",error:"dgs-ui-kit-bg-error-50 dgs-ui-kit-text-error-500",warning:"dgs-ui-kit-bg-warning-50 dgs-ui-kit-text-warning-700"};function T(s){const e="dgs-ui-kit-relative dgs-ui-kit-z-10";return typeof s=="boolean"?i.jsx(f,{className:e,rightIcon:i.jsx(A,{}),size:"small"}):i.jsx(f,{...s,className:o.clsx(e,s?.className),children:s?.children})}const _=s=>{const{title:e,description:r,button:n=!0,hideIcon:t,isError:a,className:d,onChange:l,helperProps:u,previewtype:c,...k}=s,[g,x]=L.useState(!1),h=c==="grid";function I(m){m.preventDefault(),x(!1),l(m.dataTransfer.files?.[0])}return i.jsxs("div",{className:"dgs-ui-kit-space-y-2",children:[i.jsxs("div",{className:o.clsx("dgs-ui-kit-relative dgs-ui-kit-text-center dgs-ui-kit-bg-white dgs-ui-kit-transition-all","dgs-ui-kit-space-y-4 dgs-ui-kit-p-4","dgs-ui-kit-flex dgs-ui-kit-flex-col dgs-ui-kit-justify-center dgs-ui-kit-items-center","dgs-ui-kit-border dgs-ui-kit-border-gray-300 dgs-ui-kit-border-dashed dgs-ui-kit-rounded-lg","hover:dgs-ui-kit-ring-4 hover:dgs-ui-kit-ring-gray-100",D,P,(a||u?.errorMessage)&&H,g&&z,h?b:F,d),children:[e?i.jsx("p",{className:"dgs-ui-kit-font-p1-medium dgs-ui-kit-text-primary-500 [font-feature-settings:inherit]",children:e}):null,r?i.jsx("pre",{className:"dgs-ui-kit-font-caption-demibold dgs-ui-kit-text-primary-200 [font-feature-settings:inherit]",children:r}):null,n?T(n):null,!t&&i.jsx(E,{}),i.jsx("input",{className:"!dgs-ui-kit-mt-0 dgs-ui-kit-absolute dgs-ui-kit-inset-0 dgs-ui-kit-size-full dgs-ui-kit-opacity-0 dgs-ui-kit-cursor-pointer disabled:dgs-ui-kit-cursor-not-allowed dgs-ui-kit-z-10",type:"file",onDragEnter:()=>x(!0),onDragLeave:()=>x(!1),onDrop:I,onChange:m=>l(m.currentTarget.files?.[0]),...k})]}),!h&&Object.keys(u??{}).length>0&&i.jsx(v.FieldBottomInfo,{...u})]})},B=s=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 24 24",...s,children:[i.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M3.485 7.168a.75.75 0 0 1 .75-.75h16.53a.75.75 0 0 1 0 1.5H4.235a.75.75 0 0 1-.75-.75M5.53 9.565a.75.75 0 0 1 .802.693l.612 8.376a2.57 2.57 0 0 0 2.56 2.38h5.993a2.567 2.567 0 0 0 2.56-2.38l.612-8.376a.75.75 0 0 1 1.496.11l-.612 8.376a4.067 4.067 0 0 1-4.056 3.77H9.504c-2.131 0-3.9-1.646-4.056-3.771l-.612-8.376a.75.75 0 0 1 .693-.802",clipRule:"evenodd"}),i.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M10.444 3.016h4.12a2 2 0 0 1 1.94 1.526l.503 2.476a.75.75 0 0 1-1.47.298l-.497-2.448a.5.5 0 0 0-.476-.352H10.44a.5.5 0 0 0-.479.351L9.47 7.315a.75.75 0 0 1-1.47-.296l.497-2.476.011-.046a2 2 0 0 1 1.937-1.481",clipRule:"evenodd"})]}),M=s=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 24 24",...s,children:i.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M21.084 14.664a.75.75 0 0 1 .75.75v2.511a3.825 3.825 0 0 1-3.826 3.825h-2.51a.75.75 0 0 1 0-1.5h2.51a2.325 2.325 0 0 0 2.326-2.325v-2.51a.75.75 0 0 1 .75-.75M3.084 14.664a.75.75 0 0 1 .75.75v2.511A2.325 2.325 0 0 0 6.16 20.25h2.51a.75.75 0 0 1 0 1.5H6.16a3.825 3.825 0 0 1-3.826-3.825v-2.51a.75.75 0 0 1 .75-.75M6.16 3.75a2.325 2.325 0 0 0-2.326 2.326v2.51a.75.75 0 1 1-1.5 0v-2.51A3.825 3.825 0 0 1 6.16 2.25h2.51a.75.75 0 0 1 0 1.5zM14.748 3a.75.75 0 0 1 .75-.75h2.51a3.825 3.825 0 0 1 3.826 3.826v2.51a.75.75 0 0 1-1.5 0v-2.51a2.325 2.325 0 0 0-2.326-2.326h-2.51a.75.75 0 0 1-.75-.75",clipRule:"evenodd"})}),U="data:image/svg+xml,%3csvg%20viewBox='0%200%2096%2096'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20rx='8'%20fill='%23F1F5F9'/%3e%3cpath%20d='M45.9176%2066.4015C45.2%2066.4011%2044.4904%2066.2499%2043.8352%2065.9575C43.18%2065.6655%2042.5932%2065.2387%2042.1136%2064.7055L38.7415%2060.9495L34.5496%2065.3495C33.9972%2065.9051%2033.2495%2066.2227%2032.4661%2066.2343C31.6827%2066.2455%2030.9259%2065.9503%2030.3574%2065.4111C29.789%2064.8719%2029.4539%2064.1319%2029.4241%2063.3487C29.3942%2062.5659%2029.6718%2061.8023%2030.1975%2061.2215L35.0457%2056.1095C36.066%2055.1195%2037.4205%2054.5487%2038.8415%2054.5095C39.5477%2054.5215%2040.2436%2054.6795%2040.886%2054.9735C41.5284%2055.2675%2042.1028%2055.6907%2042.5736%2056.2175L45.9056%2059.9215L53.5576%2050.8895C54.0196%2050.3439%2054.5908%2049.9011%2055.234%2049.5899C55.8776%2049.2783%2056.5788%2049.1051%2057.2936%2049.0815C58.0104%2049.0551%2058.7244%2049.1819%2059.3888%2049.4527C60.0528%2049.7239%2060.6516%2050.1331%2061.1456%2050.6535L67.7736%2057.5135C68.326%2058.0863%2068.6288%2058.8551%2068.6144%2059.6511C68.6004%2060.4471%2068.2704%2061.2047%2067.6976%2061.7575C67.1248%2062.3103%2066.3556%2062.6127%2065.5596%2062.5983C64.764%2062.5843%2064.0064%2062.2543%2063.4536%2061.6815L57.5016%2055.5135L49.8296%2064.5695C49.3552%2065.1291%2048.766%2065.5807%2048.1024%2065.8931C47.4384%2066.2059%2046.7152%2066.3723%2045.9816%2066.3815L45.9176%2066.4015Z'%20fill='%23748297'/%3e%3cpath%20d='M65.0008%2087H33.1767C30.8059%2086.9584%2028.4666%2086.4488%2026.2933%2085.5004C24.1201%2084.5524%2022.1557%2083.184%2020.5128%2081.4744C18.87%2079.7644%2017.5809%2077.7468%2016.7201%2075.5376C15.8593%2073.3284%2015.4437%2070.9704%2015.4967%2068.6V26.628C15.6171%2021.9306%2017.5604%2017.4643%2020.9154%2014.1742C24.2704%2010.8842%2028.7737%209.0286%2033.4725%209H56.1448C57.6536%209.00228%2059.1468%209.3084%2060.5352%209.90008C61.9232%2010.4918%2063.178%2011.357%2064.2248%2012.444L79.3848%2028.24C81.3932%2030.3232%2082.512%2033.1063%2082.5044%2036V68.652C82.5536%2073.3884%2080.7516%2077.9568%2077.482%2081.384C74.2124%2084.8108%2069.734%2086.826%2065.0008%2087ZM33.4845%2015C30.3566%2015.0102%2027.3555%2016.2368%2025.1159%2018.4204C22.8763%2020.6041%2021.5738%2023.5733%2021.4845%2026.7V68.652C21.4387%2070.2356%2021.7073%2071.8124%2022.2741%2073.292C22.8409%2074.7712%2023.6948%2076.124%2024.787%2077.2712C25.8792%2078.4188%2027.1878%2079.3388%2028.6373%2079.9784C30.0869%2080.6176%2031.6487%2080.9632%2033.2325%2080.996H64.8684C68.0276%2080.8528%2071.0072%2079.4864%2073.1768%2077.1856C75.346%2074.8848%2076.5352%2071.83%2076.4924%2068.668V36C76.4924%2034.6581%2075.9736%2033.3682%2075.0444%2032.4L59.8804%2016.6C59.3956%2016.0947%2058.814%2015.6925%2058.1696%2015.4176C57.5256%2015.1426%2056.8328%2015.0006%2056.1328%2015H33.4725H33.4845Z'%20fill='%23748297'/%3e%3cpath%20d='M79.2498%2037.062H68.2938C64.7902%2037.0461%2061.4354%2035.6443%2058.9622%2033.1628C56.4886%2030.6812%2055.0981%2027.3216%2055.0938%2023.818V12.25C55.0938%2011.4544%2055.4101%2010.6913%2055.9725%2010.1287C56.5353%209.56604%2057.2982%209.25%2058.0938%209.25C58.8893%209.25%2059.6525%209.56604%2060.2153%2010.1287C60.7777%2010.6913%2061.0938%2011.4544%2061.0938%2012.25V23.818C61.0938%2025.7316%2061.8509%2027.5675%2063.2001%2028.9248C64.5489%2030.282%2066.3802%2031.0504%2068.2938%2031.062H79.2417C80.0373%2031.062%2080.8005%2031.3781%2081.3633%2031.9407C81.9257%2032.5033%2082.2417%2033.2663%2082.2417%2034.062C82.2417%2034.8576%2081.9257%2035.6207%2081.3633%2036.1833C80.8005%2036.7459%2080.0373%2037.062%2079.2417%2037.062H79.2498Z'%20fill='%23748297'/%3e%3cpath%20d='M37.9659%2048.8068C40.1992%2048.8068%2042.01%2046.9959%2042.01%2044.7627C42.01%2042.5291%2040.1992%2040.7188%2037.9659%2040.7188C35.7324%2040.7188%2033.9219%2042.5291%2033.9219%2044.7627C33.9219%2046.9959%2035.7324%2048.8068%2037.9659%2048.8068Z'%20fill='%23748297'/%3e%3c/svg%3e",j=s=>{const{file:e,children:r,className:n}=s,t=e.file?URL.createObjectURL(e.file):e.src??"";function a(d){const l=d.currentTarget;l.src=U,l.classList.add("dgs-ui-kit-bg-gray-100")}return i.jsxs("div",{className:o.clsx("dgs-ui-kit-relative dgs-ui-kit-rounded-lg dgs-ui-kit-overflow-hidden",F,n),children:[i.jsx("img",{className:"dgs-ui-kit-w-full dgs-ui-kit-h-full",src:t,alt:"image-preview",onError:a}),i.jsxs("div",{className:o.clsx("dgs-ui-kit-bg-black dgs-ui-kit-transition-colors dgs-ui-kit-absolute dgs-ui-kit-w-full dgs-ui-kit-h-full dgs-ui-kit-top-0 dgs-ui-kit-left-0",e.loading?"dgs-ui-kit-bg-opacity-70":"dgs-ui-kit-bg-opacity-50"),children:[typeof e.loading=="boolean"&&e.loading&&i.jsx("div",{className:o.clsx("dot-flashing",y)}),typeof e.loading=="number"&&i.jsxs("div",{className:o.clsx("dgs-ui-kit-flex dgs-ui-kit-flex-col dgs-ui-kit-items-center dgs-ui-kit-justify-center",y),children:[i.jsx(S,{current:e.loading,total:100,color:"gray",size:30,strokeSize:4}),i.jsxs("div",{className:"dgs-ui-kit-font-oveline-regular dgs-ui-kit-text-gray-50 ss02 dgs-ui-kit-mt-1",children:[e.loading," %"]})]}),!e.loading&&r]})]})};function p(s,e,r){return s?i.jsx(f,{className:o.clsx("dgs-ui-kit-opacity-50 dgs-ui-kit-z-10",r?.className,s?.className),type:"button",rightIcon:r?.icon,size:"small",...r,...typeof s=="boolean"?{}:s,onClick:n=>{typeof s!="boolean"&&typeof s.onClick=="function"&&s.onClick(e,n)},children:s?.children}):null}function w(s,e){return o.clsx("dgs-ui-kit-border dgs-ui-kit-border-transparent dgs-ui-kit-rounded-lg",e&&e!=="default"&&"dgs-ui-kit-p-1",{"!dgs-ui-kit-border-error-500":!s&&e==="error","!dgs-ui-kit-border-warning-600":!s&&e==="warning"})}const V=s=>{const{files:e,previewClassName:r,leftButton:n=!0,rightButton:t=!0,wrapperClassName:a}=s;return i.jsx("div",{className:o.clsx(w(e.loading,e.errorMessage?"error":e.status),b,a),children:i.jsxs(j,{file:e,className:o.clsx("!dgs-ui-kit-size-full",r),children:[p(n,e,{color:"error",icon:i.jsx(B,{}),className:"!dgs-ui-kit-absolute dgs-ui-kit-left-2 dgs-ui-kit-top-2"}),p(t,e,{color:"gray",icon:i.jsx(M,{}),className:"!dgs-ui-kit-absolute dgs-ui-kit-right-2 dgs-ui-kit-bottom-2"})]})})},q=s=>i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 24 24",...s,children:[i.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.53 9.565a.75.75 0 0 1 .802.693l.612 8.376a2.57 2.57 0 0 0 2.56 2.38h5.993a2.567 2.567 0 0 0 2.56-2.38l.612-8.376a.75.75 0 0 1 1.496.11l-.612 8.376a4.067 4.067 0 0 1-4.056 3.77H9.504c-2.131 0-3.9-1.646-4.056-3.771l-.612-8.376a.75.75 0 0 1 .693-.802M3.485 7.168a.75.75 0 0 1 .75-.75h16.53a.75.75 0 0 1 0 1.5H4.235a.75.75 0 0 1-.75-.75",clipRule:"evenodd"}),i.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M10.443 3.016h4.12a2 2 0 0 1 1.94 1.526l.503 2.476a.75.75 0 1 1-1.47.298l-.497-2.448a.5.5 0 0 0-.476-.352H10.44a.5.5 0 0 0-.479.351l-.492 2.448a.75.75 0 0 1-1.47-.296l.497-2.476.011-.046a2 2 0 0 1 1.937-1.481M10.602 11.797a.75.75 0 0 1 .75.75v4.508a.75.75 0 0 1-1.5 0v-4.508a.75.75 0 0 1 .75-.75m3.38 0a.75.75 0 0 1 .75.75v4.508a.75.75 0 0 1-1.5 0v-4.508a.75.75 0 0 1 .75-.75",clipRule:"evenodd"})]}),O=s=>{const{files:e,previewClassName:r,leftButton:n=!0,rightButton:t=!0,exteraButton:a}=s,{status:d,errorMessage:l,hintMessage:u,loading:c,title:k}=e,g=k??e.file?.name,x=!!(l??u);return i.jsxs("div",{className:o.clsx("dgs-ui-kit-flex dgs-ui-kit-items-center dgs-ui-kit-space-x-2 dgs-ui-kit-space-x-reverse dgs-ui-kit-w-0 dgs-ui-kit-min-w-full",w(c,l?"error":d),(!d||d==="default")&&!l&&"dgs-ui-kit-p-1 !dgs-ui-kit-border-gray-200",r),children:[i.jsx(j,{file:e,className:"!dgs-ui-kit-size-[72px] dgs-ui-kit-shrink-0"}),!!(g??x)&&i.jsxs("div",{className:"dgs-ui-kit-space-y-1 dgs-ui-kit-overflow-hidden dgs-ui-kit-w-full",children:[!!g&&i.jsx("span",{className:"dgs-ui-kit-font-p2-medium dgs-ui-kit-text-gray-700 dgs-ui-kit-break-words dgs-ui-kit-line-clamp-1",children:g}),x&&i.jsx(v.FieldBottomInfo,{hintMessage:u,errorMessage:l})]}),(n||t||a)&&i.jsxs("div",{className:"dgs-ui-kit-flex dgs-ui-kit-space-x-1 dgs-ui-kit-space-x-reverse dgs-ui-kit-shrink-0",children:[a&&i.jsx(f,{...a,onClick:h=>{typeof a.onClick=="function"&&a.onClick(e,h)},children:a.children}),p(t,e,{color:"gray",icon:i.jsx(R.IconEye,{}),variant:"text",className:"!dgs-ui-kit-opacity-100 !dgs-ui-kit-p-0"}),p(n,e,{color:"error",icon:i.jsx(q,{}),variant:"text",className:"!dgs-ui-kit-opacity-100 !dgs-ui-kit-p-0"})]})]})};function N(s){return s.file?URL.createObjectURL(s.file):s.src??""}const W=s=>{const{files:e,type:r="list",wrapperClassName:n}=s;return r==="grid"?e.map(t=>i.jsx(V,{...s,files:t},N(t))):i.jsx("div",{className:o.clsx("dgs-ui-kit-mt-4 dgs-ui-kit-space-y-2",n),children:e.map(t=>i.jsx(O,{...s,files:t},N(t)))})};function Z(s,e,r="default"){return s?C.loading:e?C.error:C[r]}const G=s=>{const{files:e,leftButton:r=!0,rightButton:n=!0,exteraButton:t,wrapperClassName:a,previewClassName:d}=s,{errorMessage:l,file:u,hintMessage:c,loading:k,status:g,title:x}=e;return i.jsxs("div",{className:"dgs-ui-kit-space-y-2",children:[i.jsxs("div",{className:o.clsx(w(k,l?"error":g),a),children:[i.jsxs(j,{file:e,className:d,children:[p(r,e,{color:"error",icon:i.jsx(B,{}),className:"!dgs-ui-kit-absolute dgs-ui-kit-left-2 dgs-ui-kit-top-2"}),p(n,e,{color:"gray",icon:i.jsx(M,{}),className:"!dgs-ui-kit-absolute dgs-ui-kit-right-2 dgs-ui-kit-bottom-2"}),t?i.jsx(f,{className:o.clsx(t.className,"!dgs-ui-kit-absolute dgs-ui-kit-top-1/2 dgs-ui-kit-left-1/2 -dgs-ui-kit-translate-y-1/2 -dgs-ui-kit-translate-x-1/2"),...t,onClick:h=>{typeof t.onClick=="function"&&t.onClick(e,h)},children:t.children}):null]}),!!(x??u?.name)&&i.jsx("div",{className:o.clsx(Z(k,l,g),"dgs-ui-kit-px-3 dgs-ui-kit-py-1.5 dgs-ui-kit-rounded-lg dgs-ui-kit-font-p2-medium dgs-ui-kit-text-center dgs-ui-kit-line-clamp-1 dgs-ui-kit-mt-1 dgs-ui-kit-w-0 dgs-ui-kit-min-w-full"),children:x??u?.name})]}),c??l?i.jsx(v.FieldBottomInfo,{errorMessage:l,hintMessage:c}):null]})},K=s=>{const{mode:e,fileInputProps:r,isError:n,disabled:t,onChange:a,files:d,previewProps:l,className:u}=s,c=Array.isArray(d)?d.length>0:!!d,k=o.clsx(e==="multiple"&&l?.type==="grid"&&"dgs-ui-kit-flex dgs-ui-kit-space-x-2 dgs-ui-kit-space-x-reverse",u),g=k?"div":L.Fragment;return i.jsxs(g,{className:k,children:[(!c&&e==="single"||e!=="single")&&i.jsx(_,{...r,previewtype:l?.type,disabled:t,isError:n,onChange:a}),c&&i.jsx(i.Fragment,{children:e==="single"?i.jsx(G,{...l,files:d}):i.jsx(W,{...l,files:d})})]})};module.exports=K;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Form/FileUploader/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAI1C,OAAO,KAAK,EAA8B,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE7E,OAAO,kBAAkB,CAAC;AAE1B,QAAA,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAwCvC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|