@cagatayfdn/flora-components 0.0.136 → 0.0.138

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.
Files changed (185) hide show
  1. package/package.json +1 -1
  2. package/dist/Accordion.css +0 -1
  3. package/dist/ActionButton.css +0 -1
  4. package/dist/AlertCard.css +0 -1
  5. package/dist/Autocomplete.css +0 -1
  6. package/dist/Button.css +0 -1
  7. package/dist/Card.css +0 -1
  8. package/dist/Checkbox.css +0 -1
  9. package/dist/Config.css +0 -1
  10. package/dist/Confirm.css +0 -1
  11. package/dist/ContentHeader.css +0 -1
  12. package/dist/Datepicker.css +0 -1
  13. package/dist/Divider.css +0 -1
  14. package/dist/DropdownList.css +0 -1
  15. package/dist/ErrorLogModal.css +0 -1
  16. package/dist/FileUpload.css +0 -1
  17. package/dist/FileUpload.module-BxCEtOHx.js +0 -32
  18. package/dist/Heading.css +0 -1
  19. package/dist/IconBox.css +0 -1
  20. package/dist/InfoBoxList.css +0 -1
  21. package/dist/InfoBoxList.module-BHkAHgos.js +0 -8
  22. package/dist/InfoDate.css +0 -1
  23. package/dist/InfoText.css +0 -1
  24. package/dist/Input.css +0 -1
  25. package/dist/Label.css +0 -1
  26. package/dist/Legends.css +0 -1
  27. package/dist/Loading.css +0 -1
  28. package/dist/MenuItem-Df6Zsa7E.js +0 -53
  29. package/dist/MenuItem.css +0 -1
  30. package/dist/Modal.css +0 -1
  31. package/dist/NoResult.css +0 -1
  32. package/dist/PageWrap.css +0 -1
  33. package/dist/Pager.css +0 -1
  34. package/dist/Panel.css +0 -1
  35. package/dist/Radio.css +0 -1
  36. package/dist/ResultError.css +0 -1
  37. package/dist/ScrollContainer.css +0 -1
  38. package/dist/Select-BE_y91ZN.js +0 -1831
  39. package/dist/Select.css +0 -1
  40. package/dist/Select.module-ByPQ6qr4.js +0 -21
  41. package/dist/StatusTag.css +0 -1
  42. package/dist/StatusTypography.css +0 -1
  43. package/dist/Stepper.css +0 -1
  44. package/dist/Switch.css +0 -1
  45. package/dist/Tab.css +0 -1
  46. package/dist/Table.css +0 -1
  47. package/dist/Table.module-DUqpZOLt.js +0 -29
  48. package/dist/Textarea.css +0 -1
  49. package/dist/Tooltip.css +0 -1
  50. package/dist/Trans-B4ILpbwK.js +0 -343
  51. package/dist/TypographyText.css +0 -1
  52. package/dist/ValidationError.css +0 -1
  53. package/dist/_commonjsHelpers-CT_km90n.js +0 -30
  54. package/dist/_isArray-CBUZFxFA.js +0 -6
  55. package/dist/_isString-BUpNGP_8.js +0 -6
  56. package/dist/_reduce-DsUCMz4O.js +0 -148
  57. package/dist/assets/icons/icons.js +0 -70
  58. package/dist/assets/images/500_error_2x.gif +0 -0
  59. package/dist/assets/images/oms.png +0 -0
  60. package/dist/components/Accordion/Accordion.js +0 -60
  61. package/dist/components/ActionButton/ActionButton.js +0 -54
  62. package/dist/components/AlertCard/AlertCard.js +0 -29
  63. package/dist/components/AuthUserCan/Permission.js +0 -18
  64. package/dist/components/AuthUserCan/index.js +0 -23
  65. package/dist/components/Autocomplete/Autocomplete.js +0 -87
  66. package/dist/components/Button/Button.js +0 -87
  67. package/dist/components/Card/Card.js +0 -21
  68. package/dist/components/Charts/Bar.js +0 -18
  69. package/dist/components/Charts/Legends.js +0 -21
  70. package/dist/components/Charts/Line.js +0 -18
  71. package/dist/components/Charts/Pie.js +0 -43
  72. package/dist/components/Charts/index.js +0 -31
  73. package/dist/components/Charts/types.js +0 -1
  74. package/dist/components/Charts/utils.js +0 -12
  75. package/dist/components/Checkbox/Checkbox.js +0 -68
  76. package/dist/components/Config/Config.js +0 -32
  77. package/dist/components/Confirm/Confirm.js +0 -60
  78. package/dist/components/ContentHeader/ContentHeader.js +0 -75
  79. package/dist/components/ContentLoader/ContentLoader.js +0 -16
  80. package/dist/components/Countdown/Countdown.js +0 -20
  81. package/dist/components/Datepicker/Datepicker.js +0 -1478
  82. package/dist/components/Divider/Divider.js +0 -27
  83. package/dist/components/Drawer/Provider.js +0 -24
  84. package/dist/components/Drawer/index.js +0 -55
  85. package/dist/components/Dropdown/DropdownList.js +0 -90
  86. package/dist/components/ErrorLogModal/ErrorLogModal.js +0 -69
  87. package/dist/components/FileUpload/FileUpload.js +0 -237
  88. package/dist/components/FileUpload/ImagePreview.js +0 -19
  89. package/dist/components/FileUpload/LengthCard.js +0 -6
  90. package/dist/components/FileUpload/PreviewModal.js +0 -53
  91. package/dist/components/Grid/Column.js +0 -29
  92. package/dist/components/Grid/Row.js +0 -6
  93. package/dist/components/Heading/Heading.js +0 -22
  94. package/dist/components/Icon/index.js +0 -24
  95. package/dist/components/IconBox/IconBox.js +0 -13
  96. package/dist/components/InfiniteScroll/InfiniteScroll.js +0 -41
  97. package/dist/components/InfoBoxList/InfoBoxList.js +0 -30
  98. package/dist/components/InfoBoxList/helper.js +0 -83
  99. package/dist/components/InfoDate/InfoDate.js +0 -19
  100. package/dist/components/InfoText/InfoText.js +0 -13
  101. package/dist/components/Input/Input.js +0 -140
  102. package/dist/components/Label/Label.js +0 -22
  103. package/dist/components/Loading/Loading.js +0 -62
  104. package/dist/components/Modal/Modal.js +0 -74
  105. package/dist/components/NavigatorCard/index.js +0 -59
  106. package/dist/components/NoResult/NoResult.js +0 -12
  107. package/dist/components/Notification/Notification.js +0 -26
  108. package/dist/components/PageWrapper/PageWrap.js +0 -46
  109. package/dist/components/Pager/Pager.js +0 -103
  110. package/dist/components/Panel/Panel.js +0 -71
  111. package/dist/components/PermaLink/PermaLink.js +0 -387
  112. package/dist/components/Radio/Radio.js +0 -96
  113. package/dist/components/ResultError/ResultError.js +0 -20
  114. package/dist/components/ScrollContainer/ScrollContainer.js +0 -23
  115. package/dist/components/Select/NoData.js +0 -10
  116. package/dist/components/Select/OptionItem.js +0 -19
  117. package/dist/components/Select/Select.js +0 -13
  118. package/dist/components/Sidebar/MenuItem.js +0 -9
  119. package/dist/components/Sidebar/index.js +0 -137
  120. package/dist/components/StatusTag/StatusTag.js +0 -24
  121. package/dist/components/StatusTypography/StatusTypography.js +0 -51
  122. package/dist/components/Stepper/Stepper.js +0 -75
  123. package/dist/components/Switch/Switch.js +0 -84
  124. package/dist/components/Tab/Tab.js +0 -28
  125. package/dist/components/Table/Table.js +0 -271
  126. package/dist/components/Table/TableHeader.js +0 -137
  127. package/dist/components/Table/TableSort.js +0 -25
  128. package/dist/components/Textarea/Textarea.js +0 -95
  129. package/dist/components/Tooltip/Tooltip.js +0 -1548
  130. package/dist/components/TypographyText/TypographyText.js +0 -91
  131. package/dist/components/ValidationError/ValidationError.js +0 -7
  132. package/dist/components/index.js +0 -133
  133. package/dist/defineProperty-DeKy1XT0.js +0 -37
  134. package/dist/enums/appearance.js +0 -14
  135. package/dist/enums/applicationTypeSlug.js +0 -4
  136. package/dist/enums/index.js +0 -29
  137. package/dist/enums/isActiveColor.js +0 -4
  138. package/dist/enums/size.js +0 -4
  139. package/dist/enums/status.js +0 -11
  140. package/dist/equals-PL9KqVQf.js +0 -119
  141. package/dist/flatpickr-CRz1AV0e.js +0 -59
  142. package/dist/hooks/index.js +0 -15
  143. package/dist/hooks/useAauth.js +0 -40
  144. package/dist/hooks/useDisclosure.js +0 -14
  145. package/dist/hooks/useDrawer.js +0 -9
  146. package/dist/hooks/useMediaQuery.js +0 -21
  147. package/dist/hooks/useNiceModal.js +0 -13
  148. package/dist/i18nInstance-CiCZbaCK.js +0 -55
  149. package/dist/includes-8YTFrx85.js +0 -46
  150. package/dist/index-9ZLCCecr.js +0 -364
  151. package/dist/index-BHf7G3IG.js +0 -35
  152. package/dist/index-BJU1K2Aw.js +0 -8003
  153. package/dist/index-CB61CB0b.js +0 -669
  154. package/dist/index-H7XbDVmH.js +0 -320
  155. package/dist/index-JNaMEwgt.js +0 -1413
  156. package/dist/index.css +0 -1
  157. package/dist/index.d.mts +0 -1463
  158. package/dist/index.d.ts +0 -1463
  159. package/dist/index.js +0 -200
  160. package/dist/index2.css +0 -1
  161. package/dist/jsx-runtime-BcAkpsdy.js +0 -631
  162. package/dist/keys-B0bo5Q7o.js +0 -67
  163. package/dist/locales/en/index.js +0 -613
  164. package/dist/locales/i18n.js +0 -1417
  165. package/dist/locales/index.js +0 -5
  166. package/dist/locales/tr/index.js +0 -613
  167. package/dist/main.css +0 -1
  168. package/dist/main.js +0 -56
  169. package/dist/prodivers.css +0 -6
  170. package/dist/prodivers.js +0 -13
  171. package/dist/react-content-loader.es-CswLCxkm.js +0 -90
  172. package/dist/react-toastify.esm-BUWNP7Nm.js +0 -808
  173. package/dist/types/common/date.js +0 -1
  174. package/dist/types/common/events.js +0 -1
  175. package/dist/types/common/forms.js +0 -1
  176. package/dist/types/common/option.js +0 -1
  177. package/dist/types/index.js +0 -1
  178. package/dist/useTranslation-CnCPcxVj.js +0 -142
  179. package/dist/utils/date.js +0 -413
  180. package/dist/utils/flatpickr.js +0 -4
  181. package/dist/utils/helper.js +0 -55
  182. package/dist/utils/index.js +0 -24
  183. package/dist/utils/language.js +0 -46
  184. package/dist/utils/validation.js +0 -27
  185. package/dist/utils/yup.js +0 -2921
@@ -1,27 +0,0 @@
1
- import { j as t } from "../../jsx-runtime-BcAkpsdy.js";
2
- import { DividerAppearance as _ } from "../../enums/appearance.js";
3
- import { c as s } from "../../index-BHf7G3IG.js";
4
- import '../../Divider.css';const a = "_divider_i35dl_2", o = "_grey_i35dl_2", g = "_light_i35dl_2", l = "_dark_grey_i35dl_2", i = {
5
- divider: a,
6
- grey: o,
7
- light: g,
8
- dark_grey: l,
9
- "margin-15": "_margin-15_i35dl_2",
10
- "margin-30": "_margin-30_i35dl_2"
11
- }, v = ({
12
- appearance: r = _.GREY,
13
- className: e,
14
- margin: d = "15"
15
- }) => /* @__PURE__ */ t.jsx(
16
- "hr",
17
- {
18
- "data-testid": "divider",
19
- className: s(i.divider, e, {
20
- [i[`${r}`]]: r,
21
- [i[`margin-${d}`]]: d
22
- })
23
- }
24
- );
25
- export {
26
- v as default
27
- };
@@ -1,24 +0,0 @@
1
- import { j as a } from "../../jsx-runtime-BcAkpsdy.js";
2
- import { createContext as c, useReducer as i, useContext as d } from "react";
3
- const w = {}, D = (e, r) => {
4
- switch (r.type) {
5
- case "OPEN_DRAWER":
6
- return { ...e, [r.id]: !0 };
7
- case "CLOSE_DRAWER":
8
- return { ...e, [r.id]: !1 };
9
- default:
10
- return e;
11
- }
12
- }, s = c(void 0), E = ({ children: e }) => {
13
- const [r, o] = i(D, w), n = (t) => o({ type: "OPEN_DRAWER", id: t }), u = (t) => o({ type: "CLOSE_DRAWER", id: t });
14
- return /* @__PURE__ */ a.jsx(s.Provider, { value: { state: r, openDrawer: n, closeDrawer: u }, children: e });
15
- }, p = () => {
16
- const e = d(s);
17
- if (!e)
18
- throw new Error("useDrawerContext must be used within a DrawerProvider");
19
- return e;
20
- };
21
- export {
22
- E as DrawerProvider,
23
- p as useDrawerContext
24
- };
@@ -1,55 +0,0 @@
1
- import { j as e } from "../../jsx-runtime-BcAkpsdy.js";
2
- import { c as w } from "../../index-BHf7G3IG.js";
3
- import { useDrawerContext as f } from "./Provider.js";
4
- import h from "../Icon/index.js";
5
- import { useEffect as x } from "react";
6
- import '../../index.css';const j = "_drawer_ltlqj_2", u = "_header_ltlqj_2", y = "_body_ltlqj_2", a = {
7
- drawer: j,
8
- header: u,
9
- body: y
10
- };
11
- function D({ id: t, children: n, title: i, onClose: d }) {
12
- const { state: c, closeDrawer: l } = f(), s = c[t] || !1;
13
- if (!s)
14
- return null;
15
- const r = () => {
16
- l(t), d && d();
17
- };
18
- return x(() => {
19
- if (!s)
20
- return;
21
- const o = (m) => {
22
- m.key === "Escape" && r();
23
- };
24
- return document.addEventListener("keydown", o), () => {
25
- document.removeEventListener("keydown", o);
26
- };
27
- }, [s, t, r]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
28
- /* @__PURE__ */ e.jsx(
29
- "div",
30
- {
31
- "data-testid": "drawer-overlay",
32
- onClick: r,
33
- style: {
34
- position: "fixed",
35
- top: 0,
36
- left: 0,
37
- width: "100%",
38
- height: "100%",
39
- background: "rgba(0, 0, 0, 0.5)",
40
- zIndex: 999
41
- }
42
- }
43
- ),
44
- /* @__PURE__ */ e.jsxs("div", { "data-testid": "drawer", className: w(a.drawer), children: [
45
- /* @__PURE__ */ e.jsxs("div", { "data-testid": "drawer-header", className: a.header, children: [
46
- /* @__PURE__ */ e.jsx("div", { children: i }),
47
- /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(h, { onClick: r, name: "close" }) })
48
- ] }),
49
- /* @__PURE__ */ e.jsx("div", { "data-testid": "drawer-body", className: a.body, children: n })
50
- ] })
51
- ] });
52
- }
53
- export {
54
- D as default
55
- };
@@ -1,90 +0,0 @@
1
- import { j as o } from "../../jsx-runtime-BcAkpsdy.js";
2
- import { useState as x, useRef as j, useEffect as k } from "react";
3
- import { c as d } from "../../index-BHf7G3IG.js";
4
- import N from "../Icon/index.js";
5
- import E from "../PermaLink/PermaLink.js";
6
- import '../../DropdownList.css';const b = "_dropdownMenu_1n5ha_2", g = "_dropdownMenu__lg_1n5ha_2", C = "_dropdownMenu__md_1n5ha_2", L = "_dropdownMenu__sm_1n5ha_2", R = "_active_1n5ha_2", $ = "_icon_1n5ha_2", y = "_title_1n5ha_2", H = "_disabled_1n5ha_2", e = {
7
- dropdownMenu: b,
8
- dropdownMenu__lg: g,
9
- dropdownMenu__md: C,
10
- dropdownMenu__sm: L,
11
- active: R,
12
- icon: $,
13
- title: y,
14
- disabled: H
15
- }, B = ({
16
- buttonChild: m,
17
- items: h,
18
- footerItem: a,
19
- className: w,
20
- title: l,
21
- titleClass: M,
22
- event: r = "hover",
23
- size: i = "lg",
24
- isDisabled: c
25
- }) => {
26
- const [_, t] = x(!1), u = j(null), p = (n) => {
27
- const s = u.current;
28
- s != null && s.contains(n.target) || t(!1);
29
- };
30
- k(() => (document.addEventListener("mousedown", p), () => {
31
- document.removeEventListener("mousedown", p);
32
- }), []);
33
- const f = (n) => {
34
- c || n === "click" && t(!_);
35
- };
36
- return /* @__PURE__ */ o.jsx(
37
- "div",
38
- {
39
- className: d("h-full flex items-center", {
40
- [e.disabled]: c
41
- }),
42
- ref: u,
43
- "data-testid": "dropdown-list",
44
- children: /* @__PURE__ */ o.jsxs(
45
- "div",
46
- {
47
- className: d(w, e.dropdownMenu, {
48
- [e.disabled]: c
49
- }),
50
- onMouseLeave: () => r === "hover" && t(!1),
51
- onMouseEnter: () => r === "hover" && t(!0),
52
- onClick: () => f(r),
53
- children: [
54
- m,
55
- /* @__PURE__ */ o.jsx(
56
- "div",
57
- {
58
- className: d(e.dropdownMenu, {
59
- [e.active]: _,
60
- [e[`dropdownMenu__${i}`]]: i
61
- }),
62
- children: /* @__PURE__ */ o.jsxs("ul", { children: [
63
- l && /* @__PURE__ */ o.jsx("li", { className: d(e.title, M), children: l }),
64
- h.map((n, s) => /* @__PURE__ */ o.jsxs(
65
- "li",
66
- {
67
- "data-testid": `dropdown-item-${s}`,
68
- className: d(n.className, {
69
- [e.icon]: n.icon
70
- }),
71
- children: [
72
- n.icon && /* @__PURE__ */ o.jsx(N, { name: n.icon }),
73
- n.to ? /* @__PURE__ */ o.jsx(E, { to: n.to, children: n.text }) : /* @__PURE__ */ o.jsx("a", { onClick: (v) => n.onClick && n.onClick(v), children: n.text })
74
- ]
75
- },
76
- s
77
- )),
78
- a && a
79
- ] })
80
- }
81
- )
82
- ]
83
- }
84
- )
85
- }
86
- );
87
- };
88
- export {
89
- B as default
90
- };
@@ -1,69 +0,0 @@
1
- import { j as o } from "../../jsx-runtime-BcAkpsdy.js";
2
- import { N as c } from "../../index-H7XbDVmH.js";
3
- import "../../index-BHf7G3IG.js";
4
- import "../../hooks/useAauth.js";
5
- import "../../assets/images/500_error_2x.gif";
6
- import "../../locales/i18n.js";
7
- import "react";
8
- import "../Tooltip/Tooltip.js";
9
- import "../../react-toastify.esm-BUWNP7Nm.js";
10
- import "../../utils/date.js";
11
- import "../Input/Input.js";
12
- import m from "../ScrollContainer/ScrollContainer.js";
13
- import "../Charts/index.js";
14
- import "../Checkbox/Checkbox.js";
15
- import "../Confirm/Confirm.js";
16
- import "../Datepicker/Datepicker.js";
17
- import t from "../Divider/Divider.js";
18
- import "../Drawer/Provider.js";
19
- import "../FileUpload/FileUpload.js";
20
- import x from "../Modal/Modal.js";
21
- import e from "../Grid/Column.js";
22
- import u from "../Grid/Row.js";
23
- import a from "../InfoDate/InfoDate.js";
24
- import "../../Select-BE_y91ZN.js";
25
- import "../Switch/Switch.js";
26
- import "../Textarea/Textarea.js";
27
- import w from "../../hooks/useNiceModal.js";
28
- import { u as h } from "../../useTranslation-CnCPcxVj.js";
29
- import { T as M } from "../../Trans-B4ILpbwK.js";
30
- import '../../ErrorLogModal.css';const g = "_dropdownMenu_8gwxh_2", j = "_dropdownMenu__lg_8gwxh_2", f = "_dropdownMenu__md_8gwxh_2", b = "_dropdownMenu__sm_8gwxh_2", N = "_active_8gwxh_2", v = "_icon_8gwxh_2", L = "_title_8gwxh_2", T = "_disabled_8gwxh_2", l = {
31
- dropdownMenu: g,
32
- dropdownMenu__lg: j,
33
- dropdownMenu__md: f,
34
- dropdownMenu__sm: b,
35
- active: N,
36
- icon: v,
37
- title: L,
38
- disabled: T
39
- }, y = ({ id: i, onClose: n, errors: s }) => {
40
- const { t: d } = h(), [, _] = w(i), p = () => {
41
- _(), n && n();
42
- };
43
- return /* @__PURE__ */ o.jsx(
44
- x,
45
- {
46
- onClose: p,
47
- className: l.realTimeLogModalStyle,
48
- header: /* @__PURE__ */ o.jsx("div", { className: l.modalHeader, children: d("title.error_log") }),
49
- children: /* @__PURE__ */ o.jsx(m, { children: s ? s.map((r) => /* @__PURE__ */ o.jsxs("div", { className: "container-fluid", children: [
50
- /* @__PURE__ */ o.jsxs(u, { children: [
51
- /* @__PURE__ */ o.jsxs(e, { children: [
52
- /* @__PURE__ */ o.jsx("b", { children: `${d("label.created_date")}:` }),
53
- /* @__PURE__ */ o.jsx(a, { date: r == null ? void 0 : r.created_date })
54
- ] }),
55
- /* @__PURE__ */ o.jsxs(e, { children: [
56
- /* @__PURE__ */ o.jsx("b", { children: `${d("label.date_updated")}:` }),
57
- /* @__PURE__ */ o.jsx(a, { date: r == null ? void 0 : r.update_date })
58
- ] })
59
- ] }),
60
- /* @__PURE__ */ o.jsx(t, { className: "mt-4 mb-4" }),
61
- /* @__PURE__ */ o.jsx("p", { className: "pre-line", children: r == null ? void 0 : r.log_data }),
62
- /* @__PURE__ */ o.jsx(t, { className: "mt-4 mb-4" })
63
- ] }, r == null ? void 0 : r.id)) : /* @__PURE__ */ o.jsx(M, { i18nKey: "text.not_found", values: { dataname: "Log" } }) })
64
- }
65
- );
66
- }, so = c.create(y);
67
- export {
68
- so as default
69
- };
@@ -1,237 +0,0 @@
1
- import { j as e } from "../../jsx-runtime-BcAkpsdy.js";
2
- import Z, { useState as j, useEffect as ee } from "react";
3
- import te from "../Icon/index.js";
4
- import { Notification as se } from "../Notification/Notification.js";
5
- import { convertToBase64 as ae } from "../../utils/helper.js";
6
- import { c as p } from "../../index-BHf7G3IG.js";
7
- import { Icons as re } from "../../assets/icons/icons.js";
8
- import { s as t } from "../../FileUpload.module-BxCEtOHx.js";
9
- import ie from "../../assets/images/oms.png";
10
- import { AppearanceDirection as le, NotificationAppearanceType as ne } from "../../enums/appearance.js";
11
- import { imageFormatValidation as oe } from "../../utils/validation.js";
12
- import M from "../Label/Label.js";
13
- import ce from "../Tooltip/Tooltip.js";
14
- import me from "../ValidationError/ValidationError.js";
15
- import de from "./LengthCard.js";
16
- import pe from "./PreviewModal.js";
17
- import { u as fe } from "../../useTranslation-CnCPcxVj.js";
18
- const ue = Z.forwardRef(
19
- (A, W) => {
20
- var O, k;
21
- const {
22
- name: h,
23
- label: g,
24
- id: $,
25
- type: N = "text",
26
- size: F,
27
- isDisabled: v,
28
- info: C,
29
- error: P,
30
- appearance: x,
31
- description: B,
32
- className: L,
33
- wrapperClassName: U,
34
- height: R = "40",
35
- value: i,
36
- fileName: _,
37
- required: V,
38
- onChange: o,
39
- multiple: a = !1,
40
- ...z
41
- } = A, { t: T } = fe(), S = {
42
- [t[`type__${N}`]]: N !== "text"
43
- }, [c, b] = j(), [f, y] = j(), [s, u] = j([]), [q, w] = j(!1), G = p(
44
- "form-group",
45
- {
46
- [t[`size__${F}`]]: F,
47
- [t.disabled]: v,
48
- [t.hidden]: N === "hidden"
49
- },
50
- U
51
- ), H = (d) => d[0] && oe(d) ? new Promise((l, r) => {
52
- const m = new FileReader();
53
- m.readAsDataURL(d[0]), m.onload = () => l(m.result), m.onerror = (n) => r(n);
54
- }) : ie, J = async (d) => {
55
- const l = d.currentTarget.files;
56
- let r = [];
57
- if (!(s.length + l.length > 5)) {
58
- if (a && !((s == null ? void 0 : s.length) >= 5)) {
59
- const m = Object.values(l);
60
- for (let n = 0; n < m.length; n++)
61
- r.push(
62
- ae(m[n])
63
- );
64
- await Promise.all(r).then((n) => {
65
- var E;
66
- ((E = s.filter(
67
- (X) => n.some((Y) => X === Y)
68
- )) == null ? void 0 : E.length) > 0 ? se({
69
- message: T("text.duplicate_image_error"),
70
- type: ne.ERROR
71
- }) : (o && o([...s, ...n]), u([
72
- ...s || [],
73
- ...n
74
- ]), b(l));
75
- });
76
- return;
77
- }
78
- l[0] && !a && (r = await H(l), o && o(r), y(r), b(l));
79
- }
80
- }, D = () => {
81
- u([]), y(""), b(""), o && o("");
82
- }, I = (d, l) => {
83
- const r = d;
84
- if (l && r.length == 1) {
85
- D(), w(!1);
86
- return;
87
- }
88
- if (l) {
89
- const m = r.filter((n) => n !== l);
90
- u(m), o && o(m);
91
- return;
92
- }
93
- if (r.length == 1) {
94
- D();
95
- return;
96
- }
97
- r.length >= 0 && (u(r.slice(0, -1)), o && o(r.slice(0, -1)));
98
- }, K = () => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
99
- /* @__PURE__ */ e.jsxs("div", { className: t.imageContainer, "data-testid": "fileupload-multipleimages", children: [
100
- /* @__PURE__ */ e.jsx("img", { src: s[s.length - 1] }),
101
- /* @__PURE__ */ e.jsx(
102
- te,
103
- {
104
- name: re.Trash,
105
- className: t.deleteIcon,
106
- onClick: () => I(s)
107
- }
108
- )
109
- ] }),
110
- /* @__PURE__ */ e.jsx("div", { className: t.lengthContainer, children: s.length > 1 && /* @__PURE__ */ e.jsx(
111
- de,
112
- {
113
- onCardClick: () => w(!0),
114
- count: s.length - 1
115
- }
116
- ) })
117
- ] }), Q = (d) => {
118
- d.target.value = null;
119
- };
120
- return ee(() => {
121
- i && y(i), a && i && u(i);
122
- }, [i]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
123
- /* @__PURE__ */ e.jsxs("div", { className: G, "data-testid": "fileupload-container", children: [
124
- /* @__PURE__ */ e.jsxs(
125
- "div",
126
- {
127
- className: p(t.container, {
128
- [t[`${x}`]]: x,
129
- [t.disabled]: v
130
- }),
131
- children: [
132
- /* @__PURE__ */ e.jsxs(
133
- "div",
134
- {
135
- className: p("flex", "w-full", {
136
- "justify-between": g,
137
- "justify-start": !g
138
- }),
139
- children: [
140
- g && /* @__PURE__ */ e.jsx(M, { appearance: x, name: h, children: g }),
141
- (C && a || C && !f && !a) && /* @__PURE__ */ e.jsxs(
142
- M,
143
- {
144
- className: t.info,
145
- appearance: x,
146
- name: h,
147
- children: [
148
- V && "*",
149
- " ",
150
- C
151
- ]
152
- }
153
- )
154
- ]
155
- }
156
- ),
157
- /* @__PURE__ */ e.jsxs(
158
- "div",
159
- {
160
- className: p({
161
- [t.selectedFileWrap]: c || i,
162
- [t.selectedFileWrap__multiple]: i || a && s.length > 0
163
- }),
164
- children: [
165
- !a && f && /* @__PURE__ */ e.jsx("img", { src: f }),
166
- a && s.length > 0 && K(),
167
- /* @__PURE__ */ e.jsxs("div", { className: t.fileGroup, children: [
168
- (c || _) && !a && /* @__PURE__ */ e.jsx(
169
- ce,
170
- {
171
- id: h,
172
- tooltipContent: c && ((O = c[0]) == null ? void 0 : O.name) || _,
173
- ellipsis: !0,
174
- direction: le.TOP,
175
- children: /* @__PURE__ */ e.jsx("span", { className: t.fileName, children: c && ((k = c[0]) == null ? void 0 : k.name) || _ })
176
- }
177
- ),
178
- /* @__PURE__ */ e.jsxs(
179
- "div",
180
- {
181
- className: p(t.fieldWrap, {
182
- [t.border__black]: !(i && !a && c),
183
- [t.border__blue]: i && !a && c,
184
- [t["mr-auto"]]: i && !a,
185
- [t[`height-${R}`]]: R && !c && !f,
186
- [t["height-40"]]: f || c,
187
- [t.fieldWrap__multiple]: i && a && s.length >= 0
188
- }),
189
- children: [
190
- /* @__PURE__ */ e.jsx(
191
- "input",
192
- {
193
- type: "file",
194
- name: h,
195
- "data-testid": "fileupload-input",
196
- id: $,
197
- className: p(
198
- t.control,
199
- S,
200
- L
201
- ),
202
- disabled: v,
203
- onChange: J,
204
- onClick: Q,
205
- ref: W,
206
- multiple: a,
207
- ...z
208
- }
209
- ),
210
- /* @__PURE__ */ e.jsx("span", { children: i && !a ? T("button.edit") : B })
211
- ]
212
- }
213
- )
214
- ] })
215
- ]
216
- }
217
- )
218
- ]
219
- }
220
- ),
221
- P && /* @__PURE__ */ e.jsx(me, { ...P })
222
- ] }),
223
- q && /* @__PURE__ */ e.jsx(
224
- pe,
225
- {
226
- imagePaths: s,
227
- onDelete: I,
228
- onClose: () => w(!1)
229
- }
230
- )
231
- ] });
232
- }
233
- );
234
- ue.displayName = "FileUpload";
235
- export {
236
- ue as default
237
- };
@@ -1,19 +0,0 @@
1
- import { j as e } from "../../jsx-runtime-BcAkpsdy.js";
2
- import o from "../Modal/Modal.js";
3
- import { s as i } from "../../FileUpload.module-BxCEtOHx.js";
4
- import { u as a } from "../../useTranslation-CnCPcxVj.js";
5
- const f = ({ onClose: t, src: r }) => {
6
- const { t: s } = a();
7
- return /* @__PURE__ */ e.jsx(
8
- o,
9
- {
10
- onClose: t,
11
- title: s("title.preview"),
12
- className: i.imagePreviewModal,
13
- children: /* @__PURE__ */ e.jsx("img", { src: r })
14
- }
15
- );
16
- };
17
- export {
18
- f as default
19
- };
@@ -1,6 +0,0 @@
1
- import { j as s } from "../../jsx-runtime-BcAkpsdy.js";
2
- import { s as e } from "../../FileUpload.module-BxCEtOHx.js";
3
- const l = ({ count: t, onCardClick: a }) => /* @__PURE__ */ s.jsx("div", { "data-testid": "fileupload-lengthcard", className: e.lengthCard, onClick: a, children: /* @__PURE__ */ s.jsx("span", { children: `+ ${t}` }) });
4
- export {
5
- l as default
6
- };
@@ -1,53 +0,0 @@
1
- import { j as e } from "../../jsx-runtime-BcAkpsdy.js";
2
- import { useState as a } from "react";
3
- import n from "../Icon/index.js";
4
- import j from "../Modal/Modal.js";
5
- import { Icons as m } from "../../assets/icons/icons.js";
6
- import { s as r } from "../../FileUpload.module-BxCEtOHx.js";
7
- import u from "./ImagePreview.js";
8
- import { u as w } from "../../useTranslation-CnCPcxVj.js";
9
- const O = ({ imagePaths: i, onClose: l, onDelete: c }) => {
10
- const { t: d } = w(), [p, o] = a(!1), [t, v] = a(), x = (s) => {
11
- v(s), o(!0);
12
- };
13
- return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
14
- /* @__PURE__ */ e.jsx(
15
- j,
16
- {
17
- title: d("title.edit_images"),
18
- className: r.previewModal,
19
- onClose: l,
20
- headerClass: r.header,
21
- children: /* @__PURE__ */ e.jsx("div", { className: r.pictureContainer, children: i.map((s, f) => /* @__PURE__ */ e.jsxs("div", { className: r.previewContainer, children: [
22
- /* @__PURE__ */ e.jsxs("div", { className: r.preview, children: [
23
- /* @__PURE__ */ e.jsx(
24
- n,
25
- {
26
- name: m.Preview,
27
- onClick: () => x(s)
28
- }
29
- ),
30
- /* @__PURE__ */ e.jsx(
31
- n,
32
- {
33
- name: m.Trash,
34
- onClick: () => c(i, s)
35
- }
36
- )
37
- ] }),
38
- /* @__PURE__ */ e.jsx("img", { src: s })
39
- ] }, f)) })
40
- }
41
- ),
42
- p && t && /* @__PURE__ */ e.jsx(
43
- u,
44
- {
45
- src: t,
46
- onClose: () => o(!1)
47
- }
48
- )
49
- ] });
50
- };
51
- export {
52
- O as default
53
- };
@@ -1,29 +0,0 @@
1
- import { j as n } from "../../jsx-runtime-BcAkpsdy.js";
2
- import { c as $ } from "../../index-BHf7G3IG.js";
3
- const p = ({
4
- children: m,
5
- auto: l = !1,
6
- size: o,
7
- sm: c,
8
- md: s,
9
- lg: a,
10
- xl: t,
11
- className: r
12
- }) => {
13
- const e = $(
14
- {
15
- col: !o && !l,
16
- "col-auto": !o && l,
17
- [`col-xl-${t}`]: t,
18
- [`col-lg-${a}`]: a,
19
- [`col-md-${s}`]: s,
20
- [`col-sm-${c}`]: c,
21
- [`col-${o}`]: o && !l
22
- },
23
- r
24
- );
25
- return /* @__PURE__ */ n.jsx("div", { "data-testid": "column", className: e, children: m });
26
- };
27
- export {
28
- p as default
29
- };
@@ -1,6 +0,0 @@
1
- import { j as a } from "../../jsx-runtime-BcAkpsdy.js";
2
- import { c as o } from "../../index-BHf7G3IG.js";
3
- const m = ({ children: s, className: t }) => /* @__PURE__ */ a.jsx("div", { "data-testid": "row", className: o("row", t), children: s });
4
- export {
5
- m as default
6
- };
@@ -1,22 +0,0 @@
1
- import c from "react";
2
- import { c as o } from "../../index-BHf7G3IG.js";
3
- import '../../Heading.css';const m = "_h2_dcf3m_2", n = "_h1_dcf3m_2", r = {
4
- h2: m,
5
- h1: n
6
- }, f = ({
7
- children: s,
8
- level: e = 2,
9
- className: a
10
- }) => {
11
- const t = `h${e}`;
12
- return c.createElement(
13
- t,
14
- {
15
- className: o(r[t], a)
16
- },
17
- s
18
- );
19
- };
20
- export {
21
- f as default
22
- };
@@ -1,24 +0,0 @@
1
- import { j as l } from "../../jsx-runtime-BcAkpsdy.js";
2
- import { c as r } from "../../index-BHf7G3IG.js";
3
- const f = (s) => {
4
- const { name: t, onClick: a, style: o, isDisabled: e, className: c } = s, i = (n) => {
5
- if (e)
6
- return n.preventDefault();
7
- a && a(n);
8
- };
9
- return /* @__PURE__ */ l.jsx(
10
- "i",
11
- {
12
- ...s,
13
- style: o,
14
- "data-testid": `icon-${t}`,
15
- onClick: i,
16
- className: r(`icon-${t}`, c, {
17
- disabled: e
18
- })
19
- }
20
- );
21
- };
22
- export {
23
- f as default
24
- };