@arkyn/components 3.0.1-beta.155 → 3.0.1-beta.156
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 +4683 -4347
- package/dist/modules/components/alert/alertContainer/index.js +20 -25
- package/dist/modules/components/alert/alertContent/index.js +8 -11
- package/dist/modules/components/alert/alertDescription/index.js +8 -11
- package/dist/modules/components/alert/alertIcon/index.js +19 -27
- package/dist/modules/components/alert/alertTitle/index.js +8 -11
- package/dist/modules/components/audioPlayer/index.js +75 -74
- package/dist/modules/components/audioUpload/hasFileContent/index.js +62 -54
- package/dist/modules/components/audioUpload/index.js +79 -71
- package/dist/modules/components/audioUpload/noFileContent/index.js +45 -35
- package/dist/modules/components/badge/index.js +22 -26
- package/dist/modules/components/button/index.js +32 -39
- package/dist/modules/components/calendar/_calendarProvider.js +63 -38
- package/dist/modules/components/calendar/_viewService.js +140 -132
- package/dist/modules/components/calendar/calendarContainer/index.js +7 -10
- package/dist/modules/components/calendar/calendarHeader/index.js +72 -51
- package/dist/modules/components/calendar/calendarTableBody/index.js +10 -12
- package/dist/modules/components/calendar/calendarTableContainer/index.js +7 -10
- package/dist/modules/components/calendar/calendarTableHeader/index.js +10 -13
- package/dist/modules/components/calendar/calendarTableTd/index.js +23 -20
- package/dist/modules/components/calendar/index.js +49 -31
- package/dist/modules/components/cardTab/cardTabButton/index.js +29 -19
- package/dist/modules/components/cardTab/cardTabContainer/index.js +28 -22
- package/dist/modules/components/cardTab/cardTabContext.js +11 -13
- package/dist/modules/components/checkbox/index.js +64 -37
- package/dist/modules/components/clientOnly.js +8 -8
- package/dist/modules/components/currencyInput/index.js +138 -110
- package/dist/modules/components/divider/index.js +11 -10
- package/dist/modules/components/drawer/drawerContainer/index.js +43 -40
- package/dist/modules/components/drawer/drawerContext.js +11 -13
- package/dist/modules/components/drawer/drawerHeader/index.js +27 -20
- package/dist/modules/components/facebookPixel/facebookPixel.client.js +18 -8
- package/dist/modules/components/facebookPixel/index.js +8 -8
- package/dist/modules/components/facebookPixel/pixel.js +52 -47
- package/dist/modules/components/fieldError/index.js +8 -12
- package/dist/modules/components/fieldLabel/index.js +12 -11
- package/dist/modules/components/fieldWrapper/index.js +13 -12
- package/dist/modules/components/fileUpload/hasFileContent/index.js +67 -59
- package/dist/modules/components/fileUpload/index.js +72 -65
- package/dist/modules/components/fileUpload/noFileContent/index.js +45 -35
- package/dist/modules/components/fullCalendar/_fullCalendarProvider.js +46 -33
- package/dist/modules/components/fullCalendar/_viewService.js +105 -100
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarContainer/index.js +7 -10
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarEvent/index.js +78 -70
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarRow/index.js +33 -28
- package/dist/modules/components/fullCalendar/dayCalendar/index.js +9 -12
- package/dist/modules/components/fullCalendar/fullCalendarContainer/index.js +7 -10
- package/dist/modules/components/fullCalendar/fullCalendarHeader/index.js +70 -67
- package/dist/modules/components/fullCalendar/index.js +30 -30
- package/dist/modules/components/fullCalendar/monthlyCalendar/index.js +12 -9
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarEvent/index.js +36 -28
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableBody/index.js +9 -11
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableContainer/index.js +9 -10
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableHeader/index.js +10 -13
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableTd/index.js +36 -35
- package/dist/modules/components/fullCalendar/weekCalendar/index.js +11 -8
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarEvent/index.js +78 -70
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableBody/index.js +20 -17
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableContainer/index.js +8 -9
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableHeader/index.js +19 -16
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableTd/index.js +39 -34
- 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 +12 -10
- package/dist/modules/components/googleTagManager/googleTagManager.client.js +6 -6
- package/dist/modules/components/googleTagManager/googleTagManager.js +48 -44
- package/dist/modules/components/googleTagManager/index.js +27 -16
- package/dist/modules/components/googleTagManager/snippets/appendToDataLayer.js +8 -8
- package/dist/modules/components/googleTagManager/snippets/generateGTMElements.js +20 -19
- package/dist/modules/components/iconButton/index.js +29 -31
- package/dist/modules/components/imageUpload/hasFileContent/index.js +63 -46
- package/dist/modules/components/imageUpload/index.js +82 -65
- package/dist/modules/components/imageUpload/noFileContent/index.js +45 -35
- package/dist/modules/components/input/index.js +120 -92
- package/dist/modules/components/mapView/index.js +31 -27
- package/dist/modules/components/mapView/mapView.client.js +51 -49
- package/dist/modules/components/maskedInput/index.js +112 -101
- package/dist/modules/components/modal/modalContainer/index.js +42 -49
- package/dist/modules/components/modal/modalContext.js +11 -13
- package/dist/modules/components/modal/modalFooter/index.js +7 -10
- package/dist/modules/components/modal/modalHeader/index.js +27 -20
- package/dist/modules/components/multiSelect/index.js +154 -115
- package/dist/modules/components/multiSelect/multiSelectChevron/index.js +21 -18
- package/dist/modules/components/multiSelect/multiSelectContainer/index.js +29 -13
- package/dist/modules/components/multiSelect/multiSelectContent/index.js +8 -11
- package/dist/modules/components/multiSelect/multiSelectMark/index.js +22 -19
- package/dist/modules/components/multiSelect/multiSelectOption/index.js +13 -17
- package/dist/modules/components/multiSelect/multiSelectOptionsContainer/index.js +45 -35
- package/dist/modules/components/multiSelect/multiSelectOverlay/index.js +8 -11
- package/dist/modules/components/multiSelect/multiSelectSpinner/index.js +16 -13
- package/dist/modules/components/pagination/chevronButton/index.js +17 -17
- package/dist/modules/components/pagination/currentButton/index.js +7 -11
- package/dist/modules/components/pagination/index.js +83 -51
- package/dist/modules/components/pagination/pageButton/index.js +8 -12
- package/dist/modules/components/pagination/paginationService.js +48 -33
- package/dist/modules/components/pagination/spread/index.js +7 -10
- package/dist/modules/components/phoneInput/index.js +151 -103
- package/dist/modules/components/phoneInput/phoneInputContainer/index.js +19 -12
- package/dist/modules/components/phoneInput/phoneInputCountriesOverlay/index.js +8 -11
- package/dist/modules/components/phoneInput/phoneInputCountryOption/index.js +15 -23
- package/dist/modules/components/phoneInput/phoneInputCountryOptionsContainer/index.js +43 -33
- package/dist/modules/components/phoneInput/phoneInputCountrySelector/index.js +21 -25
- package/dist/modules/components/phoneInput/phoneInputMask/index.js +62 -46
- package/dist/modules/components/popover/index.js +36 -37
- package/dist/modules/components/radio/radioBox/index.js +42 -24
- package/dist/modules/components/radio/radioContext.js +18 -20
- package/dist/modules/components/radio/radioGroup/index.js +64 -41
- package/dist/modules/components/richText/blockButton/index.js +23 -20
- package/dist/modules/components/richText/element/index.js +58 -72
- package/dist/modules/components/richText/index.js +135 -143
- package/dist/modules/components/richText/insertImage/index.js +105 -94
- package/dist/modules/components/richText/insertVideo/index.js +97 -85
- package/dist/modules/components/richText/leaf/index.js +6 -9
- package/dist/modules/components/richText/markButton/index.js +22 -19
- package/dist/modules/components/richText/toolbar/index.js +7 -10
- package/dist/modules/components/searchPlaces.js +66 -57
- package/dist/modules/components/select/index.js +144 -112
- package/dist/modules/components/select/selectChevron/index.js +21 -18
- package/dist/modules/components/select/selectContainer/index.js +29 -13
- package/dist/modules/components/select/selectContent/index.js +8 -11
- package/dist/modules/components/select/selectOption/index.js +13 -17
- package/dist/modules/components/select/selectOptionsContainer/index.js +45 -35
- package/dist/modules/components/select/selectOverlay/index.js +8 -11
- package/dist/modules/components/select/selectSpinner/index.js +9 -13
- package/dist/modules/components/slider/index.js +41 -34
- package/dist/modules/components/switch/index.js +62 -35
- package/dist/modules/components/tab/tabButton/index.js +29 -19
- package/dist/modules/components/tab/tabContainer/index.js +28 -22
- package/dist/modules/components/tab/tabContext.js +10 -12
- package/dist/modules/components/table/tableBody/index.js +14 -19
- package/dist/modules/components/table/tableCaption/index.js +8 -15
- package/dist/modules/components/table/tableContainer/index.js +8 -12
- package/dist/modules/components/table/tableFooter/index.js +11 -18
- package/dist/modules/components/table/tableHeader/index.js +11 -12
- package/dist/modules/components/textarea/index.js +69 -51
- package/dist/modules/components/tooltip/index.js +45 -34
- package/dist/modules/hooks/useAutomation.js +27 -35
- package/dist/modules/hooks/useDrawer.js +19 -17
- package/dist/modules/hooks/useForm.js +6 -6
- package/dist/modules/hooks/useHydrated.js +12 -7
- package/dist/modules/hooks/useModal.js +19 -17
- package/dist/modules/hooks/useScopedParams.js +17 -17
- package/dist/modules/hooks/useScrollLock.js +19 -19
- package/dist/modules/hooks/useSearchAutomation.js +14 -31
- package/dist/modules/hooks/useSlider.js +13 -13
- package/dist/modules/hooks/useToast.js +9 -8
- package/dist/modules/index.js +144 -72
- package/dist/modules/providers/drawerProvider.js +30 -35
- package/dist/modules/providers/formProvider.js +16 -11
- package/dist/modules/providers/modalProvider.js +33 -39
- package/dist/modules/providers/placesProvider.js +16 -16
- package/dist/modules/providers/toastProvider.js +51 -45
- package/dist/modules/services/extractTextFromNode.js +6 -6
- package/dist/modules/services/fieldTemplate.js +23 -22
- package/dist/modules/services/iconRenderer.js +7 -14
- package/dist/modules/services/isBlockActive.js +14 -12
- package/dist/modules/services/isMarkActive.js +6 -6
- package/dist/modules/services/maskCurrencyValues.js +12 -11
- package/dist/modules/services/toHtml.js +6 -6
- package/dist/modules/services/toRichTextValue.js +7 -7
- package/dist/modules/services/toggleBlock.js +19 -20
- package/dist/modules/services/toggleMark.js +7 -7
- package/dist/modules/style.css +1 -0
- package/dist/modules/templates/badResponses.js +13 -13
- package/dist/modules/templates/richTextTemplates.js +14 -17
- package/dist/modules/templates/successResponses.js +4 -9
- package/dist/modules/utils/phoneInputUtilities.js +28 -18
- package/dist/modules/utils/richTextUtilities.js +75 -88
- package/dist/services/fieldTemplate.d.ts +1 -1
- package/dist/services/fieldTemplate.d.ts.map +1 -1
- package/dist/style.css +1 -0
- package/package.json +65 -65
- package/dist/components.css +0 -2
- package/dist/modules/components.css +0 -2
|
@@ -1,66 +1,83 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import {
|
|
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
|
-
|
|
1
|
+
import { jsx as l, jsxs as B } from "react/jsx-runtime";
|
|
2
|
+
import { useState as t } from "react";
|
|
3
|
+
import { useForm as D } from "../../hooks/useForm.js";
|
|
4
|
+
import { FieldTemplate as V } from "../../services/fieldTemplate.js";
|
|
5
|
+
import { HasFileContent as $ } from "./hasFileContent/index.js";
|
|
6
|
+
import { NoFileContent as q } from "./noFileContent/index.js";
|
|
7
|
+
/* empty css */
|
|
8
|
+
function _(p) {
|
|
9
|
+
const {
|
|
10
|
+
name: m,
|
|
11
|
+
defaultValue: c = "",
|
|
12
|
+
label: v,
|
|
13
|
+
showAsterisk: w = !1,
|
|
14
|
+
action: x,
|
|
15
|
+
fileName: y = "file",
|
|
16
|
+
className: E = "",
|
|
17
|
+
method: S = "POST",
|
|
18
|
+
acceptImage: f = "image/*",
|
|
19
|
+
fileResponseName: d = "url",
|
|
20
|
+
changeImageButtonText: T = "Alterar imagem",
|
|
21
|
+
selectImageButtonText: U = "Selecionar imagem",
|
|
22
|
+
dropImageText: b = "Ou arraste e solte a imagem aqui",
|
|
23
|
+
onChange: g,
|
|
24
|
+
disabled: r = !1,
|
|
25
|
+
unShowFieldTemplate: j = !1,
|
|
26
|
+
orientation: L = "vertical"
|
|
27
|
+
} = p, { fieldErrors: i } = D(), H = i == null ? void 0 : i[m], [O, P] = t(c), [R, n] = t(""), [h, k] = t(null), [o, A] = t(c), [u, I] = t(!1);
|
|
28
|
+
async function N(e) {
|
|
29
|
+
if (r) return;
|
|
30
|
+
I(!0), k(e), n("");
|
|
31
|
+
const C = new FormData();
|
|
32
|
+
C.append(y, e), await fetch(x, { method: S, body: C }).then(async (a) => await a.json()).then((a) => {
|
|
33
|
+
a != null && a.error ? n(a.error) : P(a == null ? void 0 : a[d]), g && g(a == null ? void 0 : a[d]);
|
|
34
|
+
}).catch((a) => {
|
|
35
|
+
console.error(a), n("Erro ao enviar imagem");
|
|
36
|
+
}).finally(() => I(!1));
|
|
37
|
+
}
|
|
38
|
+
function F(e) {
|
|
39
|
+
r || (A(URL.createObjectURL(e)), N(e));
|
|
40
|
+
}
|
|
41
|
+
const s = H || R;
|
|
42
|
+
return /* @__PURE__ */ l(
|
|
43
|
+
V,
|
|
44
|
+
{
|
|
45
|
+
name: m,
|
|
46
|
+
label: v,
|
|
47
|
+
showAsterisk: w,
|
|
48
|
+
className: E,
|
|
49
|
+
errorMessage: s,
|
|
50
|
+
unShowFieldTemplate: j,
|
|
51
|
+
orientation: L,
|
|
52
|
+
children: /* @__PURE__ */ B("div", { className: `arkynImageUpload ${s ? "hasError" : "noHasError"} ${o ? "hasImage" : "noHasImage"}`, children: [
|
|
53
|
+
/* @__PURE__ */ l("input", { type: "hidden", name: m, value: O || "" }),
|
|
54
|
+
!o && /* @__PURE__ */ l(
|
|
55
|
+
q,
|
|
56
|
+
{
|
|
57
|
+
disabled: r,
|
|
58
|
+
isLoading: u,
|
|
59
|
+
acceptImage: f,
|
|
60
|
+
dropImageText: b,
|
|
61
|
+
handleSelectFile: F,
|
|
62
|
+
selectImageButtonText: U
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
o && /* @__PURE__ */ l(
|
|
66
|
+
$,
|
|
67
|
+
{
|
|
68
|
+
disabled: r,
|
|
69
|
+
isLoading: u,
|
|
70
|
+
acceptImage: f,
|
|
71
|
+
filePath: o,
|
|
72
|
+
handleSelectFile: F,
|
|
73
|
+
changeImageButtonText: T,
|
|
74
|
+
reSendImage: s && h ? () => N(h) : void 0
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
] })
|
|
78
|
+
}
|
|
79
|
+
);
|
|
64
80
|
}
|
|
65
|
-
|
|
66
|
-
|
|
81
|
+
export {
|
|
82
|
+
_ as ImageUpload
|
|
83
|
+
};
|
|
@@ -1,36 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
1
|
+
import { jsxs as u, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { Button as g } from "../../button/index.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
function C(c) {
|
|
5
|
+
const {
|
|
6
|
+
dropImageText: l,
|
|
7
|
+
isLoading: s,
|
|
8
|
+
acceptImage: f,
|
|
9
|
+
handleSelectFile: i,
|
|
10
|
+
selectImageButtonText: p,
|
|
11
|
+
disabled: n
|
|
12
|
+
} = c;
|
|
13
|
+
function d(e) {
|
|
14
|
+
if (n) return;
|
|
15
|
+
e.preventDefault();
|
|
16
|
+
const t = e.dataTransfer.files[0];
|
|
17
|
+
t && i(t);
|
|
18
|
+
}
|
|
19
|
+
function m() {
|
|
20
|
+
if (n) return;
|
|
21
|
+
const e = document.createElement("input");
|
|
22
|
+
e.type = "file", e.accept = f, e.onchange = (t) => {
|
|
23
|
+
var r;
|
|
24
|
+
const o = (r = t.target.files) == null ? void 0 : r[0];
|
|
25
|
+
o && i(o);
|
|
26
|
+
}, e.click();
|
|
27
|
+
}
|
|
28
|
+
return /* @__PURE__ */ u("div", { onDrop: d, className: "arkynImageUploadNoFileContent", children: [
|
|
29
|
+
/* @__PURE__ */ a(
|
|
30
|
+
g,
|
|
31
|
+
{
|
|
32
|
+
isLoading: s,
|
|
33
|
+
onClick: m,
|
|
34
|
+
variant: "ghost",
|
|
35
|
+
size: "sm",
|
|
36
|
+
type: "button",
|
|
37
|
+
disabled: n,
|
|
38
|
+
children: p
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
/* @__PURE__ */ a("p", { children: l })
|
|
42
|
+
] });
|
|
34
43
|
}
|
|
35
|
-
|
|
36
|
-
|
|
44
|
+
export {
|
|
45
|
+
C as NoFileContent
|
|
46
|
+
};
|
|
@@ -1,93 +1,121 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
1
|
+
import { jsx as e, jsxs as Q } from "react/jsx-runtime";
|
|
2
|
+
import { Loader2 as N } from "lucide-react";
|
|
3
|
+
import { useState as U, useRef as V, useId as W } from "react";
|
|
4
|
+
import { useForm as X } from "../../hooks/useForm.js";
|
|
5
|
+
import { FieldTemplate as Y } from "../../services/fieldTemplate.js";
|
|
6
|
+
import { IconRenderer as i } from "../../services/iconRenderer.js";
|
|
7
|
+
/* empty css */
|
|
8
|
+
function ue($) {
|
|
9
|
+
const {
|
|
10
|
+
name: t,
|
|
11
|
+
disabled: d,
|
|
12
|
+
title: C,
|
|
13
|
+
style: k,
|
|
14
|
+
variant: v = "solid",
|
|
15
|
+
label: z,
|
|
16
|
+
className: P = "",
|
|
17
|
+
prefix: f,
|
|
18
|
+
suffix: u,
|
|
19
|
+
isLoading: s = !1,
|
|
20
|
+
leftIcon: B,
|
|
21
|
+
readOnly: p,
|
|
22
|
+
onFocus: m,
|
|
23
|
+
onBlur: h,
|
|
24
|
+
unShowFieldTemplate: L = !1,
|
|
25
|
+
errorMessage: M,
|
|
26
|
+
showAsterisk: j,
|
|
27
|
+
rightIcon: x,
|
|
28
|
+
type: y = "text",
|
|
29
|
+
size: S = "md",
|
|
30
|
+
id: O,
|
|
31
|
+
value: g,
|
|
32
|
+
placeholder: w,
|
|
33
|
+
orientation: R,
|
|
34
|
+
...b
|
|
35
|
+
} = $, { fieldErrors: c } = X(), [T, a] = U(!1), o = V(null), A = O || W(), F = M || (c == null ? void 0 : c[t]), D = !!F, r = d || s, n = { md: 20, lg: 20 }[S], I = x ? "right" : "left", E = I === "left" && s, q = I === "right" && s;
|
|
36
|
+
function G() {
|
|
37
|
+
r || !(o != null && o.current) || (a(!0), o.current.focus());
|
|
38
|
+
}
|
|
39
|
+
function H(l) {
|
|
40
|
+
a(!0), m && m(l);
|
|
41
|
+
}
|
|
42
|
+
function J(l) {
|
|
43
|
+
a(!1), h && h(l);
|
|
44
|
+
}
|
|
45
|
+
if (y === "hidden")
|
|
46
|
+
return /* @__PURE__ */ e(
|
|
47
|
+
"input",
|
|
48
|
+
{
|
|
49
|
+
style: { display: "none" },
|
|
50
|
+
readOnly: !0,
|
|
51
|
+
type: "text",
|
|
52
|
+
ref: o,
|
|
53
|
+
...b
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
const K = `arkynInput ${f ? "hasPrefix" : ""} ${d ? "disabled" : ""} ${u ? "hasSuffix" : ""} ${v} ${S} ${r || p || s ? "opacity" : ""} ${D ? "errored" : ""} ${T ? "focused" : ""}`;
|
|
57
|
+
return /* @__PURE__ */ e(
|
|
58
|
+
Y,
|
|
59
|
+
{
|
|
60
|
+
name: t,
|
|
61
|
+
label: z,
|
|
62
|
+
showAsterisk: j,
|
|
63
|
+
className: P,
|
|
64
|
+
errorMessage: F,
|
|
65
|
+
unShowFieldTemplate: L,
|
|
66
|
+
orientation: R,
|
|
67
|
+
children: /* @__PURE__ */ Q(
|
|
68
|
+
"section",
|
|
69
|
+
{
|
|
70
|
+
title: C,
|
|
71
|
+
style: k,
|
|
72
|
+
onClick: G,
|
|
73
|
+
className: K,
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ e(i, { iconSize: n, icon: f, className: "prefix" }),
|
|
76
|
+
/* @__PURE__ */ e(
|
|
77
|
+
i,
|
|
78
|
+
{
|
|
79
|
+
show: E,
|
|
80
|
+
iconSize: n,
|
|
81
|
+
className: "spinner",
|
|
82
|
+
icon: N
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
/* @__PURE__ */ e(i, { show: !s, icon: B, iconSize: n }),
|
|
86
|
+
/* @__PURE__ */ e(
|
|
87
|
+
"input",
|
|
88
|
+
{
|
|
89
|
+
disabled: r,
|
|
90
|
+
readOnly: p,
|
|
91
|
+
ref: o,
|
|
92
|
+
onFocus: H,
|
|
93
|
+
onBlur: J,
|
|
94
|
+
type: y,
|
|
95
|
+
id: A,
|
|
96
|
+
name: t,
|
|
97
|
+
placeholder: r && g || w,
|
|
98
|
+
value: r ? void 0 : g,
|
|
99
|
+
...b
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
/* @__PURE__ */ e(i, { show: !s, icon: x, iconSize: n }),
|
|
103
|
+
/* @__PURE__ */ e(
|
|
104
|
+
i,
|
|
105
|
+
{
|
|
106
|
+
show: q,
|
|
107
|
+
iconSize: n,
|
|
108
|
+
className: "spinner",
|
|
109
|
+
icon: N
|
|
110
|
+
}
|
|
111
|
+
),
|
|
112
|
+
/* @__PURE__ */ e(i, { iconSize: n, icon: u, className: "suffix" })
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
);
|
|
91
118
|
}
|
|
92
|
-
|
|
93
|
-
|
|
119
|
+
export {
|
|
120
|
+
ue as Input
|
|
121
|
+
};
|
|
@@ -1,29 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return /* @__PURE__ */ n("div", {
|
|
9
|
-
className: "arkynMapViewPinnedEmpty " + e,
|
|
10
|
-
children: /* @__PURE__ */ n(r, {})
|
|
11
|
-
});
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { MapPinned as p } from "lucide-react";
|
|
3
|
+
import { ClientMapView as s } from "./mapView.client.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { ClientOnly as l } from "../clientOnly.js";
|
|
6
|
+
function t({ className: e }) {
|
|
7
|
+
return /* @__PURE__ */ r("div", { className: "arkynMapViewPinnedEmpty " + e, children: /* @__PURE__ */ r(p, {}) });
|
|
12
8
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
9
|
+
function h(e) {
|
|
10
|
+
const {
|
|
11
|
+
coordinates: n,
|
|
12
|
+
zoom: f = 18,
|
|
13
|
+
accessToken: a,
|
|
14
|
+
className: o,
|
|
15
|
+
onMarkerClick: c,
|
|
16
|
+
...m
|
|
17
|
+
} = e;
|
|
18
|
+
if (!n) return /* @__PURE__ */ r(t, { className: o });
|
|
19
|
+
const i = Array.isArray(n) ? n : [n];
|
|
20
|
+
return i.length === 0 ? /* @__PURE__ */ r(t, { className: o }) : /* @__PURE__ */ r(l, { fallback: /* @__PURE__ */ r(t, { className: o }), children: () => /* @__PURE__ */ r(
|
|
21
|
+
s,
|
|
22
|
+
{
|
|
23
|
+
accessToken: a,
|
|
24
|
+
coordinates: i,
|
|
25
|
+
center: i[0],
|
|
26
|
+
onMarkerClick: c,
|
|
27
|
+
...m
|
|
28
|
+
}
|
|
29
|
+
) });
|
|
27
30
|
}
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
export {
|
|
32
|
+
h as MapView
|
|
33
|
+
};
|
|
@@ -1,50 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
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
|
-
|
|
1
|
+
import { jsx as x } from "react/jsx-runtime";
|
|
2
|
+
import n from "mapbox-gl";
|
|
3
|
+
import { createRoot as y } from "react-dom/client";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { useRef as g, useEffect as R } from "react";
|
|
6
|
+
function B({
|
|
7
|
+
center: r,
|
|
8
|
+
coordinates: c,
|
|
9
|
+
onMarkerClick: p,
|
|
10
|
+
accessToken: d,
|
|
11
|
+
...h
|
|
12
|
+
}) {
|
|
13
|
+
const t = g(null), a = g(null), s = r || c[0];
|
|
14
|
+
return R(() => (n.accessToken = d, t.current = new n.Map({
|
|
15
|
+
container: a.current,
|
|
16
|
+
style: "mapbox://styles/mapbox/light-v11",
|
|
17
|
+
center: [s.lng, s.lat],
|
|
18
|
+
zoom: 13,
|
|
19
|
+
language: "pt-BR"
|
|
20
|
+
}), c.forEach((e) => {
|
|
21
|
+
const { lat: m, lng: i, popUp: l } = e, o = document.createElement("img");
|
|
22
|
+
o.className = "arkynMarker", o.src = "https://i.postimg.cc/mgKggjk7/Pin.png";
|
|
23
|
+
const u = new n.Marker(o).setLngLat([i, m]).addTo(t.current);
|
|
24
|
+
if (l) {
|
|
25
|
+
const f = document.createElement("div");
|
|
26
|
+
y(f).render(l);
|
|
27
|
+
const k = new n.Popup({
|
|
28
|
+
offset: 25,
|
|
29
|
+
closeButton: !1,
|
|
30
|
+
className: "arkynMapViewPopup"
|
|
31
|
+
}).setDOMContent(f);
|
|
32
|
+
u.setPopup(k);
|
|
33
|
+
}
|
|
34
|
+
o.addEventListener("click", () => {
|
|
35
|
+
p && p(e), t.current.flyTo({ center: [i, m], zoom: 15, duration: 1200 }), u.togglePopup();
|
|
36
|
+
});
|
|
37
|
+
}), () => {
|
|
38
|
+
var e;
|
|
39
|
+
(e = t.current) == null || e.remove();
|
|
40
|
+
}), []), /* @__PURE__ */ x(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
id: "map-container",
|
|
44
|
+
ref: a,
|
|
45
|
+
style: { height: "100%", width: "100%", borderRadius: "8px" },
|
|
46
|
+
...h
|
|
47
|
+
}
|
|
48
|
+
);
|
|
48
49
|
}
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
export {
|
|
51
|
+
B as ClientMapView
|
|
52
|
+
};
|