@arkyn/components 3.0.1-beta.156 → 3.0.1-beta.158
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/components/calendar/_viewService.d.ts +1 -1
- package/dist/components/fullCalendar/_viewService.d.ts +2 -2
- package/dist/hooks/useScopedParams.d.ts +1 -1
- package/dist/index.js +4347 -4683
- package/dist/modules/components/alert/alertContainer/index.js +25 -20
- package/dist/modules/components/alert/alertContent/index.js +11 -8
- package/dist/modules/components/alert/alertDescription/index.js +11 -8
- package/dist/modules/components/alert/alertIcon/index.js +27 -19
- package/dist/modules/components/alert/alertTitle/index.js +11 -8
- package/dist/modules/components/audioPlayer/index.js +74 -75
- package/dist/modules/components/audioUpload/hasFileContent/index.js +54 -62
- package/dist/modules/components/audioUpload/index.js +71 -79
- package/dist/modules/components/audioUpload/noFileContent/index.js +35 -45
- package/dist/modules/components/badge/index.js +26 -22
- package/dist/modules/components/button/index.js +39 -32
- package/dist/modules/components/calendar/_calendarProvider.js +38 -63
- package/dist/modules/components/calendar/_viewService.js +132 -140
- package/dist/modules/components/calendar/calendarContainer/index.js +10 -7
- package/dist/modules/components/calendar/calendarHeader/index.js +51 -72
- package/dist/modules/components/calendar/calendarTableBody/index.js +12 -10
- package/dist/modules/components/calendar/calendarTableContainer/index.js +10 -7
- package/dist/modules/components/calendar/calendarTableHeader/index.js +13 -10
- package/dist/modules/components/calendar/calendarTableTd/index.js +20 -23
- package/dist/modules/components/calendar/index.js +31 -49
- package/dist/modules/components/cardTab/cardTabButton/index.js +19 -29
- package/dist/modules/components/cardTab/cardTabContainer/index.js +22 -28
- package/dist/modules/components/cardTab/cardTabContext.js +13 -11
- package/dist/modules/components/checkbox/index.js +37 -64
- package/dist/modules/components/clientOnly.js +8 -8
- package/dist/modules/components/currencyInput/index.js +110 -138
- package/dist/modules/components/divider/index.js +10 -11
- package/dist/modules/components/drawer/drawerContainer/index.js +40 -43
- package/dist/modules/components/drawer/drawerContext.js +13 -11
- package/dist/modules/components/drawer/drawerHeader/index.js +20 -27
- package/dist/modules/components/facebookPixel/facebookPixel.client.js +8 -18
- package/dist/modules/components/facebookPixel/index.js +8 -8
- package/dist/modules/components/facebookPixel/pixel.js +47 -52
- package/dist/modules/components/fieldError/index.js +12 -8
- package/dist/modules/components/fieldLabel/index.js +11 -12
- package/dist/modules/components/fieldWrapper/index.js +12 -13
- package/dist/modules/components/fileUpload/hasFileContent/index.js +59 -67
- package/dist/modules/components/fileUpload/index.js +65 -72
- package/dist/modules/components/fileUpload/noFileContent/index.js +35 -45
- package/dist/modules/components/fullCalendar/_fullCalendarProvider.js +33 -46
- package/dist/modules/components/fullCalendar/_viewService.js +100 -105
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarContainer/index.js +10 -7
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarEvent/index.js +70 -78
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarRow/index.js +28 -33
- package/dist/modules/components/fullCalendar/dayCalendar/index.js +12 -9
- package/dist/modules/components/fullCalendar/fullCalendarContainer/index.js +10 -7
- package/dist/modules/components/fullCalendar/fullCalendarHeader/index.js +67 -70
- package/dist/modules/components/fullCalendar/index.js +30 -30
- package/dist/modules/components/fullCalendar/monthlyCalendar/index.js +9 -12
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarEvent/index.js +28 -36
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableBody/index.js +11 -9
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableContainer/index.js +10 -9
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableHeader/index.js +13 -10
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableTd/index.js +35 -36
- package/dist/modules/components/fullCalendar/weekCalendar/index.js +8 -11
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarEvent/index.js +70 -78
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableBody/index.js +17 -20
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableContainer/index.js +9 -8
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableHeader/index.js +16 -19
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableTd/index.js +34 -39
- package/dist/modules/components/googleAnalytics/googleAnalytics.client.js +7 -7
- package/dist/modules/components/googleAnalytics/googleAnalytics.js +17 -17
- package/dist/modules/components/googleAnalytics/index.js +9 -9
- package/dist/modules/components/googleAnalytics/snippets/generateGAElements.js +10 -12
- package/dist/modules/components/googleTagManager/googleTagManager.client.js +6 -6
- package/dist/modules/components/googleTagManager/googleTagManager.js +44 -48
- package/dist/modules/components/googleTagManager/index.js +16 -27
- package/dist/modules/components/googleTagManager/snippets/appendToDataLayer.js +8 -8
- package/dist/modules/components/googleTagManager/snippets/generateGTMElements.js +19 -20
- package/dist/modules/components/iconButton/index.js +31 -29
- package/dist/modules/components/imageUpload/hasFileContent/index.js +46 -63
- package/dist/modules/components/imageUpload/index.js +65 -82
- package/dist/modules/components/imageUpload/noFileContent/index.js +35 -45
- package/dist/modules/components/input/index.js +92 -120
- package/dist/modules/components/mapView/index.js +27 -31
- package/dist/modules/components/mapView/mapView.client.js +49 -51
- package/dist/modules/components/maskedInput/index.js +101 -112
- package/dist/modules/components/modal/modalContainer/index.js +49 -42
- package/dist/modules/components/modal/modalContext.js +13 -11
- package/dist/modules/components/modal/modalFooter/index.js +10 -7
- package/dist/modules/components/modal/modalHeader/index.js +20 -27
- package/dist/modules/components/multiSelect/index.js +115 -154
- package/dist/modules/components/multiSelect/multiSelectChevron/index.js +18 -21
- package/dist/modules/components/multiSelect/multiSelectContainer/index.js +13 -29
- package/dist/modules/components/multiSelect/multiSelectContent/index.js +11 -8
- package/dist/modules/components/multiSelect/multiSelectMark/index.js +19 -22
- package/dist/modules/components/multiSelect/multiSelectOption/index.js +17 -13
- package/dist/modules/components/multiSelect/multiSelectOptionsContainer/index.js +35 -45
- package/dist/modules/components/multiSelect/multiSelectOverlay/index.js +11 -8
- package/dist/modules/components/multiSelect/multiSelectSpinner/index.js +13 -16
- package/dist/modules/components/pagination/chevronButton/index.js +17 -17
- package/dist/modules/components/pagination/currentButton/index.js +11 -7
- package/dist/modules/components/pagination/index.js +51 -83
- package/dist/modules/components/pagination/pageButton/index.js +12 -8
- package/dist/modules/components/pagination/paginationService.js +33 -48
- package/dist/modules/components/pagination/spread/index.js +10 -7
- package/dist/modules/components/phoneInput/index.js +103 -151
- package/dist/modules/components/phoneInput/phoneInputContainer/index.js +12 -19
- package/dist/modules/components/phoneInput/phoneInputCountriesOverlay/index.js +11 -8
- package/dist/modules/components/phoneInput/phoneInputCountryOption/index.js +23 -15
- package/dist/modules/components/phoneInput/phoneInputCountryOptionsContainer/index.js +33 -43
- package/dist/modules/components/phoneInput/phoneInputCountrySelector/index.js +25 -21
- package/dist/modules/components/phoneInput/phoneInputMask/index.js +46 -62
- package/dist/modules/components/popover/index.js +37 -36
- package/dist/modules/components/radio/radioBox/index.js +24 -42
- package/dist/modules/components/radio/radioContext.js +20 -18
- package/dist/modules/components/radio/radioGroup/index.js +41 -64
- package/dist/modules/components/richText/blockButton/index.js +20 -23
- package/dist/modules/components/richText/element/index.js +72 -58
- package/dist/modules/components/richText/index.js +143 -135
- package/dist/modules/components/richText/insertImage/index.js +94 -105
- package/dist/modules/components/richText/insertVideo/index.js +85 -97
- package/dist/modules/components/richText/leaf/index.js +9 -6
- package/dist/modules/components/richText/markButton/index.js +19 -22
- package/dist/modules/components/richText/toolbar/index.js +10 -7
- package/dist/modules/components/searchPlaces.js +57 -66
- package/dist/modules/components/select/index.js +112 -144
- package/dist/modules/components/select/selectChevron/index.js +18 -21
- package/dist/modules/components/select/selectContainer/index.js +13 -29
- package/dist/modules/components/select/selectContent/index.js +11 -8
- package/dist/modules/components/select/selectOption/index.js +17 -13
- package/dist/modules/components/select/selectOptionsContainer/index.js +35 -45
- package/dist/modules/components/select/selectOverlay/index.js +11 -8
- package/dist/modules/components/select/selectSpinner/index.js +13 -9
- package/dist/modules/components/slider/index.js +34 -41
- package/dist/modules/components/switch/index.js +35 -62
- package/dist/modules/components/tab/tabButton/index.js +19 -29
- package/dist/modules/components/tab/tabContainer/index.js +22 -28
- package/dist/modules/components/tab/tabContext.js +12 -10
- package/dist/modules/components/table/tableBody/index.js +19 -14
- package/dist/modules/components/table/tableCaption/index.js +15 -8
- package/dist/modules/components/table/tableContainer/index.js +12 -8
- package/dist/modules/components/table/tableFooter/index.js +18 -11
- package/dist/modules/components/table/tableHeader/index.js +12 -11
- package/dist/modules/components/textarea/index.js +51 -69
- package/dist/modules/components/tooltip/index.js +34 -45
- package/dist/modules/hooks/useAutomation.js +35 -27
- package/dist/modules/hooks/useDrawer.js +17 -19
- package/dist/modules/hooks/useForm.js +6 -6
- package/dist/modules/hooks/useHydrated.js +7 -12
- package/dist/modules/hooks/useModal.js +17 -19
- package/dist/modules/hooks/useScopedParams.js +17 -17
- package/dist/modules/hooks/useScrollLock.js +19 -19
- package/dist/modules/hooks/useSearchAutomation.js +31 -14
- package/dist/modules/hooks/useSlider.js +13 -13
- package/dist/modules/hooks/useToast.js +8 -9
- package/dist/modules/index.js +72 -144
- package/dist/modules/providers/drawerProvider.js +35 -30
- package/dist/modules/providers/formProvider.js +11 -16
- package/dist/modules/providers/modalProvider.js +39 -33
- package/dist/modules/providers/placesProvider.js +16 -16
- package/dist/modules/providers/toastProvider.js +45 -51
- package/dist/modules/services/extractTextFromNode.js +6 -6
- package/dist/modules/services/fieldTemplate.js +22 -23
- package/dist/modules/services/iconRenderer.js +14 -7
- package/dist/modules/services/isBlockActive.js +12 -14
- package/dist/modules/services/isMarkActive.js +6 -6
- package/dist/modules/services/maskCurrencyValues.js +11 -12
- package/dist/modules/services/toHtml.js +6 -6
- package/dist/modules/services/toRichTextValue.js +7 -7
- package/dist/modules/services/toggleBlock.js +20 -19
- package/dist/modules/services/toggleMark.js +7 -7
- package/dist/modules/style.css +2 -1
- package/dist/modules/templates/badResponses.js +13 -13
- package/dist/modules/templates/richTextTemplates.js +17 -14
- package/dist/modules/templates/successResponses.js +9 -4
- package/dist/modules/utils/phoneInputUtilities.js +18 -28
- package/dist/modules/utils/richTextUtilities.js +88 -75
- package/dist/services/fieldTemplate.d.ts +1 -1
- package/dist/services/fieldTemplate.d.ts.map +1 -1
- package/dist/style.css +2 -1
- package/package.json +4 -4
- package/styles.d.ts +2 -0
|
@@ -1,22 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { AlertTitle as e } from "../alertTitle/index.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { createContext as t, useContext as n } from "react";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/alert/alertContainer/index.tsx
|
|
6
|
+
var i = t({});
|
|
7
|
+
function a() {
|
|
8
|
+
return n(i);
|
|
8
9
|
}
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
function o(t) {
|
|
11
|
+
let { schema: n, children: a, className: o, ...s } = t, c = `arkynAlertContainer ${n} ${((t) => {
|
|
12
|
+
let n = !1, r = (t) => {
|
|
13
|
+
Array.isArray(t) ? t.forEach(r) : t && typeof t == "object" && "type" in t && (t.type === e ? n = !0 : t.props && typeof t.props == "object" && t.props !== null && "children" in t.props && r(t.props.children));
|
|
14
|
+
};
|
|
15
|
+
return r(t), n;
|
|
16
|
+
})(a) ? "existsAlertTitle" : "nonExistsAlertTitle"} ${o}`;
|
|
17
|
+
return /* @__PURE__ */ r(i.Provider, {
|
|
18
|
+
value: t,
|
|
19
|
+
children: /* @__PURE__ */ r("div", {
|
|
20
|
+
className: c.trim(),
|
|
21
|
+
...s,
|
|
22
|
+
children: a
|
|
23
|
+
})
|
|
24
|
+
});
|
|
18
25
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
j as useAlertContainer
|
|
22
|
-
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { o as AlertContainer, a as useAlertContainer };
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/alert/alertContent/index.tsx
|
|
4
|
+
function t(t) {
|
|
5
|
+
let { className: n, ...r } = t;
|
|
6
|
+
return /* @__PURE__ */ e("div", {
|
|
7
|
+
className: `arkynAlertContent ${n}`.trim(),
|
|
8
|
+
...r
|
|
9
|
+
});
|
|
6
10
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { t as AlertContent };
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/alert/alertDescription/index.tsx
|
|
4
|
+
function t(t) {
|
|
5
|
+
let { className: n, ...r } = t;
|
|
6
|
+
return /* @__PURE__ */ e("div", {
|
|
7
|
+
className: `arkynAlertDescription ${n}`.trim(),
|
|
8
|
+
...r
|
|
9
|
+
});
|
|
6
10
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { t as AlertDescription };
|
|
@@ -1,20 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { useAlertContainer as e } from "../alertContainer/index.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
import { AlertTriangle as n, CheckCircle2 as r, Info as i, XCircle as a } from "lucide-react";
|
|
5
|
+
//#region src/components/alert/alertIcon/index.tsx
|
|
6
|
+
function o(o) {
|
|
7
|
+
let { className: s, ...c } = o, { schema: l } = e(), u = `arkynAlertIcon ${l} ${s}`;
|
|
8
|
+
switch (l) {
|
|
9
|
+
case "success": return /* @__PURE__ */ t(r, {
|
|
10
|
+
className: u,
|
|
11
|
+
...c
|
|
12
|
+
});
|
|
13
|
+
case "danger": return /* @__PURE__ */ t(a, {
|
|
14
|
+
className: u,
|
|
15
|
+
...c
|
|
16
|
+
});
|
|
17
|
+
case "warning": return /* @__PURE__ */ t(n, {
|
|
18
|
+
className: u,
|
|
19
|
+
...c
|
|
20
|
+
});
|
|
21
|
+
case "info": return /* @__PURE__ */ t(i, {
|
|
22
|
+
className: u,
|
|
23
|
+
...c
|
|
24
|
+
});
|
|
25
|
+
}
|
|
17
26
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
27
|
+
//#endregion
|
|
28
|
+
export { o as AlertIcon };
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/alert/alertTitle/index.tsx
|
|
4
|
+
function t(t) {
|
|
5
|
+
let { className: n, ...r } = t;
|
|
6
|
+
return /* @__PURE__ */ e("div", {
|
|
7
|
+
className: `arkynAlertTitle ${n}`.trim(),
|
|
8
|
+
...r
|
|
9
|
+
});
|
|
6
10
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { t as AlertTitle };
|
|
@@ -1,76 +1,75 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
1
|
+
import { useSlider as e } from "../../hooks/useSlider.js";
|
|
2
|
+
import { Slider as t } from "../slider/index.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { useEffect as n, useRef as r, useState as i } from "react";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
import { Pause as s, Play as c } from "lucide-react";
|
|
7
|
+
//#region src/components/audioPlayer/index.tsx
|
|
8
|
+
function l(l) {
|
|
9
|
+
let { onPlayAudio: u, onPauseAudio: d, disabled: f, style: p, ...m } = l, [h, g] = e(0), [_, v] = i(!1), [y, b] = i(!1), x = r(null), S = x.current?.currentTime || 0, C = x.current?.duration || 0, w = D(S), T = D(C), E = {
|
|
10
|
+
totalTime: C,
|
|
11
|
+
currentTime: S,
|
|
12
|
+
formattedCurrentTime: w,
|
|
13
|
+
formattedTotalTime: T
|
|
14
|
+
};
|
|
15
|
+
function D(e) {
|
|
16
|
+
if (!e) return "00:00";
|
|
17
|
+
let t = Math.floor(e / 60), n = Math.floor(e % 60);
|
|
18
|
+
return `${String(t).padStart(2, "0")}:${String(n).padStart(2, "0")}`;
|
|
19
|
+
}
|
|
20
|
+
function O() {
|
|
21
|
+
let e = x.current;
|
|
22
|
+
e && (l.onPlayAudio && l.onPlayAudio(E), e.play(), v(!0));
|
|
23
|
+
}
|
|
24
|
+
function k() {
|
|
25
|
+
let e = x.current;
|
|
26
|
+
e && (l.onPauseAudio && l.onPauseAudio(E), e.pause(), v(!1));
|
|
27
|
+
}
|
|
28
|
+
function A() {
|
|
29
|
+
_ ? k() : O();
|
|
30
|
+
}
|
|
31
|
+
function j(e) {
|
|
32
|
+
let t = x.current;
|
|
33
|
+
if (!t) return;
|
|
34
|
+
let n = t.duration;
|
|
35
|
+
t.currentTime = e / 100 * n;
|
|
36
|
+
}
|
|
37
|
+
return y || !_ ? x.current?.pause() : _ && x.current?.play(), n(() => {
|
|
38
|
+
let e = x.current;
|
|
39
|
+
if (!e) return;
|
|
40
|
+
let t = () => {
|
|
41
|
+
let t = e.duration;
|
|
42
|
+
g(e.currentTime / t * 100);
|
|
43
|
+
};
|
|
44
|
+
return e.addEventListener("timeupdate", t), () => {
|
|
45
|
+
e.removeEventListener("timeupdate", t);
|
|
46
|
+
};
|
|
47
|
+
}, []), /* @__PURE__ */ o("div", {
|
|
48
|
+
className: "arkynAudioPlayer",
|
|
49
|
+
style: p,
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ a("audio", {
|
|
52
|
+
...m,
|
|
53
|
+
ref: x,
|
|
54
|
+
src: l.src,
|
|
55
|
+
onEnded: k
|
|
56
|
+
}),
|
|
57
|
+
/* @__PURE__ */ o("button", {
|
|
58
|
+
type: "button",
|
|
59
|
+
disabled: f,
|
|
60
|
+
onClick: A,
|
|
61
|
+
children: [_ && /* @__PURE__ */ a(s, {}), !_ && /* @__PURE__ */ a(c, {})]
|
|
62
|
+
}),
|
|
63
|
+
/* @__PURE__ */ a("p", { children: w }),
|
|
64
|
+
/* @__PURE__ */ a(t, {
|
|
65
|
+
value: h,
|
|
66
|
+
onChange: j,
|
|
67
|
+
onDragging: b,
|
|
68
|
+
disabled: f
|
|
69
|
+
}),
|
|
70
|
+
/* @__PURE__ */ a("p", { children: T })
|
|
71
|
+
]
|
|
72
|
+
});
|
|
73
73
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
};
|
|
74
|
+
//#endregion
|
|
75
|
+
export { l as AudioPlayer };
|
|
@@ -1,63 +1,55 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
type: "button",
|
|
54
|
-
disabled: i,
|
|
55
|
-
children: u
|
|
56
|
-
}
|
|
57
|
-
)
|
|
58
|
-
] })
|
|
59
|
-
] });
|
|
1
|
+
import { AudioPlayer as e } from "../../audioPlayer/index.js";
|
|
2
|
+
import { Button as t } from "../../button/index.js";
|
|
3
|
+
import { Divider as n } from "../../divider/index.js";
|
|
4
|
+
import { IconButton as r } from "../../iconButton/index.js";
|
|
5
|
+
import { Tooltip as i } from "../../tooltip/index.js";
|
|
6
|
+
/* empty css */
|
|
7
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
8
|
+
import { RefreshCw as s } from "lucide-react";
|
|
9
|
+
//#region src/components/audioUpload/hasFileContent/index.tsx
|
|
10
|
+
function c(c) {
|
|
11
|
+
let { filePath: l, disabled: u, acceptAudio: d, handleSelectFile: f, isLoading: p, reSendAudio: m, changeAudioButtonText: h } = c;
|
|
12
|
+
function g() {
|
|
13
|
+
if (u) return;
|
|
14
|
+
let e = document.createElement("input");
|
|
15
|
+
e.type = "file", e.accept = d, e.onchange = (e) => {
|
|
16
|
+
let t = e.target.files?.[0];
|
|
17
|
+
t && f(t);
|
|
18
|
+
}, e.click();
|
|
19
|
+
}
|
|
20
|
+
return /* @__PURE__ */ o("div", {
|
|
21
|
+
className: "arkynAudioUploadHasFileContentContainer",
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ a(e, { src: l }),
|
|
24
|
+
/* @__PURE__ */ a(n, {}),
|
|
25
|
+
/* @__PURE__ */ o("div", {
|
|
26
|
+
className: "arkynAudioUploadButtonsContainer",
|
|
27
|
+
children: [!!m && /* @__PURE__ */ a(i, {
|
|
28
|
+
orientation: "bottom",
|
|
29
|
+
text: "Reenviar áudio",
|
|
30
|
+
children: /* @__PURE__ */ a(r, {
|
|
31
|
+
type: "button",
|
|
32
|
+
"aria-label": "resend image",
|
|
33
|
+
variant: "outline",
|
|
34
|
+
scheme: "danger",
|
|
35
|
+
size: "sm",
|
|
36
|
+
isLoading: p,
|
|
37
|
+
onClick: m,
|
|
38
|
+
icon: s,
|
|
39
|
+
disabled: u
|
|
40
|
+
})
|
|
41
|
+
}), /* @__PURE__ */ a(t, {
|
|
42
|
+
isLoading: p,
|
|
43
|
+
onClick: g,
|
|
44
|
+
variant: "outline",
|
|
45
|
+
size: "sm",
|
|
46
|
+
type: "button",
|
|
47
|
+
disabled: u,
|
|
48
|
+
children: h
|
|
49
|
+
})]
|
|
50
|
+
})
|
|
51
|
+
]
|
|
52
|
+
});
|
|
60
53
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
};
|
|
54
|
+
//#endregion
|
|
55
|
+
export { c as HasFileContent };
|
|
@@ -1,80 +1,72 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
isLoading: v,
|
|
71
|
-
reSendAudio: d && A ? () => N(A) : void 0
|
|
72
|
-
}
|
|
73
|
-
)
|
|
74
|
-
] }),
|
|
75
|
-
d && /* @__PURE__ */ e(R, { children: d })
|
|
76
|
-
] });
|
|
1
|
+
import { useForm as e } from "../../hooks/useForm.js";
|
|
2
|
+
import { FieldError as t } from "../fieldError/index.js";
|
|
3
|
+
import { FieldLabel as n } from "../fieldLabel/index.js";
|
|
4
|
+
import { FieldWrapper as r } from "../fieldWrapper/index.js";
|
|
5
|
+
import { HasFileContent as i } from "./hasFileContent/index.js";
|
|
6
|
+
import { NoFileContent as a } from "./noFileContent/index.js";
|
|
7
|
+
/* empty css */
|
|
8
|
+
import { useState as o } from "react";
|
|
9
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
10
|
+
//#region src/components/audioUpload/index.tsx
|
|
11
|
+
function l(l) {
|
|
12
|
+
let { name: u, label: d, fileName: f = "file", method: p = "POST", onChange: m, fileResponseName: h = "url", selectAudioButtonText: g = "Selecionar arquivo de áudio", dropAudioText: _ = "Ou arraste e solte um arquivo de áudio aqui", changeAudioButtonText: v = "Trocar arquivo de áudio", acceptAudio: y = "audio/*", action: b, defaultValue: x = "", showAsterisk: S = !1, disabled: C = !1 } = l, { fieldErrors: w } = e(), T = w?.[u], [E, D] = o(x), [O, k] = o(""), [A, j] = o(null), [M, N] = o(x), [P, F] = o(!1);
|
|
13
|
+
async function I(e) {
|
|
14
|
+
if (C) return;
|
|
15
|
+
F(!0), j(e), k("");
|
|
16
|
+
let t = new FormData();
|
|
17
|
+
t.append(f, e), await fetch(b, {
|
|
18
|
+
method: p,
|
|
19
|
+
body: t
|
|
20
|
+
}).then(async (e) => await e.json()).then((e) => {
|
|
21
|
+
e?.error ? k(e.error) : D(e?.[h]), m && m(e?.[h]);
|
|
22
|
+
}).catch((e) => {
|
|
23
|
+
console.error(e), k("Erro ao enviar audio");
|
|
24
|
+
}).finally(() => F(!1));
|
|
25
|
+
}
|
|
26
|
+
function L(e) {
|
|
27
|
+
if (!C) {
|
|
28
|
+
if (e.type.indexOf("audio") === -1) {
|
|
29
|
+
k("O arquivo selecionado não é um arquivo de áudio");
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
N(URL.createObjectURL(e)), I(e);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
let R = T || O;
|
|
36
|
+
return /* @__PURE__ */ c(r, { children: [
|
|
37
|
+
d && /* @__PURE__ */ s(n, {
|
|
38
|
+
showAsterisk: S,
|
|
39
|
+
children: d
|
|
40
|
+
}),
|
|
41
|
+
/* @__PURE__ */ c("div", {
|
|
42
|
+
className: `arkynAudioUpload ${R ? "hasError" : "noHasError"} ${M ? "hasAudio" : "noHasAudio"}`,
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ s("input", {
|
|
45
|
+
type: "hidden",
|
|
46
|
+
name: u,
|
|
47
|
+
value: E || ""
|
|
48
|
+
}),
|
|
49
|
+
!M && /* @__PURE__ */ s(a, {
|
|
50
|
+
disabled: C,
|
|
51
|
+
isLoading: P,
|
|
52
|
+
acceptAudio: y,
|
|
53
|
+
dropAudioText: _,
|
|
54
|
+
handleSelectFile: L,
|
|
55
|
+
selectAudioButtonText: g
|
|
56
|
+
}),
|
|
57
|
+
M && /* @__PURE__ */ s(i, {
|
|
58
|
+
filePath: M,
|
|
59
|
+
acceptAudio: y,
|
|
60
|
+
changeAudioButtonText: v,
|
|
61
|
+
disabled: C,
|
|
62
|
+
handleSelectFile: L,
|
|
63
|
+
isLoading: P,
|
|
64
|
+
reSendAudio: R && A ? () => I(A) : void 0
|
|
65
|
+
})
|
|
66
|
+
]
|
|
67
|
+
}),
|
|
68
|
+
R && /* @__PURE__ */ s(t, { children: R })
|
|
69
|
+
] });
|
|
77
70
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
};
|
|
71
|
+
//#endregion
|
|
72
|
+
export { l as AudioUpload };
|