@arkyn/components 3.0.1-beta.154 → 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/index.js +4694 -75
- package/dist/modules/components/alert/alertContainer/index.js +22 -0
- package/dist/modules/components/alert/alertContent/index.js +9 -0
- package/dist/modules/components/alert/alertDescription/index.js +9 -0
- package/dist/modules/components/alert/alertIcon/index.js +20 -0
- package/dist/modules/components/alert/alertTitle/index.js +9 -0
- package/dist/modules/components/audioPlayer/index.js +76 -0
- package/dist/modules/components/audioUpload/hasFileContent/index.js +63 -0
- package/dist/modules/components/audioUpload/index.js +80 -0
- package/dist/modules/components/audioUpload/noFileContent/index.js +46 -0
- package/dist/modules/components/badge/index.js +23 -0
- package/dist/modules/components/button/index.js +33 -0
- package/dist/modules/components/calendar/_calendarProvider.js +65 -0
- package/dist/modules/components/calendar/_viewService.js +141 -0
- package/dist/modules/components/calendar/calendarContainer/index.js +8 -0
- package/dist/modules/components/calendar/calendarHeader/index.js +73 -0
- package/dist/modules/components/calendar/calendarTableBody/index.js +11 -0
- package/dist/modules/components/calendar/calendarTableContainer/index.js +8 -0
- package/dist/modules/components/calendar/calendarTableHeader/index.js +11 -0
- package/dist/modules/components/calendar/calendarTableTd/index.js +24 -0
- package/dist/modules/components/calendar/index.js +50 -0
- package/dist/modules/components/cardTab/cardTabButton/index.js +30 -0
- package/dist/modules/components/cardTab/cardTabContainer/index.js +29 -0
- package/dist/modules/components/cardTab/cardTabContext.js +13 -0
- package/dist/modules/components/checkbox/index.js +65 -0
- package/dist/modules/components/clientOnly.js +9 -0
- package/dist/modules/components/currencyInput/index.js +140 -0
- package/dist/modules/components/divider/index.js +13 -0
- package/dist/modules/components/drawer/drawerContainer/index.js +44 -0
- package/dist/modules/components/drawer/drawerContext.js +13 -0
- package/dist/modules/components/drawer/drawerHeader/index.js +28 -0
- package/dist/modules/components/facebookPixel/facebookPixel.client.js +19 -0
- package/dist/modules/components/facebookPixel/index.js +9 -0
- package/dist/modules/components/facebookPixel/pixel.js +53 -0
- package/dist/modules/components/fieldError/index.js +9 -0
- package/dist/modules/components/fieldLabel/index.js +13 -0
- package/dist/modules/components/fieldWrapper/index.js +14 -0
- package/dist/modules/components/fileUpload/hasFileContent/index.js +68 -0
- package/dist/modules/components/fileUpload/index.js +73 -0
- package/dist/modules/components/fileUpload/noFileContent/index.js +46 -0
- package/dist/modules/components/fullCalendar/_fullCalendarProvider.js +48 -0
- package/dist/modules/components/fullCalendar/_viewService.js +106 -0
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarContainer/index.js +8 -0
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarEvent/index.js +79 -0
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarRow/index.js +34 -0
- package/dist/modules/components/fullCalendar/dayCalendar/index.js +11 -0
- package/dist/modules/components/fullCalendar/fullCalendarContainer/index.js +8 -0
- package/dist/modules/components/fullCalendar/fullCalendarHeader/index.js +72 -0
- package/dist/modules/components/fullCalendar/index.js +31 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/index.js +13 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarEvent/index.js +37 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableBody/index.js +11 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableContainer/index.js +10 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableHeader/index.js +11 -0
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableTd/index.js +37 -0
- package/dist/modules/components/fullCalendar/weekCalendar/index.js +13 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarEvent/index.js +79 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableBody/index.js +21 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableContainer/index.js +10 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableHeader/index.js +20 -0
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableTd/index.js +40 -0
- package/dist/modules/components/googleAnalytics/googleAnalytics.client.js +8 -0
- package/dist/modules/components/googleAnalytics/googleAnalytics.js +18 -0
- package/dist/modules/components/googleAnalytics/index.js +10 -0
- package/dist/modules/components/googleAnalytics/snippets/generateGAElements.js +16 -0
- package/dist/modules/components/googleTagManager/googleTagManager.client.js +8 -0
- package/dist/modules/components/googleTagManager/googleTagManager.js +49 -0
- package/dist/modules/components/googleTagManager/index.js +28 -0
- package/dist/modules/components/googleTagManager/snippets/appendToDataLayer.js +9 -0
- package/dist/modules/components/googleTagManager/snippets/generateGTMElements.js +24 -0
- package/dist/modules/components/iconButton/index.js +30 -0
- package/dist/modules/components/imageUpload/hasFileContent/index.js +64 -0
- package/dist/modules/components/imageUpload/index.js +83 -0
- package/dist/modules/components/imageUpload/noFileContent/index.js +46 -0
- package/dist/modules/components/input/index.js +121 -0
- package/dist/modules/components/mapView/index.js +33 -0
- package/dist/modules/components/mapView/mapView.client.js +52 -0
- package/dist/modules/components/maskedInput/index.js +113 -0
- package/dist/modules/components/modal/modalContainer/index.js +43 -0
- package/dist/modules/components/modal/modalContext.js +13 -0
- package/dist/modules/components/modal/modalFooter/index.js +9 -0
- package/dist/modules/components/modal/modalHeader/index.js +28 -0
- package/dist/modules/components/multiSelect/index.js +155 -0
- package/dist/modules/components/multiSelect/multiSelectChevron/index.js +22 -0
- package/dist/modules/components/multiSelect/multiSelectContainer/index.js +30 -0
- package/dist/modules/components/multiSelect/multiSelectContent/index.js +9 -0
- package/dist/modules/components/multiSelect/multiSelectMark/index.js +23 -0
- package/dist/modules/components/multiSelect/multiSelectOption/index.js +14 -0
- package/dist/modules/components/multiSelect/multiSelectOptionsContainer/index.js +46 -0
- package/dist/modules/components/multiSelect/multiSelectOverlay/index.js +9 -0
- package/dist/modules/components/multiSelect/multiSelectSpinner/index.js +17 -0
- package/dist/modules/components/pagination/chevronButton/index.js +18 -0
- package/dist/modules/components/pagination/currentButton/index.js +8 -0
- package/dist/modules/components/pagination/index.js +84 -0
- package/dist/modules/components/pagination/pageButton/index.js +9 -0
- package/dist/modules/components/pagination/paginationService.js +49 -0
- package/dist/modules/components/pagination/spread/index.js +9 -0
- package/dist/modules/components/phoneInput/index.js +152 -0
- package/dist/modules/components/phoneInput/phoneInputContainer/index.js +20 -0
- package/dist/modules/components/phoneInput/phoneInputCountriesOverlay/index.js +9 -0
- package/dist/modules/components/phoneInput/phoneInputCountryOption/index.js +16 -0
- package/dist/modules/components/phoneInput/phoneInputCountryOptionsContainer/index.js +44 -0
- package/dist/modules/components/phoneInput/phoneInputCountrySelector/index.js +22 -0
- package/dist/modules/components/phoneInput/phoneInputMask/index.js +62 -0
- package/dist/modules/components/popover/index.js +37 -0
- package/dist/modules/components/radio/radioBox/index.js +43 -0
- package/dist/modules/components/radio/radioContext.js +20 -0
- package/dist/modules/components/radio/radioGroup/index.js +65 -0
- package/dist/modules/components/richText/blockButton/index.js +24 -0
- package/dist/modules/components/richText/element/index.js +59 -0
- package/dist/modules/components/richText/index.js +136 -0
- package/dist/modules/components/richText/insertImage/index.js +106 -0
- package/dist/modules/components/richText/insertVideo/index.js +98 -0
- package/dist/modules/components/richText/leaf/index.js +7 -0
- package/dist/modules/components/richText/markButton/index.js +23 -0
- package/dist/modules/components/richText/toolbar/index.js +8 -0
- package/dist/modules/components/searchPlaces.js +67 -0
- package/dist/modules/components/select/index.js +145 -0
- package/dist/modules/components/select/selectChevron/index.js +22 -0
- package/dist/modules/components/select/selectContainer/index.js +30 -0
- package/dist/modules/components/select/selectContent/index.js +9 -0
- package/dist/modules/components/select/selectOption/index.js +14 -0
- package/dist/modules/components/select/selectOptionsContainer/index.js +46 -0
- package/dist/modules/components/select/selectOverlay/index.js +9 -0
- package/dist/modules/components/select/selectSpinner/index.js +10 -0
- package/dist/modules/components/slider/index.js +42 -0
- package/dist/modules/components/switch/index.js +63 -0
- package/dist/modules/components/tab/tabButton/index.js +30 -0
- package/dist/modules/components/tab/tabContainer/index.js +29 -0
- package/dist/modules/components/tab/tabContext.js +13 -0
- package/dist/modules/components/table/tableBody/index.js +15 -0
- package/dist/modules/components/table/tableCaption/index.js +9 -0
- package/dist/modules/components/table/tableContainer/index.js +9 -0
- package/dist/modules/components/table/tableFooter/index.js +12 -0
- package/dist/modules/components/table/tableHeader/index.js +12 -0
- package/dist/modules/components/textarea/index.js +70 -0
- package/dist/modules/components/tooltip/index.js +46 -0
- package/dist/modules/hooks/useAutomation.js +28 -0
- package/dist/modules/hooks/useDrawer.js +20 -0
- package/dist/modules/hooks/useForm.js +8 -0
- package/dist/modules/hooks/useHydrated.js +15 -0
- package/dist/modules/hooks/useModal.js +20 -0
- package/dist/modules/hooks/useScopedParams.js +18 -0
- package/dist/modules/hooks/useScrollLock.js +21 -0
- package/dist/modules/hooks/useSearchAutomation.js +15 -0
- package/dist/modules/hooks/useSlider.js +14 -0
- package/dist/modules/hooks/useToast.js +11 -0
- package/dist/modules/index.js +144 -0
- package/dist/modules/providers/drawerProvider.js +31 -0
- package/dist/modules/providers/formProvider.js +18 -0
- package/dist/modules/providers/modalProvider.js +34 -0
- package/dist/modules/providers/placesProvider.js +18 -0
- package/dist/modules/providers/toastProvider.js +52 -0
- package/dist/modules/services/extractTextFromNode.js +7 -0
- package/dist/modules/services/fieldTemplate.js +24 -0
- package/dist/modules/services/iconRenderer.js +8 -0
- package/dist/modules/services/isBlockActive.js +15 -0
- package/dist/modules/services/isMarkActive.js +8 -0
- package/dist/modules/services/maskCurrencyValues.js +14 -0
- package/dist/modules/services/toHtml.js +7 -0
- package/dist/modules/services/toRichTextValue.js +9 -0
- package/dist/modules/services/toggleBlock.js +20 -0
- package/dist/modules/services/toggleMark.js +8 -0
- package/dist/modules/style.css +1 -0
- package/dist/modules/templates/badResponses.js +14 -0
- package/dist/modules/templates/richTextTemplates.js +14 -0
- package/dist/modules/templates/successResponses.js +4 -0
- package/dist/modules/utils/phoneInputUtilities.js +32 -0
- package/dist/modules/utils/richTextUtilities.js +77 -0
- package/package.json +208 -208
- package/dist/components/alert/alertContainer/index.js +0 -71
- package/dist/components/alert/alertContent/index.js +0 -26
- package/dist/components/alert/alertDescription/index.js +0 -25
- package/dist/components/alert/alertIcon/index.js +0 -43
- package/dist/components/alert/alertTitle/index.js +0 -27
- package/dist/components/audioPlayer/index.js +0 -112
- package/dist/components/audioUpload/hasFileContent/index.js +0 -26
- package/dist/components/audioUpload/index.js +0 -95
- package/dist/components/audioUpload/noFileContent/index.js +0 -29
- package/dist/components/badge/index.js +0 -41
- package/dist/components/button/index.js +0 -51
- package/dist/components/calendar/_calendarProvider.js +0 -58
- package/dist/components/calendar/_viewService.js +0 -179
- package/dist/components/calendar/calendarContainer/index.js +0 -6
- package/dist/components/calendar/calendarHeader/index.js +0 -13
- package/dist/components/calendar/calendarTableBody/index.js +0 -9
- package/dist/components/calendar/calendarTableContainer/index.js +0 -6
- package/dist/components/calendar/calendarTableHeader/index.js +0 -9
- package/dist/components/calendar/calendarTableTd/index.js +0 -15
- package/dist/components/calendar/index.js +0 -54
- package/dist/components/cardTab/cardTabButton/index.js +0 -40
- package/dist/components/cardTab/cardTabContainer/index.js +0 -42
- package/dist/components/cardTab/cardTabContext.js +0 -10
- package/dist/components/checkbox/index.js +0 -71
- package/dist/components/clientOnly.js +0 -31
- package/dist/components/currencyInput/index.js +0 -126
- package/dist/components/divider/index.js +0 -28
- package/dist/components/drawer/drawerContainer/index.js +0 -38
- package/dist/components/drawer/drawerContext.js +0 -10
- package/dist/components/drawer/drawerHeader/index.js +0 -33
- package/dist/components/facebookPixel/facebookPixel.client.js +0 -23
- package/dist/components/facebookPixel/index.js +0 -45
- package/dist/components/facebookPixel/pixel.js +0 -111
- package/dist/components/fieldError/index.js +0 -26
- package/dist/components/fieldLabel/index.js +0 -23
- package/dist/components/fieldWrapper/index.js +0 -27
- package/dist/components/fileUpload/hasFileContent/index.js +0 -34
- package/dist/components/fileUpload/index.js +0 -89
- package/dist/components/fileUpload/noFileContent/index.js +0 -29
- package/dist/components/fullCalendar/_fullCalendarProvider.js +0 -36
- package/dist/components/fullCalendar/_viewService.js +0 -144
- package/dist/components/fullCalendar/dayCalendar/dayCalendarContainer/index.js +0 -6
- package/dist/components/fullCalendar/dayCalendar/dayCalendarEvent/index.js +0 -105
- package/dist/components/fullCalendar/dayCalendar/dayCalendarRow/index.js +0 -24
- package/dist/components/fullCalendar/dayCalendar/index.js +0 -9
- package/dist/components/fullCalendar/fullCalendarContainer/index.js +0 -6
- package/dist/components/fullCalendar/fullCalendarHeader/index.js +0 -37
- package/dist/components/fullCalendar/index.js +0 -52
- package/dist/components/fullCalendar/monthlyCalendar/index.js +0 -8
- package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarEvent/index.js +0 -29
- package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableBody/index.js +0 -9
- package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableContainer/index.js +0 -6
- package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableHeader/index.js +0 -9
- package/dist/components/fullCalendar/monthlyCalendar/monthlyCalendarTableTd/index.js +0 -30
- package/dist/components/fullCalendar/weekCalendar/index.js +0 -8
- package/dist/components/fullCalendar/weekCalendar/weekCalendarEvent/index.js +0 -102
- package/dist/components/fullCalendar/weekCalendar/weekCalendarTableBody/index.js +0 -11
- package/dist/components/fullCalendar/weekCalendar/weekCalendarTableContainer/index.js +0 -6
- package/dist/components/fullCalendar/weekCalendar/weekCalendarTableHeader/index.js +0 -10
- package/dist/components/fullCalendar/weekCalendar/weekCalendarTableTd/index.js +0 -25
- package/dist/components/googleAnalytics/googleAnalytics.client.js +0 -8
- package/dist/components/googleAnalytics/googleAnalytics.js +0 -23
- package/dist/components/googleAnalytics/index.js +0 -31
- package/dist/components/googleAnalytics/snippets/generateGAElements.js +0 -16
- package/dist/components/googleTagManager/googleTagManager.client.js +0 -8
- package/dist/components/googleTagManager/googleTagManager.js +0 -52
- package/dist/components/googleTagManager/index.js +0 -47
- package/dist/components/googleTagManager/snippets/appendToDataLayer.js +0 -7
- package/dist/components/googleTagManager/snippets/generateGTMElements.js +0 -25
- package/dist/components/iconButton/index.js +0 -38
- package/dist/components/imageUpload/hasFileContent/index.js +0 -24
- package/dist/components/imageUpload/index.js +0 -101
- package/dist/components/imageUpload/noFileContent/index.js +0 -29
- package/dist/components/input/index.js +0 -94
- package/dist/components/mapView/index.js +0 -53
- package/dist/components/mapView/mapView.client.js +0 -51
- package/dist/components/maskedInput/index.js +0 -108
- package/dist/components/modal/modalContainer/index.js +0 -40
- package/dist/components/modal/modalContext.js +0 -10
- package/dist/components/modal/modalFooter/index.js +0 -32
- package/dist/components/modal/modalHeader/index.js +0 -34
- package/dist/components/multiSelect/index.js +0 -135
- package/dist/components/multiSelect/multiSelectChevron/index.js +0 -18
- package/dist/components/multiSelect/multiSelectContainer/index.js +0 -11
- package/dist/components/multiSelect/multiSelectContent/index.js +0 -8
- package/dist/components/multiSelect/multiSelectMark/index.js +0 -11
- package/dist/components/multiSelect/multiSelectOption/index.js +0 -10
- package/dist/components/multiSelect/multiSelectOptionsContainer/index.js +0 -44
- package/dist/components/multiSelect/multiSelectOverlay/index.js +0 -9
- package/dist/components/multiSelect/multiSelectSpinner/index.js +0 -10
- package/dist/components/pagination/chevronButton/index.js +0 -9
- package/dist/components/pagination/currentButton/index.js +0 -6
- package/dist/components/pagination/index.js +0 -46
- package/dist/components/pagination/pageButton/index.js +0 -7
- package/dist/components/pagination/paginationService.js +0 -62
- package/dist/components/pagination/spread/index.js +0 -7
- package/dist/components/phoneInput/index.js +0 -127
- package/dist/components/phoneInput/phoneInputContainer/index.js +0 -11
- package/dist/components/phoneInput/phoneInputCountriesOverlay/index.js +0 -9
- package/dist/components/phoneInput/phoneInputCountryOption/index.js +0 -10
- package/dist/components/phoneInput/phoneInputCountryOptionsContainer/index.js +0 -40
- package/dist/components/phoneInput/phoneInputCountrySelector/index.js +0 -9
- package/dist/components/phoneInput/phoneInputMask/index.js +0 -37
- package/dist/components/popover/index.js +0 -62
- package/dist/components/radio/radioBox/index.js +0 -48
- package/dist/components/radio/radioContext.js +0 -11
- package/dist/components/radio/radioGroup/index.js +0 -58
- package/dist/components/richText/blockButton/index.js +0 -18
- package/dist/components/richText/element/index.js +0 -26
- package/dist/components/richText/index.js +0 -136
- package/dist/components/richText/insertImage/index.js +0 -33
- package/dist/components/richText/insertVideo/index.js +0 -51
- package/dist/components/richText/leaf/index.js +0 -13
- package/dist/components/richText/markButton/index.js +0 -16
- package/dist/components/richText/toolbar/index.js +0 -6
- package/dist/components/searchPlaces.js +0 -99
- package/dist/components/select/index.js +0 -134
- package/dist/components/select/selectChevron/index.js +0 -18
- package/dist/components/select/selectContainer/index.js +0 -11
- package/dist/components/select/selectContent/index.js +0 -8
- package/dist/components/select/selectOption/index.js +0 -10
- package/dist/components/select/selectOptionsContainer/index.js +0 -44
- package/dist/components/select/selectOverlay/index.js +0 -9
- package/dist/components/select/selectSpinner/index.js +0 -10
- package/dist/components/slider/index.js +0 -79
- package/dist/components/switch/index.js +0 -66
- package/dist/components/tab/tabButton/index.js +0 -40
- package/dist/components/tab/tabContainer/index.js +0 -42
- package/dist/components/tab/tabContext.js +0 -10
- package/dist/components/table/tableBody/index.js +0 -34
- package/dist/components/table/tableCaption/index.js +0 -24
- package/dist/components/table/tableContainer/index.js +0 -37
- package/dist/components/table/tableFooter/index.js +0 -23
- package/dist/components/table/tableHeader/index.js +0 -25
- package/dist/components/textarea/index.js +0 -80
- package/dist/components/tooltip/index.js +0 -96
- package/dist/hooks/useAutomation.js +0 -74
- package/dist/hooks/useDrawer.js +0 -20
- package/dist/hooks/useForm.js +0 -35
- package/dist/hooks/useHydrated.js +0 -26
- package/dist/hooks/useModal.js +0 -20
- package/dist/hooks/useScopedParams.js +0 -55
- package/dist/hooks/useScrollLock.js +0 -46
- package/dist/hooks/useSearchAutomation.js +0 -64
- package/dist/hooks/useSlider.js +0 -35
- package/dist/hooks/useToast.js +0 -28
- package/dist/providers/drawerProvider.js +0 -54
- package/dist/providers/formProvider.js +0 -34
- package/dist/providers/modalProvider.js +0 -58
- package/dist/providers/placesProvider.js +0 -40
- package/dist/providers/toastProvider.js +0 -62
- package/dist/services/extractTextFromNode.js +0 -5
- package/dist/services/fieldTemplate.js +0 -11
- package/dist/services/iconRenderer.js +0 -13
- package/dist/services/isBlockActive.js +0 -14
- package/dist/services/isMarkActive.js +0 -6
- package/dist/services/maskCurrencyValues.js +0 -23
- package/dist/services/toHtml.js +0 -22
- package/dist/services/toRichTextValue.js +0 -34
- package/dist/services/toggleBlock.js +0 -32
- package/dist/services/toggleMark.js +0 -10
- package/dist/templates/badResponses.js +0 -12
- package/dist/templates/richTextTemplates.js +0 -12
- package/dist/templates/successResponses.js +0 -2
- package/dist/types/richTextTypes.js +0 -1
- package/dist/utils/phoneInputUtilities.js +0 -37
- package/dist/utils/richTextUtilities.js +0 -89
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsxs as y, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useFullCalendar as h } from "../../_fullCalendarProvider.js";
|
|
3
|
+
import { MonthlyCalendarEvent as f } from "../monthlyCalendarEvent/index.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
function T(d) {
|
|
6
|
+
const { day: e, month: t, year: a, dayOwner: c } = d, { blockedTimestamps: s, onClickDate: l } = h();
|
|
7
|
+
function m() {
|
|
8
|
+
const n = /* @__PURE__ */ new Date();
|
|
9
|
+
return e === n.getDate() && t === n.getMonth() && a === n.getFullYear();
|
|
10
|
+
}
|
|
11
|
+
function i() {
|
|
12
|
+
const n = new Date(a, t, e);
|
|
13
|
+
return s.some(
|
|
14
|
+
(o) => n >= o.initialDate && n <= o.endDate
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
function u(n) {
|
|
18
|
+
if (n.stopPropagation(), !i() && l) {
|
|
19
|
+
const o = new Date(a, t, e);
|
|
20
|
+
l(o);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return /* @__PURE__ */ y(
|
|
24
|
+
"td",
|
|
25
|
+
{
|
|
26
|
+
className: `arkynMonthlyCalendarTableTd ${c} ${i() ? "blocked" : ""}`,
|
|
27
|
+
onClick: u,
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ r("p", { className: m() ? "today" : "", children: e }),
|
|
30
|
+
/* @__PURE__ */ r("div", { className: "arkynMonthlyCalendarEventContainer", children: /* @__PURE__ */ r(f, { day: e, month: t, year: a }) })
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
T as MonthlyCalendarTableTd
|
|
37
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { WeekCalendarTableBody as a } from "./weekCalendarTableBody/index.js";
|
|
3
|
+
import { WeekCalendarTableContainer as o } from "./weekCalendarTableContainer/index.js";
|
|
4
|
+
import { WeekCalendarTableHeader as n } from "./weekCalendarTableHeader/index.js";
|
|
5
|
+
function i() {
|
|
6
|
+
return /* @__PURE__ */ r(o, { children: [
|
|
7
|
+
/* @__PURE__ */ e(n, {}),
|
|
8
|
+
/* @__PURE__ */ e(a, {})
|
|
9
|
+
] });
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
i as WeekCalendar
|
|
13
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { jsx as M, Fragment as O, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import { useFullCalendar as k } from "../../_fullCalendarProvider.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
const c = 30, T = 40;
|
|
5
|
+
function S(i) {
|
|
6
|
+
const { events: D } = k(), l = D.map((t, n) => ({ event: t, sourceIndex: n })).filter(({ event: t }) => t.initialDate.getDate() === i.day && t.initialDate.getMonth() === i.month && t.initialDate.getFullYear() === i.year).sort((t, n) => {
|
|
7
|
+
var o, u;
|
|
8
|
+
const e = t.event.initialDate.getTime(), r = n.event.initialDate.getTime();
|
|
9
|
+
if (e !== r) return e - r;
|
|
10
|
+
const s = ((o = t.event.endDate) == null ? void 0 : o.getTime()) ?? e + c * 6e4, a = ((u = n.event.endDate) == null ? void 0 : u.getTime()) ?? r + c * 6e4;
|
|
11
|
+
return s !== a ? s - a : t.sourceIndex - n.sourceIndex;
|
|
12
|
+
}), y = new Map(
|
|
13
|
+
l.map((t, n) => [t.sourceIndex, n])
|
|
14
|
+
), f = l.filter(({ event: t }) => {
|
|
15
|
+
const n = Math.floor(i.timeInMinutes / 60), e = i.timeInMinutes % 60;
|
|
16
|
+
function r() {
|
|
17
|
+
const s = t.initialDate.getHours(), a = t.initialDate.getMinutes();
|
|
18
|
+
if (s !== n) return !1;
|
|
19
|
+
if (e === 0) return a < 30 && a >= 0;
|
|
20
|
+
if (e === 30) return a >= 30 && a < 60;
|
|
21
|
+
}
|
|
22
|
+
return r() && t.initialDate.getDate() === i.day && t.initialDate.getMonth() === i.month && t.initialDate.getFullYear() === i.year;
|
|
23
|
+
});
|
|
24
|
+
if (f.length === 0) return /* @__PURE__ */ M(O, {});
|
|
25
|
+
function E(t, n) {
|
|
26
|
+
return `${i.day}-${i.month}-${i.year}-${n}-${t}`;
|
|
27
|
+
}
|
|
28
|
+
function g(t) {
|
|
29
|
+
const n = t.getHours(), e = t.getMinutes();
|
|
30
|
+
return e === 0 ? `${n}h` : `${n}h${e}`;
|
|
31
|
+
}
|
|
32
|
+
function d(t) {
|
|
33
|
+
const n = t.initialDate.getHours() * 60 + t.initialDate.getMinutes(), e = t.endDate ? t.endDate.getHours() * 60 + t.endDate.getMinutes() : n + c;
|
|
34
|
+
return {
|
|
35
|
+
startMinutes: n,
|
|
36
|
+
endMinutes: Math.max(e, n + 1)
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function I(t, n) {
|
|
40
|
+
const e = d(t), r = y.get(n);
|
|
41
|
+
return r == null ? 0 : l.reduce((s, a, o) => {
|
|
42
|
+
if (o >= r) return s;
|
|
43
|
+
const u = d(a.event);
|
|
44
|
+
return u.startMinutes < e.endMinutes && u.endMinutes > e.startMinutes ? s + 1 : s;
|
|
45
|
+
}, 0);
|
|
46
|
+
}
|
|
47
|
+
function $(t, n) {
|
|
48
|
+
const { startMinutes: e, endMinutes: r } = d(t), s = e - i.timeInMinutes, a = Math.max(r - e, 1), o = s / c * 100, u = a / c * 100, m = I(t, n) * T;
|
|
49
|
+
return {
|
|
50
|
+
top: `${o}%`,
|
|
51
|
+
height: `${u}%`,
|
|
52
|
+
left: `${m}px`
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function x(t, n) {
|
|
56
|
+
var e;
|
|
57
|
+
t.stopPropagation(), (e = n.onClick) == null || e.call(n, n.data);
|
|
58
|
+
}
|
|
59
|
+
return f.map(({ event: t, sourceIndex: n }, e) => /* @__PURE__ */ h(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
className: `arkynWeekCalendarEvent ${(t == null ? void 0 : t.scheme) || "primary"}`,
|
|
63
|
+
style: $(t, n),
|
|
64
|
+
onClick: (r) => x(r, t),
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ h("strong", { children: [
|
|
67
|
+
g(t.initialDate),
|
|
68
|
+
" ",
|
|
69
|
+
(t == null ? void 0 : t.endDate) && `- ${g(t.endDate)}`
|
|
70
|
+
] }),
|
|
71
|
+
/* @__PURE__ */ M("p", { children: t.title })
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
E(e, n)
|
|
75
|
+
));
|
|
76
|
+
}
|
|
77
|
+
export {
|
|
78
|
+
S as WeekCalendarEvent
|
|
79
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as r, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { useFullCalendar as d } from "../../_fullCalendarProvider.js";
|
|
3
|
+
import { ViewService as o } from "../../_viewService.js";
|
|
4
|
+
import { WeekCalendarTableTd as s } from "../weekCalendarTableTd/index.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
function y() {
|
|
7
|
+
const n = d(), t = new o();
|
|
8
|
+
return /* @__PURE__ */ r("tbody", { className: "arkynWeekCalendarTableBody", children: n.listWeeklyMatrix.map((a) => /* @__PURE__ */ m("tr", { children: [
|
|
9
|
+
/* @__PURE__ */ r("td", { className: "hourTd", children: /* @__PURE__ */ r("p", { children: t.formatHourLabel(a[0].timeInMinutes) }) }),
|
|
10
|
+
a.map((e, i) => /* @__PURE__ */ r(
|
|
11
|
+
s,
|
|
12
|
+
{
|
|
13
|
+
...e
|
|
14
|
+
},
|
|
15
|
+
`${e.year}-${e.month}-${e.day}-${e.timeInMinutes}-${i}`
|
|
16
|
+
))
|
|
17
|
+
] }, a[0].timeInMinutes)) });
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
y as WeekCalendarTableBody
|
|
21
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
/* empty css */
|
|
3
|
+
function t({
|
|
4
|
+
children: a
|
|
5
|
+
}) {
|
|
6
|
+
return /* @__PURE__ */ e("div", { className: "arkynWeekCalendarTableContainer", children: /* @__PURE__ */ e("table", { children: a }) });
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
t as WeekCalendarTableContainer
|
|
10
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import { formatToCapitalizeFirstWordLetter as d } from "@arkyn/shared";
|
|
3
|
+
import { useFullCalendar as s } from "../../_fullCalendarProvider.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
function k() {
|
|
6
|
+
const { listWeek: l, listWeeklyMatrix: n } = s(), i = n[0] || [];
|
|
7
|
+
return /* @__PURE__ */ e("thead", { className: "arkynWeekCalendarTableHeader", children: /* @__PURE__ */ t("tr", { children: [
|
|
8
|
+
/* @__PURE__ */ e("th", {}),
|
|
9
|
+
l.map((o, r) => {
|
|
10
|
+
var a;
|
|
11
|
+
return /* @__PURE__ */ e("th", { children: /* @__PURE__ */ t("div", { className: "arkynWeekCalendarTableHeaderContent", children: [
|
|
12
|
+
/* @__PURE__ */ e("span", { children: d(o) }),
|
|
13
|
+
/* @__PURE__ */ e("strong", { children: (a = i[r]) == null ? void 0 : a.day })
|
|
14
|
+
] }) }, r);
|
|
15
|
+
})
|
|
16
|
+
] }) });
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
k as WeekCalendarTableHeader
|
|
20
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { useFullCalendar as u } from "../../_fullCalendarProvider.js";
|
|
3
|
+
import { WeekCalendarEvent as C } from "../weekCalendarEvent/index.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
function D(c) {
|
|
6
|
+
const { day: a, month: t, year: r, dayOwner: s, timeInMinutes: o } = c, { blockedTimestamps: m, onClickDate: i } = u();
|
|
7
|
+
function l() {
|
|
8
|
+
const n = new Date(r, t, a);
|
|
9
|
+
return m.some(
|
|
10
|
+
(e) => n >= e.initialDate && n <= e.endDate
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
function k(n) {
|
|
14
|
+
if (n.stopPropagation(), !l() && i) {
|
|
15
|
+
const e = new Date(r, t, a);
|
|
16
|
+
e.setHours(0, o, 0, 0), i(e);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return /* @__PURE__ */ d(
|
|
20
|
+
"td",
|
|
21
|
+
{
|
|
22
|
+
className: `arkynWeekCalendarTableTd ${s} ${l() ? "blocked" : ""}`,
|
|
23
|
+
"data-day": a,
|
|
24
|
+
"data-time": o,
|
|
25
|
+
onClick: k,
|
|
26
|
+
children: /* @__PURE__ */ d("div", { className: "arkynWeekCalendarTableTdContent", children: /* @__PURE__ */ d(
|
|
27
|
+
C,
|
|
28
|
+
{
|
|
29
|
+
day: a,
|
|
30
|
+
month: t,
|
|
31
|
+
year: r,
|
|
32
|
+
timeInMinutes: o
|
|
33
|
+
}
|
|
34
|
+
) })
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
D as WeekCalendarTableTd
|
|
40
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { generateGAElements as s } from "./snippets/generateGAElements.js";
|
|
2
|
+
let a = class {
|
|
3
|
+
initializeAsyncScript(e) {
|
|
4
|
+
const t = document.createElement("script");
|
|
5
|
+
return t.async = !0, t.src = e, t;
|
|
6
|
+
}
|
|
7
|
+
initializeInlineScript(e) {
|
|
8
|
+
const t = document.createElement("script");
|
|
9
|
+
return t.innerHTML = e, t;
|
|
10
|
+
}
|
|
11
|
+
initialize(e) {
|
|
12
|
+
const { measurementId: t } = e, i = s({ measurementId: t }), n = this.initializeAsyncScript(i.src), c = this.initializeInlineScript(i.script);
|
|
13
|
+
document.head.appendChild(n), document.head.appendChild(c);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
a as GoogleAnalytics
|
|
18
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as o, Fragment as t } from "react/jsx-runtime";
|
|
2
|
+
import { ClientOnly as i } from "../clientOnly.js";
|
|
3
|
+
import { GoogleAnalyticsClient as l } from "./googleAnalytics.client.js";
|
|
4
|
+
function f(e) {
|
|
5
|
+
const { measurementId: n, showInDevMode: r = !1 } = e;
|
|
6
|
+
return process.env.NODE_ENV !== "production" && !r ? /* @__PURE__ */ o(t, {}) : /* @__PURE__ */ o(i, { children: () => /* @__PURE__ */ o(l, { measurementId: n }) });
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
f as GoogleAnalytics
|
|
10
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
function g(t) {
|
|
2
|
+
const { measurementId: e } = t;
|
|
3
|
+
e || console.warn("Google Analytics Measurement ID is required");
|
|
4
|
+
const a = `https://www.googletagmanager.com/gtag/js?id=${e}`, n = `
|
|
5
|
+
window.dataLayer = window.dataLayer || [];
|
|
6
|
+
function gtag(){dataLayer.push(arguments);}
|
|
7
|
+
gtag('js', new Date());
|
|
8
|
+
gtag('config', '${e}');`;
|
|
9
|
+
return {
|
|
10
|
+
src: a,
|
|
11
|
+
script: n
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
g as generateGAElements
|
|
16
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { appendToDataLayer as s } from "./snippets/appendToDataLayer.js";
|
|
2
|
+
import { generateGTMElements as d } from "./snippets/generateGTMElements.js";
|
|
3
|
+
let u = class {
|
|
4
|
+
initializeDataScript(e) {
|
|
5
|
+
const t = document.createElement("script");
|
|
6
|
+
return t.innerHTML = e, t;
|
|
7
|
+
}
|
|
8
|
+
initializeGTMElements(e) {
|
|
9
|
+
const t = d(e), a = () => {
|
|
10
|
+
const i = document.createElement("noscript");
|
|
11
|
+
return i.innerHTML = t.iframe, i;
|
|
12
|
+
}, n = () => {
|
|
13
|
+
const i = document.createElement("script");
|
|
14
|
+
return i.innerHTML = t.script, i;
|
|
15
|
+
}, r = this.initializeDataScript(t.dataLayerVar);
|
|
16
|
+
return {
|
|
17
|
+
noScript: a,
|
|
18
|
+
script: n,
|
|
19
|
+
dataScript: r
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
initializeDataLayer(e) {
|
|
23
|
+
const { dataLayer: t, dataLayerName: a } = e;
|
|
24
|
+
if (window[a]) return window[a].push(t);
|
|
25
|
+
const n = s({ dataLayer: t, dataLayerName: a }), r = this.initializeDataScript(n);
|
|
26
|
+
document.head.insertBefore(r, document.head.childNodes[0]);
|
|
27
|
+
}
|
|
28
|
+
initialize(e) {
|
|
29
|
+
const {
|
|
30
|
+
events: t,
|
|
31
|
+
gtmId: a,
|
|
32
|
+
dataLayer: n,
|
|
33
|
+
auth: r = "",
|
|
34
|
+
preview: i = "",
|
|
35
|
+
dataLayerName: c = "dataLayer"
|
|
36
|
+
} = e, o = this.initializeGTMElements({
|
|
37
|
+
id: a,
|
|
38
|
+
events: t,
|
|
39
|
+
dataLayer: n || void 0,
|
|
40
|
+
dataLayerName: c,
|
|
41
|
+
auth: r,
|
|
42
|
+
preview: i
|
|
43
|
+
});
|
|
44
|
+
n && document.head.appendChild(o.dataScript), document.head.insertBefore(o.script(), document.head.childNodes[0]), document.body.insertBefore(o.noScript(), document.body.childNodes[0]);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
u as GoogleTagManager
|
|
49
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as e, Fragment as d } from "react/jsx-runtime";
|
|
2
|
+
import { ClientOnly as l } from "../clientOnly.js";
|
|
3
|
+
import { GoogleTagManagerClient as p } from "./googleTagManager.client.js";
|
|
4
|
+
function u(r) {
|
|
5
|
+
const {
|
|
6
|
+
gtmId: a,
|
|
7
|
+
auth: o = "",
|
|
8
|
+
preview: t = "",
|
|
9
|
+
dataLayerName: n = "dataLayer",
|
|
10
|
+
events: i = {},
|
|
11
|
+
dataLayer: m = {},
|
|
12
|
+
showInDevMode: g = !1
|
|
13
|
+
} = r;
|
|
14
|
+
return process.env.NODE_ENV !== "production" && !g ? /* @__PURE__ */ e(d, {}) : /* @__PURE__ */ e(l, { children: () => /* @__PURE__ */ e(
|
|
15
|
+
p,
|
|
16
|
+
{
|
|
17
|
+
auth: o,
|
|
18
|
+
dataLayer: m,
|
|
19
|
+
dataLayerName: n,
|
|
20
|
+
events: i,
|
|
21
|
+
gtmId: a,
|
|
22
|
+
preview: t
|
|
23
|
+
}
|
|
24
|
+
) });
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
u as GoogleTagManager
|
|
28
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { appendToDataLayer as l } from "./appendToDataLayer.js";
|
|
2
|
+
function p(n) {
|
|
3
|
+
const { id: e, events: r, dataLayer: s, dataLayerName: t, preview: o, auth: m } = n, a = `>m_auth=${m}`, i = `>m_preview=${o}`;
|
|
4
|
+
e || console.warn("GTM Id is required");
|
|
5
|
+
const g = `
|
|
6
|
+
<iframe src="https://www.googletagmanager.com/ns.html?id=${e}${a}${i}>m_cookies_win=x"
|
|
7
|
+
height="0" width="0" style="display:none;visibility:hidden" id="tag-manager"></iframe>`, d = `
|
|
8
|
+
(function(w,d,s,l,i){w[l]=w[l]||[];
|
|
9
|
+
w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js', ${JSON.stringify(
|
|
10
|
+
r
|
|
11
|
+
).slice(1, -1)}});
|
|
12
|
+
var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';
|
|
13
|
+
j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl+'${a}${i}>m_cookies_win=x';
|
|
14
|
+
f.parentNode.insertBefore(j,f);
|
|
15
|
+
})(window,document,'script','${t}','${e}');`, c = l({ dataLayer: s, dataLayerName: t });
|
|
16
|
+
return {
|
|
17
|
+
iframe: g,
|
|
18
|
+
script: d,
|
|
19
|
+
dataLayerVar: c
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
p as generateGTMElements
|
|
24
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsxs as u, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { Loader2 as g } from "lucide-react";
|
|
3
|
+
/* empty css */
|
|
4
|
+
function I(a) {
|
|
5
|
+
const {
|
|
6
|
+
isLoading: o = !1,
|
|
7
|
+
scheme: e = "primary",
|
|
8
|
+
variant: t = "solid",
|
|
9
|
+
size: s = "md",
|
|
10
|
+
icon: r,
|
|
11
|
+
disabled: c,
|
|
12
|
+
className: d = "",
|
|
13
|
+
...l
|
|
14
|
+
} = a, i = { xs: 12, sm: 16, md: 20, lg: 24 }, m = `arkynIconButton ${t} ${e} ${s} ${o ? "loadingTrue" : "loadingFalse"} ${d}`;
|
|
15
|
+
return /* @__PURE__ */ u(
|
|
16
|
+
"button",
|
|
17
|
+
{
|
|
18
|
+
disabled: c || o,
|
|
19
|
+
className: m.trim(),
|
|
20
|
+
...l,
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ n("div", { className: "arkynIconButtonSpinner", children: /* @__PURE__ */ n(g, { size: i[s], strokeWidth: 2.5 }) }),
|
|
23
|
+
/* @__PURE__ */ n("div", { className: "arkynIconButtonContent", children: /* @__PURE__ */ n(r, { size: i[s], strokeWidth: 2.5 }) })
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
I as IconButton
|
|
30
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsxs as f, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { RefreshCw as g } from "lucide-react";
|
|
3
|
+
import { Button as h } from "../../button/index.js";
|
|
4
|
+
import { IconButton as b } from "../../iconButton/index.js";
|
|
5
|
+
import { Tooltip as k } from "../../tooltip/index.js";
|
|
6
|
+
/* empty css */
|
|
7
|
+
function F(l) {
|
|
8
|
+
const {
|
|
9
|
+
disabled: t,
|
|
10
|
+
filePath: c,
|
|
11
|
+
isLoading: i,
|
|
12
|
+
acceptImage: m,
|
|
13
|
+
changeImageButtonText: s,
|
|
14
|
+
handleSelectFile: p,
|
|
15
|
+
reSendImage: o
|
|
16
|
+
} = l;
|
|
17
|
+
function u() {
|
|
18
|
+
if (t) return;
|
|
19
|
+
const e = document.createElement("input");
|
|
20
|
+
e.type = "file", e.accept = m, e.onchange = (d) => {
|
|
21
|
+
var r;
|
|
22
|
+
const a = (r = d.target.files) == null ? void 0 : r[0];
|
|
23
|
+
a && p(a);
|
|
24
|
+
}, e.click();
|
|
25
|
+
}
|
|
26
|
+
return /* @__PURE__ */ f(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
className: "arkynImageUploadHasFileContent",
|
|
30
|
+
style: { backgroundImage: `url("${c}")` },
|
|
31
|
+
children: [
|
|
32
|
+
o && /* @__PURE__ */ n(k, { orientation: "bottom", text: "Reenviar imagem", children: /* @__PURE__ */ n(
|
|
33
|
+
b,
|
|
34
|
+
{
|
|
35
|
+
type: "button",
|
|
36
|
+
"aria-label": "resend image",
|
|
37
|
+
variant: "outline",
|
|
38
|
+
scheme: "danger",
|
|
39
|
+
size: "sm",
|
|
40
|
+
isLoading: i,
|
|
41
|
+
onClick: o,
|
|
42
|
+
icon: g,
|
|
43
|
+
disabled: t
|
|
44
|
+
}
|
|
45
|
+
) }),
|
|
46
|
+
/* @__PURE__ */ n(
|
|
47
|
+
h,
|
|
48
|
+
{
|
|
49
|
+
isLoading: i,
|
|
50
|
+
onClick: u,
|
|
51
|
+
variant: "outline",
|
|
52
|
+
size: "sm",
|
|
53
|
+
type: "button",
|
|
54
|
+
disabled: t,
|
|
55
|
+
children: s
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
F as HasFileContent
|
|
64
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
);
|
|
80
|
+
}
|
|
81
|
+
export {
|
|
82
|
+
_ as ImageUpload
|
|
83
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
] });
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
C as NoFileContent
|
|
46
|
+
};
|