@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,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: u
|
|
39
|
-
}
|
|
40
|
-
),
|
|
41
|
-
/* @__PURE__ */ r("p", { children: a })
|
|
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/audioUpload/noFileContent/index.tsx
|
|
5
|
+
function r(r) {
|
|
6
|
+
let { dropAudioText: i, isLoading: a, acceptAudio: o, handleSelectFile: s, selectAudioButtonText: 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: "arkynAudioUploadNoFileContent",
|
|
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,23 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { IconRenderer as e } from "../../services/iconRenderer.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/badge/index.tsx
|
|
5
|
+
function r(r) {
|
|
6
|
+
let { variant: i = "ghost", scheme: a = "primary", size: o = "lg", leftIcon: s, rightIcon: c, className: l = "", children: u, ...d } = r, f = {
|
|
7
|
+
md: 12,
|
|
8
|
+
lg: 14
|
|
9
|
+
}[o];
|
|
10
|
+
return /* @__PURE__ */ n("div", {
|
|
11
|
+
className: `arkynBadge ${i} ${a} ${o} ${l}`.trim(),
|
|
12
|
+
...d,
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ t(e, {
|
|
15
|
+
iconSize: f,
|
|
16
|
+
icon: s
|
|
17
|
+
}),
|
|
18
|
+
/* @__PURE__ */ t("p", { children: u }),
|
|
19
|
+
/* @__PURE__ */ t(e, {
|
|
20
|
+
iconSize: f,
|
|
21
|
+
icon: c
|
|
22
|
+
})
|
|
23
|
+
]
|
|
24
|
+
});
|
|
20
25
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { r as Badge };
|
|
@@ -1,33 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
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
|
-
|
|
1
|
+
import { IconRenderer as e } from "../../services/iconRenderer.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
import { Loader2 as r } from "lucide-react";
|
|
5
|
+
//#region src/components/button/index.tsx
|
|
6
|
+
function i(i) {
|
|
7
|
+
let { isLoading: a = !1, scheme: o = "primary", variant: s = "solid", loadingText: c, size: l = "md", leftIcon: u, rightIcon: d, disabled: f, className: p = "", children: m, ...h } = i, g = {
|
|
8
|
+
xs: 12,
|
|
9
|
+
sm: 16,
|
|
10
|
+
md: 20,
|
|
11
|
+
lg: 24
|
|
12
|
+
}[l];
|
|
13
|
+
return /* @__PURE__ */ n("button", {
|
|
14
|
+
className: `arkynButton ${a ? "loadingTrue" : "loadingFalse"} ${s} ${o} ${l} ${c ? "loadingTextTrue" : "loadingTextFalse"} ${p}`,
|
|
15
|
+
disabled: f || a,
|
|
16
|
+
...h,
|
|
17
|
+
children: [/* @__PURE__ */ n("div", {
|
|
18
|
+
className: "arkynButtonSpinner",
|
|
19
|
+
children: [/* @__PURE__ */ t(r, {
|
|
20
|
+
size: g,
|
|
21
|
+
strokeWidth: 2.5
|
|
22
|
+
}), c && c]
|
|
23
|
+
}), /* @__PURE__ */ n("div", {
|
|
24
|
+
className: "arkynButtonContent",
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ t(e, {
|
|
27
|
+
iconSize: g,
|
|
28
|
+
icon: u
|
|
29
|
+
}),
|
|
30
|
+
m,
|
|
31
|
+
/* @__PURE__ */ t(e, {
|
|
32
|
+
iconSize: g,
|
|
33
|
+
icon: d
|
|
34
|
+
})
|
|
35
|
+
]
|
|
36
|
+
})]
|
|
37
|
+
});
|
|
30
38
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
39
|
+
//#endregion
|
|
40
|
+
export { i as Button };
|
|
@@ -1,65 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { ViewService as e } from "./_viewService.js";
|
|
2
|
+
import { createContext as t, useContext as n, useState as r } from "react";
|
|
3
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/calendar/_calendarProvider.tsx
|
|
5
|
+
var a = t({});
|
|
6
|
+
function o() {
|
|
7
|
+
return n(a);
|
|
7
8
|
}
|
|
8
|
-
function
|
|
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
|
-
currentDay: e.currentDay(t),
|
|
38
|
-
currentMonth: e.currentMonth(t),
|
|
39
|
-
currentYear: e.currentYear(t),
|
|
40
|
-
listWeek: e.listWeek(c),
|
|
41
|
-
listMonths: e.listMonths(t, c),
|
|
42
|
-
listYears: e.listYears(100),
|
|
43
|
-
listMatrix: e.listMatrix(t, s),
|
|
44
|
-
changeDay: (a, i, S) => e.changeDay(
|
|
45
|
-
a,
|
|
46
|
-
i,
|
|
47
|
-
S,
|
|
48
|
-
n,
|
|
49
|
-
s,
|
|
50
|
-
m,
|
|
51
|
-
r
|
|
52
|
-
),
|
|
53
|
-
changeMonth: (a) => e.changeMonth(a, t, r),
|
|
54
|
-
changeYear: (a) => e.changeYear(a, t, r),
|
|
55
|
-
nextMonth: () => e.nextMonth(t, r),
|
|
56
|
-
previousMonth: () => e.previousMonth(t, r)
|
|
57
|
-
},
|
|
58
|
-
children: V
|
|
59
|
-
}
|
|
60
|
-
);
|
|
9
|
+
function s(t) {
|
|
10
|
+
let { calendarType: n, children: o, defaultValue: s, defaultViewValue: c = /* @__PURE__ */ new Date(), language: l = "pt-BR", onChange: u, onChangeView: d, value: f, viewValue: p } = t, m = n === "single" ? [s || /* @__PURE__ */ new Date(), s || /* @__PURE__ */ new Date()] : s || [/* @__PURE__ */ new Date(), /* @__PURE__ */ new Date()], [h, g] = r(c), [_, v] = r(m), y = p || h, b = f ? n === "single" ? [f, f] : f : _, x = new e();
|
|
11
|
+
function S(e) {
|
|
12
|
+
let t = [new Date(e[0]), new Date(e[1])];
|
|
13
|
+
u && n === "range" && u(t), u && n === "single" && u(t[0]), v(t);
|
|
14
|
+
}
|
|
15
|
+
function C(e) {
|
|
16
|
+
d && d(e), g(e);
|
|
17
|
+
}
|
|
18
|
+
return /* @__PURE__ */ i(a.Provider, {
|
|
19
|
+
value: {
|
|
20
|
+
valueDate: b,
|
|
21
|
+
viewDate: y,
|
|
22
|
+
currentDate: y.toLocaleDateString(l).slice(3),
|
|
23
|
+
currentDay: x.currentDay(y),
|
|
24
|
+
currentMonth: x.currentMonth(y),
|
|
25
|
+
currentYear: x.currentYear(y),
|
|
26
|
+
listWeek: x.listWeek(l),
|
|
27
|
+
listMonths: x.listMonths(y, l),
|
|
28
|
+
listYears: x.listYears(100),
|
|
29
|
+
listMatrix: x.listMatrix(y, b),
|
|
30
|
+
changeDay: (e, t, r) => x.changeDay(e, t, r, n, b, S, C),
|
|
31
|
+
changeMonth: (e) => x.changeMonth(e, y, C),
|
|
32
|
+
changeYear: (e) => x.changeYear(e, y, C),
|
|
33
|
+
nextMonth: () => x.nextMonth(y, C),
|
|
34
|
+
previousMonth: () => x.previousMonth(y, C)
|
|
35
|
+
},
|
|
36
|
+
children: o
|
|
37
|
+
});
|
|
61
38
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
B as useCalendar
|
|
65
|
-
};
|
|
39
|
+
//#endregion
|
|
40
|
+
export { s as CalendarProvider, o as useCalendar };
|
|
@@ -1,141 +1,133 @@
|
|
|
1
|
-
import { formatToCapitalizeFirstWordLetter as
|
|
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
|
-
|
|
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
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
const t = new Date(n);
|
|
132
|
-
t.setDate(1), t.setMonth(t.getMonth() + 1), r(t);
|
|
133
|
-
}
|
|
134
|
-
previousMonth(n, r) {
|
|
135
|
-
const t = new Date(n);
|
|
136
|
-
t.setDate(1), t.setMonth(t.getMonth() - 1), r(t);
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
export {
|
|
140
|
-
p as ViewService
|
|
1
|
+
import { formatToCapitalizeFirstWordLetter as e } from "@arkyn/shared";
|
|
2
|
+
//#region src/components/calendar/_viewService.ts
|
|
3
|
+
var t = class {
|
|
4
|
+
currentDay(e) {
|
|
5
|
+
return String(e.getDate()).padStart(2, "0");
|
|
6
|
+
}
|
|
7
|
+
currentMonth(e) {
|
|
8
|
+
return String(e.getMonth() + 1).padStart(2, "0");
|
|
9
|
+
}
|
|
10
|
+
currentYear(e) {
|
|
11
|
+
return String(e.getFullYear());
|
|
12
|
+
}
|
|
13
|
+
capitalize(t) {
|
|
14
|
+
return e(t);
|
|
15
|
+
}
|
|
16
|
+
parseDayType(e, t, n, r) {
|
|
17
|
+
let i = r[0].getDate(), a = r[0].getMonth(), o = r[0].getFullYear(), s = r[1].getDate(), c = r[1].getMonth(), l = r[1].getFullYear(), u = new Date(o, a, i), d = new Date(l, c, s), f = new Date(n, t, e);
|
|
18
|
+
return u.getTime() === f.getTime() || d.getTime() === f.getTime() ? "checkedDay" : f > u && f < d ? "middleDay" : "uncheckedDay";
|
|
19
|
+
}
|
|
20
|
+
listWeek(e) {
|
|
21
|
+
let t = [], n = new Date(Date.UTC(2023, 0, 1));
|
|
22
|
+
for (let r = 0; r < 7; r++) {
|
|
23
|
+
let i = new Date(n);
|
|
24
|
+
i.setUTCDate(n.getUTCDate() + r);
|
|
25
|
+
let a = i.toLocaleDateString(e, {
|
|
26
|
+
weekday: "short",
|
|
27
|
+
timeZone: "UTC"
|
|
28
|
+
});
|
|
29
|
+
t.push(a);
|
|
30
|
+
}
|
|
31
|
+
return t;
|
|
32
|
+
}
|
|
33
|
+
listMonths(e, t) {
|
|
34
|
+
let n = new Intl.DateTimeFormat(t, { month: "long" });
|
|
35
|
+
return Array.from({ length: 12 }, (t, r) => {
|
|
36
|
+
let i = new Date(e.getFullYear(), r, 1), a = n.format(i);
|
|
37
|
+
return {
|
|
38
|
+
label: this.capitalize(a),
|
|
39
|
+
value: String(r).padStart(2, "0")
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
listYears(e) {
|
|
44
|
+
let t = (/* @__PURE__ */ new Date()).getFullYear();
|
|
45
|
+
return Array.from({ length: e + 1 }, (n, r) => {
|
|
46
|
+
let i = t - e + r;
|
|
47
|
+
return {
|
|
48
|
+
label: String(i),
|
|
49
|
+
value: String(i)
|
|
50
|
+
};
|
|
51
|
+
}).reverse();
|
|
52
|
+
}
|
|
53
|
+
listMatrix(e, t) {
|
|
54
|
+
let n = e.getFullYear(), r = e.getMonth(), i = new Date(n, r, 1).getDay(), a = new Date(n, r + 1, 0).getDate(), o = new Date(n, r, 0).getDate(), s = Math.ceil((i + a) / 7) * 7, c = [], l = 1, u = 1;
|
|
55
|
+
for (let e = 0; e < s; e++) {
|
|
56
|
+
let s = Math.floor(e / 7);
|
|
57
|
+
if (c[s] || (c[s] = []), e < i) {
|
|
58
|
+
let a = o - (i - e - 1), l = r === 0 ? 11 : r - 1, u = r === 0 ? n - 1 : n;
|
|
59
|
+
c[s].push({
|
|
60
|
+
day: a,
|
|
61
|
+
month: l,
|
|
62
|
+
year: u,
|
|
63
|
+
dayOwner: "previous",
|
|
64
|
+
dayType: this.parseDayType(a, l, u, t)
|
|
65
|
+
});
|
|
66
|
+
} else if (l <= a) c[s].push({
|
|
67
|
+
day: l,
|
|
68
|
+
month: r,
|
|
69
|
+
year: n,
|
|
70
|
+
dayOwner: "current",
|
|
71
|
+
dayType: this.parseDayType(l, r, n, t)
|
|
72
|
+
}), l++;
|
|
73
|
+
else {
|
|
74
|
+
let e = r === 11 ? 0 : r + 1, i = r === 11 ? n + 1 : n;
|
|
75
|
+
c[s].push({
|
|
76
|
+
day: u,
|
|
77
|
+
month: e,
|
|
78
|
+
year: i,
|
|
79
|
+
dayOwner: "next",
|
|
80
|
+
dayType: this.parseDayType(u, e, i, t)
|
|
81
|
+
}), u++;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return c;
|
|
85
|
+
}
|
|
86
|
+
changeDay(e, t, n, r, i, a, o) {
|
|
87
|
+
let s = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), c = s(new Date(n, t, e));
|
|
88
|
+
if (o(c), r === "single") {
|
|
89
|
+
a([c, c]);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
let l = s(i[0]), u = s(i[1]), d = c.getTime(), f = l.getTime(), p = u.getTime();
|
|
93
|
+
if (d === f) {
|
|
94
|
+
a([c, c]);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (d === p) {
|
|
98
|
+
a([c, c]);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (c < l) {
|
|
102
|
+
a([c, u]);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (c > u) {
|
|
106
|
+
a([l, c]);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if (Math.abs(d - f) <= Math.abs(p - d)) {
|
|
110
|
+
a([c, u]);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
a([l, c]);
|
|
114
|
+
}
|
|
115
|
+
changeMonth(e, t, n) {
|
|
116
|
+
let r = new Date(t);
|
|
117
|
+
r.setMonth(e), n(r);
|
|
118
|
+
}
|
|
119
|
+
changeYear(e, t, n) {
|
|
120
|
+
let r = new Date(t);
|
|
121
|
+
r.setFullYear(e), n(r);
|
|
122
|
+
}
|
|
123
|
+
nextMonth(e, t) {
|
|
124
|
+
let n = new Date(e);
|
|
125
|
+
n.setDate(1), n.setMonth(n.getMonth() + 1), t(n);
|
|
126
|
+
}
|
|
127
|
+
previousMonth(e, t) {
|
|
128
|
+
let n = new Date(e);
|
|
129
|
+
n.setDate(1), n.setMonth(n.getMonth() - 1), t(n);
|
|
130
|
+
}
|
|
141
131
|
};
|
|
132
|
+
//#endregion
|
|
133
|
+
export { t as ViewService };
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/calendar/calendarContainer/index.tsx
|
|
4
|
+
function t({ children: t }) {
|
|
5
|
+
return /* @__PURE__ */ e("div", {
|
|
6
|
+
className: "arkynCalendarContainer",
|
|
7
|
+
children: t
|
|
8
|
+
});
|
|
5
9
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { t as CalendarContainer };
|