@arkyn/components 3.0.1-beta.156 → 3.0.1-beta.157
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 +3 -3
|
@@ -1,83 +1,66 @@
|
|
|
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
|
-
|
|
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
|
-
);
|
|
1
|
+
import { useForm as e } from "../../hooks/useForm.js";
|
|
2
|
+
import { FieldTemplate as t } from "../../services/fieldTemplate.js";
|
|
3
|
+
import { HasFileContent as n } from "./hasFileContent/index.js";
|
|
4
|
+
import { NoFileContent as r } from "./noFileContent/index.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import { useState as i } from "react";
|
|
7
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/imageUpload/index.tsx
|
|
9
|
+
function s(s) {
|
|
10
|
+
let { name: c, defaultValue: l = "", label: u, showAsterisk: d = !1, action: f, fileName: p = "file", className: m = "", method: h = "POST", acceptImage: g = "image/*", fileResponseName: _ = "url", changeImageButtonText: v = "Alterar imagem", selectImageButtonText: y = "Selecionar imagem", dropImageText: b = "Ou arraste e solte a imagem aqui", onChange: x, disabled: S = !1, unShowFieldTemplate: C = !1, orientation: w = "vertical" } = s, { fieldErrors: T } = e(), E = T?.[c], [D, O] = i(l), [k, A] = i(""), [j, M] = i(null), [N, P] = i(l), [F, I] = i(!1);
|
|
11
|
+
async function L(e) {
|
|
12
|
+
if (S) return;
|
|
13
|
+
I(!0), M(e), A("");
|
|
14
|
+
let t = new FormData();
|
|
15
|
+
t.append(p, e), await fetch(f, {
|
|
16
|
+
method: h,
|
|
17
|
+
body: t
|
|
18
|
+
}).then(async (e) => await e.json()).then((e) => {
|
|
19
|
+
e?.error ? A(e.error) : O(e?.[_]), x && x(e?.[_]);
|
|
20
|
+
}).catch((e) => {
|
|
21
|
+
console.error(e), A("Erro ao enviar imagem");
|
|
22
|
+
}).finally(() => I(!1));
|
|
23
|
+
}
|
|
24
|
+
function R(e) {
|
|
25
|
+
S || (P(URL.createObjectURL(e)), L(e));
|
|
26
|
+
}
|
|
27
|
+
let z = E || k;
|
|
28
|
+
return /* @__PURE__ */ a(t, {
|
|
29
|
+
name: c,
|
|
30
|
+
label: u,
|
|
31
|
+
showAsterisk: d,
|
|
32
|
+
className: m,
|
|
33
|
+
errorMessage: z,
|
|
34
|
+
unShowFieldTemplate: C,
|
|
35
|
+
orientation: w,
|
|
36
|
+
children: /* @__PURE__ */ o("div", {
|
|
37
|
+
className: `arkynImageUpload ${z ? "hasError" : "noHasError"} ${N ? "hasImage" : "noHasImage"}`,
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ a("input", {
|
|
40
|
+
type: "hidden",
|
|
41
|
+
name: c,
|
|
42
|
+
value: D || ""
|
|
43
|
+
}),
|
|
44
|
+
!N && /* @__PURE__ */ a(r, {
|
|
45
|
+
disabled: S,
|
|
46
|
+
isLoading: F,
|
|
47
|
+
acceptImage: g,
|
|
48
|
+
dropImageText: b,
|
|
49
|
+
handleSelectFile: R,
|
|
50
|
+
selectImageButtonText: y
|
|
51
|
+
}),
|
|
52
|
+
N && /* @__PURE__ */ a(n, {
|
|
53
|
+
disabled: S,
|
|
54
|
+
isLoading: F,
|
|
55
|
+
acceptImage: g,
|
|
56
|
+
filePath: N,
|
|
57
|
+
handleSelectFile: R,
|
|
58
|
+
changeImageButtonText: v,
|
|
59
|
+
reSendImage: z && j ? () => L(j) : void 0
|
|
60
|
+
})
|
|
61
|
+
]
|
|
62
|
+
})
|
|
63
|
+
});
|
|
80
64
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
};
|
|
65
|
+
//#endregion
|
|
66
|
+
export { s as ImageUpload };
|
|
@@ -1,46 +1,36 @@
|
|
|
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
|
-
|
|
34
|
-
variant: "ghost",
|
|
35
|
-
size: "sm",
|
|
36
|
-
type: "button",
|
|
37
|
-
disabled: n,
|
|
38
|
-
children: p
|
|
39
|
-
}
|
|
40
|
-
),
|
|
41
|
-
/* @__PURE__ */ a("p", { children: l })
|
|
42
|
-
] });
|
|
1
|
+
import { Button as e } from "../../button/index.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/imageUpload/noFileContent/index.tsx
|
|
5
|
+
function r(r) {
|
|
6
|
+
let { dropImageText: i, isLoading: a, acceptImage: o, handleSelectFile: s, selectImageButtonText: c, disabled: l } = r;
|
|
7
|
+
function u(e) {
|
|
8
|
+
if (l) return;
|
|
9
|
+
e.preventDefault();
|
|
10
|
+
let t = e.dataTransfer.files[0];
|
|
11
|
+
t && s(t);
|
|
12
|
+
}
|
|
13
|
+
function d() {
|
|
14
|
+
if (l) return;
|
|
15
|
+
let e = document.createElement("input");
|
|
16
|
+
e.type = "file", e.accept = o, e.onchange = (e) => {
|
|
17
|
+
let t = e.target.files?.[0];
|
|
18
|
+
t && s(t);
|
|
19
|
+
}, e.click();
|
|
20
|
+
}
|
|
21
|
+
return /* @__PURE__ */ n("div", {
|
|
22
|
+
onDrop: u,
|
|
23
|
+
className: "arkynImageUploadNoFileContent",
|
|
24
|
+
children: [/* @__PURE__ */ t(e, {
|
|
25
|
+
isLoading: a,
|
|
26
|
+
onClick: d,
|
|
27
|
+
variant: "ghost",
|
|
28
|
+
size: "sm",
|
|
29
|
+
type: "button",
|
|
30
|
+
disabled: l,
|
|
31
|
+
children: c
|
|
32
|
+
}), /* @__PURE__ */ t("p", { children: i })]
|
|
33
|
+
});
|
|
43
34
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
};
|
|
35
|
+
//#endregion
|
|
36
|
+
export { r as NoFileContent };
|
|
@@ -1,121 +1,93 @@
|
|
|
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
|
-
|
|
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
|
-
);
|
|
1
|
+
import { useForm as e } from "../../hooks/useForm.js";
|
|
2
|
+
import { IconRenderer as t } from "../../services/iconRenderer.js";
|
|
3
|
+
import { FieldTemplate as n } from "../../services/fieldTemplate.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { useId as r, useRef as i, useState as a } from "react";
|
|
6
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
|
+
import { Loader2 as c } from "lucide-react";
|
|
8
|
+
//#region src/components/input/index.tsx
|
|
9
|
+
function l(l) {
|
|
10
|
+
let { name: u, disabled: d, title: f, style: p, variant: m = "solid", label: h, className: g = "", prefix: _, suffix: v, isLoading: y = !1, leftIcon: b, readOnly: x, onFocus: S, onBlur: C, unShowFieldTemplate: w = !1, errorMessage: T, showAsterisk: E, rightIcon: D, type: O = "text", size: k = "md", id: A, value: j, placeholder: M, orientation: N, ...P } = l, { fieldErrors: F } = e(), [I, L] = a(!1), R = i(null), z = A || r(), B = T || F?.[u], V = !!B, H = d || y, U = {
|
|
11
|
+
md: 20,
|
|
12
|
+
lg: 20
|
|
13
|
+
}[k], W = D ? "right" : "left", G = W === "left" && y, K = W === "right" && y;
|
|
14
|
+
function q() {
|
|
15
|
+
H || !R?.current || (L(!0), R.current.focus());
|
|
16
|
+
}
|
|
17
|
+
function J(e) {
|
|
18
|
+
L(!0), S && S(e);
|
|
19
|
+
}
|
|
20
|
+
function Y(e) {
|
|
21
|
+
L(!1), C && C(e);
|
|
22
|
+
}
|
|
23
|
+
return O === "hidden" ? /* @__PURE__ */ o("input", {
|
|
24
|
+
style: { display: "none" },
|
|
25
|
+
readOnly: !0,
|
|
26
|
+
type: "text",
|
|
27
|
+
ref: R,
|
|
28
|
+
...P
|
|
29
|
+
}) : /* @__PURE__ */ o(n, {
|
|
30
|
+
name: u,
|
|
31
|
+
label: h,
|
|
32
|
+
showAsterisk: E,
|
|
33
|
+
className: g,
|
|
34
|
+
errorMessage: B,
|
|
35
|
+
unShowFieldTemplate: w,
|
|
36
|
+
orientation: N,
|
|
37
|
+
children: /* @__PURE__ */ s("section", {
|
|
38
|
+
title: f,
|
|
39
|
+
style: p,
|
|
40
|
+
onClick: q,
|
|
41
|
+
className: `arkynInput ${_ ? "hasPrefix" : ""} ${d ? "disabled" : ""} ${v ? "hasSuffix" : ""} ${m} ${k} ${H || x || y ? "opacity" : ""} ${V ? "errored" : ""} ${I ? "focused" : ""}`,
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ o(t, {
|
|
44
|
+
iconSize: U,
|
|
45
|
+
icon: _,
|
|
46
|
+
className: "prefix"
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ o(t, {
|
|
49
|
+
show: G,
|
|
50
|
+
iconSize: U,
|
|
51
|
+
className: "spinner",
|
|
52
|
+
icon: c
|
|
53
|
+
}),
|
|
54
|
+
/* @__PURE__ */ o(t, {
|
|
55
|
+
show: !y,
|
|
56
|
+
icon: b,
|
|
57
|
+
iconSize: U
|
|
58
|
+
}),
|
|
59
|
+
/* @__PURE__ */ o("input", {
|
|
60
|
+
disabled: H,
|
|
61
|
+
readOnly: x,
|
|
62
|
+
ref: R,
|
|
63
|
+
onFocus: J,
|
|
64
|
+
onBlur: Y,
|
|
65
|
+
type: O,
|
|
66
|
+
id: z,
|
|
67
|
+
name: u,
|
|
68
|
+
placeholder: H && j || M,
|
|
69
|
+
value: H ? void 0 : j,
|
|
70
|
+
...P
|
|
71
|
+
}),
|
|
72
|
+
/* @__PURE__ */ o(t, {
|
|
73
|
+
show: !y,
|
|
74
|
+
icon: D,
|
|
75
|
+
iconSize: U
|
|
76
|
+
}),
|
|
77
|
+
/* @__PURE__ */ o(t, {
|
|
78
|
+
show: K,
|
|
79
|
+
iconSize: U,
|
|
80
|
+
className: "spinner",
|
|
81
|
+
icon: c
|
|
82
|
+
}),
|
|
83
|
+
/* @__PURE__ */ o(t, {
|
|
84
|
+
iconSize: U,
|
|
85
|
+
icon: v,
|
|
86
|
+
className: "suffix"
|
|
87
|
+
})
|
|
88
|
+
]
|
|
89
|
+
})
|
|
90
|
+
});
|
|
118
91
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
};
|
|
92
|
+
//#endregion
|
|
93
|
+
export { l as Input };
|
|
@@ -1,33 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { ClientOnly as e } from "../clientOnly.js";
|
|
2
|
+
import { ClientMapView as t } from "./mapView.client.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
import { MapPinned as r } from "lucide-react";
|
|
6
|
+
//#region src/components/mapView/index.tsx
|
|
7
|
+
function i({ className: e }) {
|
|
8
|
+
return /* @__PURE__ */ n("div", {
|
|
9
|
+
className: "arkynMapViewPinnedEmpty " + e,
|
|
10
|
+
children: /* @__PURE__ */ n(r, {})
|
|
11
|
+
});
|
|
8
12
|
}
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
accessToken: a,
|
|
24
|
-
coordinates: i,
|
|
25
|
-
center: i[0],
|
|
26
|
-
onMarkerClick: c,
|
|
27
|
-
...m
|
|
28
|
-
}
|
|
29
|
-
) });
|
|
13
|
+
function a(r) {
|
|
14
|
+
let { coordinates: a, zoom: o = 18, accessToken: s, className: c, onMarkerClick: l, ...u } = r;
|
|
15
|
+
if (!a) return /* @__PURE__ */ n(i, { className: c });
|
|
16
|
+
let d = Array.isArray(a) ? a : [a];
|
|
17
|
+
return d.length === 0 ? /* @__PURE__ */ n(i, { className: c }) : /* @__PURE__ */ n(e, {
|
|
18
|
+
fallback: /* @__PURE__ */ n(i, { className: c }),
|
|
19
|
+
children: () => /* @__PURE__ */ n(t, {
|
|
20
|
+
accessToken: s,
|
|
21
|
+
coordinates: d,
|
|
22
|
+
center: d[0],
|
|
23
|
+
onMarkerClick: l,
|
|
24
|
+
...u
|
|
25
|
+
})
|
|
26
|
+
});
|
|
30
27
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { a as MapView };
|
|
@@ -1,52 +1,50 @@
|
|
|
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
|
-
|
|
48
|
-
);
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { useEffect as e, useRef as t } from "react";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
import r from "mapbox-gl";
|
|
5
|
+
import { createRoot as i } from "react-dom/client";
|
|
6
|
+
//#region src/components/mapView/mapView.client.tsx
|
|
7
|
+
function a({ center: a, coordinates: o, onMarkerClick: s, accessToken: c, ...l }) {
|
|
8
|
+
let u = t(null), d = t(null), f = a || o[0];
|
|
9
|
+
return e(() => (r.accessToken = c, u.current = new r.Map({
|
|
10
|
+
container: d.current,
|
|
11
|
+
style: "mapbox://styles/mapbox/light-v11",
|
|
12
|
+
center: [f.lng, f.lat],
|
|
13
|
+
zoom: 13,
|
|
14
|
+
language: "pt-BR"
|
|
15
|
+
}), o.forEach((e) => {
|
|
16
|
+
let { lat: t, lng: n, popUp: a } = e, o = document.createElement("img");
|
|
17
|
+
o.className = "arkynMarker", o.src = "https://i.postimg.cc/mgKggjk7/Pin.png";
|
|
18
|
+
let c = new r.Marker(o).setLngLat([n, t]).addTo(u.current);
|
|
19
|
+
if (a) {
|
|
20
|
+
let e = document.createElement("div");
|
|
21
|
+
i(e).render(a);
|
|
22
|
+
let t = new r.Popup({
|
|
23
|
+
offset: 25,
|
|
24
|
+
closeButton: !1,
|
|
25
|
+
className: "arkynMapViewPopup"
|
|
26
|
+
}).setDOMContent(e);
|
|
27
|
+
c.setPopup(t);
|
|
28
|
+
}
|
|
29
|
+
o.addEventListener("click", () => {
|
|
30
|
+
s && s(e), u.current.flyTo({
|
|
31
|
+
center: [n, t],
|
|
32
|
+
zoom: 15,
|
|
33
|
+
duration: 1200
|
|
34
|
+
}), c.togglePopup();
|
|
35
|
+
});
|
|
36
|
+
}), () => {
|
|
37
|
+
u.current?.remove();
|
|
38
|
+
}), []), /* @__PURE__ */ n("div", {
|
|
39
|
+
id: "map-container",
|
|
40
|
+
ref: d,
|
|
41
|
+
style: {
|
|
42
|
+
height: "100%",
|
|
43
|
+
width: "100%",
|
|
44
|
+
borderRadius: "8px"
|
|
45
|
+
},
|
|
46
|
+
...l
|
|
47
|
+
});
|
|
49
48
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
};
|
|
49
|
+
//#endregion
|
|
50
|
+
export { a as ClientMapView };
|