@arkyn/components 3.0.1-beta.155 → 3.0.1-beta.156

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/dist/components/calendar/_viewService.d.ts +1 -1
  2. package/dist/components/fullCalendar/_viewService.d.ts +2 -2
  3. package/dist/hooks/useScopedParams.d.ts +1 -1
  4. package/dist/index.js +4683 -4347
  5. package/dist/modules/components/alert/alertContainer/index.js +20 -25
  6. package/dist/modules/components/alert/alertContent/index.js +8 -11
  7. package/dist/modules/components/alert/alertDescription/index.js +8 -11
  8. package/dist/modules/components/alert/alertIcon/index.js +19 -27
  9. package/dist/modules/components/alert/alertTitle/index.js +8 -11
  10. package/dist/modules/components/audioPlayer/index.js +75 -74
  11. package/dist/modules/components/audioUpload/hasFileContent/index.js +62 -54
  12. package/dist/modules/components/audioUpload/index.js +79 -71
  13. package/dist/modules/components/audioUpload/noFileContent/index.js +45 -35
  14. package/dist/modules/components/badge/index.js +22 -26
  15. package/dist/modules/components/button/index.js +32 -39
  16. package/dist/modules/components/calendar/_calendarProvider.js +63 -38
  17. package/dist/modules/components/calendar/_viewService.js +140 -132
  18. package/dist/modules/components/calendar/calendarContainer/index.js +7 -10
  19. package/dist/modules/components/calendar/calendarHeader/index.js +72 -51
  20. package/dist/modules/components/calendar/calendarTableBody/index.js +10 -12
  21. package/dist/modules/components/calendar/calendarTableContainer/index.js +7 -10
  22. package/dist/modules/components/calendar/calendarTableHeader/index.js +10 -13
  23. package/dist/modules/components/calendar/calendarTableTd/index.js +23 -20
  24. package/dist/modules/components/calendar/index.js +49 -31
  25. package/dist/modules/components/cardTab/cardTabButton/index.js +29 -19
  26. package/dist/modules/components/cardTab/cardTabContainer/index.js +28 -22
  27. package/dist/modules/components/cardTab/cardTabContext.js +11 -13
  28. package/dist/modules/components/checkbox/index.js +64 -37
  29. package/dist/modules/components/clientOnly.js +8 -8
  30. package/dist/modules/components/currencyInput/index.js +138 -110
  31. package/dist/modules/components/divider/index.js +11 -10
  32. package/dist/modules/components/drawer/drawerContainer/index.js +43 -40
  33. package/dist/modules/components/drawer/drawerContext.js +11 -13
  34. package/dist/modules/components/drawer/drawerHeader/index.js +27 -20
  35. package/dist/modules/components/facebookPixel/facebookPixel.client.js +18 -8
  36. package/dist/modules/components/facebookPixel/index.js +8 -8
  37. package/dist/modules/components/facebookPixel/pixel.js +52 -47
  38. package/dist/modules/components/fieldError/index.js +8 -12
  39. package/dist/modules/components/fieldLabel/index.js +12 -11
  40. package/dist/modules/components/fieldWrapper/index.js +13 -12
  41. package/dist/modules/components/fileUpload/hasFileContent/index.js +67 -59
  42. package/dist/modules/components/fileUpload/index.js +72 -65
  43. package/dist/modules/components/fileUpload/noFileContent/index.js +45 -35
  44. package/dist/modules/components/fullCalendar/_fullCalendarProvider.js +46 -33
  45. package/dist/modules/components/fullCalendar/_viewService.js +105 -100
  46. package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarContainer/index.js +7 -10
  47. package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarEvent/index.js +78 -70
  48. package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarRow/index.js +33 -28
  49. package/dist/modules/components/fullCalendar/dayCalendar/index.js +9 -12
  50. package/dist/modules/components/fullCalendar/fullCalendarContainer/index.js +7 -10
  51. package/dist/modules/components/fullCalendar/fullCalendarHeader/index.js +70 -67
  52. package/dist/modules/components/fullCalendar/index.js +30 -30
  53. package/dist/modules/components/fullCalendar/monthlyCalendar/index.js +12 -9
  54. package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarEvent/index.js +36 -28
  55. package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableBody/index.js +9 -11
  56. package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableContainer/index.js +9 -10
  57. package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableHeader/index.js +10 -13
  58. package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableTd/index.js +36 -35
  59. package/dist/modules/components/fullCalendar/weekCalendar/index.js +11 -8
  60. package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarEvent/index.js +78 -70
  61. package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableBody/index.js +20 -17
  62. package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableContainer/index.js +8 -9
  63. package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableHeader/index.js +19 -16
  64. package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableTd/index.js +39 -34
  65. package/dist/modules/components/googleAnalytics/googleAnalytics.client.js +7 -7
  66. package/dist/modules/components/googleAnalytics/googleAnalytics.js +17 -17
  67. package/dist/modules/components/googleAnalytics/index.js +9 -9
  68. package/dist/modules/components/googleAnalytics/snippets/generateGAElements.js +12 -10
  69. package/dist/modules/components/googleTagManager/googleTagManager.client.js +6 -6
  70. package/dist/modules/components/googleTagManager/googleTagManager.js +48 -44
  71. package/dist/modules/components/googleTagManager/index.js +27 -16
  72. package/dist/modules/components/googleTagManager/snippets/appendToDataLayer.js +8 -8
  73. package/dist/modules/components/googleTagManager/snippets/generateGTMElements.js +20 -19
  74. package/dist/modules/components/iconButton/index.js +29 -31
  75. package/dist/modules/components/imageUpload/hasFileContent/index.js +63 -46
  76. package/dist/modules/components/imageUpload/index.js +82 -65
  77. package/dist/modules/components/imageUpload/noFileContent/index.js +45 -35
  78. package/dist/modules/components/input/index.js +120 -92
  79. package/dist/modules/components/mapView/index.js +31 -27
  80. package/dist/modules/components/mapView/mapView.client.js +51 -49
  81. package/dist/modules/components/maskedInput/index.js +112 -101
  82. package/dist/modules/components/modal/modalContainer/index.js +42 -49
  83. package/dist/modules/components/modal/modalContext.js +11 -13
  84. package/dist/modules/components/modal/modalFooter/index.js +7 -10
  85. package/dist/modules/components/modal/modalHeader/index.js +27 -20
  86. package/dist/modules/components/multiSelect/index.js +154 -115
  87. package/dist/modules/components/multiSelect/multiSelectChevron/index.js +21 -18
  88. package/dist/modules/components/multiSelect/multiSelectContainer/index.js +29 -13
  89. package/dist/modules/components/multiSelect/multiSelectContent/index.js +8 -11
  90. package/dist/modules/components/multiSelect/multiSelectMark/index.js +22 -19
  91. package/dist/modules/components/multiSelect/multiSelectOption/index.js +13 -17
  92. package/dist/modules/components/multiSelect/multiSelectOptionsContainer/index.js +45 -35
  93. package/dist/modules/components/multiSelect/multiSelectOverlay/index.js +8 -11
  94. package/dist/modules/components/multiSelect/multiSelectSpinner/index.js +16 -13
  95. package/dist/modules/components/pagination/chevronButton/index.js +17 -17
  96. package/dist/modules/components/pagination/currentButton/index.js +7 -11
  97. package/dist/modules/components/pagination/index.js +83 -51
  98. package/dist/modules/components/pagination/pageButton/index.js +8 -12
  99. package/dist/modules/components/pagination/paginationService.js +48 -33
  100. package/dist/modules/components/pagination/spread/index.js +7 -10
  101. package/dist/modules/components/phoneInput/index.js +151 -103
  102. package/dist/modules/components/phoneInput/phoneInputContainer/index.js +19 -12
  103. package/dist/modules/components/phoneInput/phoneInputCountriesOverlay/index.js +8 -11
  104. package/dist/modules/components/phoneInput/phoneInputCountryOption/index.js +15 -23
  105. package/dist/modules/components/phoneInput/phoneInputCountryOptionsContainer/index.js +43 -33
  106. package/dist/modules/components/phoneInput/phoneInputCountrySelector/index.js +21 -25
  107. package/dist/modules/components/phoneInput/phoneInputMask/index.js +62 -46
  108. package/dist/modules/components/popover/index.js +36 -37
  109. package/dist/modules/components/radio/radioBox/index.js +42 -24
  110. package/dist/modules/components/radio/radioContext.js +18 -20
  111. package/dist/modules/components/radio/radioGroup/index.js +64 -41
  112. package/dist/modules/components/richText/blockButton/index.js +23 -20
  113. package/dist/modules/components/richText/element/index.js +58 -72
  114. package/dist/modules/components/richText/index.js +135 -143
  115. package/dist/modules/components/richText/insertImage/index.js +105 -94
  116. package/dist/modules/components/richText/insertVideo/index.js +97 -85
  117. package/dist/modules/components/richText/leaf/index.js +6 -9
  118. package/dist/modules/components/richText/markButton/index.js +22 -19
  119. package/dist/modules/components/richText/toolbar/index.js +7 -10
  120. package/dist/modules/components/searchPlaces.js +66 -57
  121. package/dist/modules/components/select/index.js +144 -112
  122. package/dist/modules/components/select/selectChevron/index.js +21 -18
  123. package/dist/modules/components/select/selectContainer/index.js +29 -13
  124. package/dist/modules/components/select/selectContent/index.js +8 -11
  125. package/dist/modules/components/select/selectOption/index.js +13 -17
  126. package/dist/modules/components/select/selectOptionsContainer/index.js +45 -35
  127. package/dist/modules/components/select/selectOverlay/index.js +8 -11
  128. package/dist/modules/components/select/selectSpinner/index.js +9 -13
  129. package/dist/modules/components/slider/index.js +41 -34
  130. package/dist/modules/components/switch/index.js +62 -35
  131. package/dist/modules/components/tab/tabButton/index.js +29 -19
  132. package/dist/modules/components/tab/tabContainer/index.js +28 -22
  133. package/dist/modules/components/tab/tabContext.js +10 -12
  134. package/dist/modules/components/table/tableBody/index.js +14 -19
  135. package/dist/modules/components/table/tableCaption/index.js +8 -15
  136. package/dist/modules/components/table/tableContainer/index.js +8 -12
  137. package/dist/modules/components/table/tableFooter/index.js +11 -18
  138. package/dist/modules/components/table/tableHeader/index.js +11 -12
  139. package/dist/modules/components/textarea/index.js +69 -51
  140. package/dist/modules/components/tooltip/index.js +45 -34
  141. package/dist/modules/hooks/useAutomation.js +27 -35
  142. package/dist/modules/hooks/useDrawer.js +19 -17
  143. package/dist/modules/hooks/useForm.js +6 -6
  144. package/dist/modules/hooks/useHydrated.js +12 -7
  145. package/dist/modules/hooks/useModal.js +19 -17
  146. package/dist/modules/hooks/useScopedParams.js +17 -17
  147. package/dist/modules/hooks/useScrollLock.js +19 -19
  148. package/dist/modules/hooks/useSearchAutomation.js +14 -31
  149. package/dist/modules/hooks/useSlider.js +13 -13
  150. package/dist/modules/hooks/useToast.js +9 -8
  151. package/dist/modules/index.js +144 -72
  152. package/dist/modules/providers/drawerProvider.js +30 -35
  153. package/dist/modules/providers/formProvider.js +16 -11
  154. package/dist/modules/providers/modalProvider.js +33 -39
  155. package/dist/modules/providers/placesProvider.js +16 -16
  156. package/dist/modules/providers/toastProvider.js +51 -45
  157. package/dist/modules/services/extractTextFromNode.js +6 -6
  158. package/dist/modules/services/fieldTemplate.js +23 -22
  159. package/dist/modules/services/iconRenderer.js +7 -14
  160. package/dist/modules/services/isBlockActive.js +14 -12
  161. package/dist/modules/services/isMarkActive.js +6 -6
  162. package/dist/modules/services/maskCurrencyValues.js +12 -11
  163. package/dist/modules/services/toHtml.js +6 -6
  164. package/dist/modules/services/toRichTextValue.js +7 -7
  165. package/dist/modules/services/toggleBlock.js +19 -20
  166. package/dist/modules/services/toggleMark.js +7 -7
  167. package/dist/modules/style.css +1 -0
  168. package/dist/modules/templates/badResponses.js +13 -13
  169. package/dist/modules/templates/richTextTemplates.js +14 -17
  170. package/dist/modules/templates/successResponses.js +4 -9
  171. package/dist/modules/utils/phoneInputUtilities.js +28 -18
  172. package/dist/modules/utils/richTextUtilities.js +75 -88
  173. package/dist/services/fieldTemplate.d.ts +1 -1
  174. package/dist/services/fieldTemplate.d.ts.map +1 -1
  175. package/dist/style.css +1 -0
  176. package/package.json +65 -65
  177. package/dist/components.css +0 -2
  178. package/dist/modules/components.css +0 -2
@@ -1,101 +1,106 @@
1
- import { formatToCapitalizeFirstWordLetter as e } from "@arkyn/shared";
2
- //#region src/components/fullCalendar/_viewService.ts
3
- var t = class {
4
- capitalize(t) {
5
- return e(t);
6
- }
7
- listHours(e) {
8
- let [t, n] = e, r = [];
9
- for (let e = t * 60; e <= n * 60; e += 30) r.push(e);
10
- return r;
11
- }
12
- formatHourLabel(e) {
13
- let t = Math.floor(e / 60), n = e % 60;
14
- return `${String(t).padStart(2, "0")}:${String(n).padStart(2, "0")}`;
15
- }
16
- getStartOfWeek(e) {
17
- let t = new Date(e);
18
- return t.setHours(0, 0, 0, 0), t.setDate(t.getDate() - t.getDay()), t;
19
- }
20
- listWeek(e, t) {
21
- let n = [], r = this.getStartOfWeek(e);
22
- for (let e = 0; e < 7; e++) {
23
- let i = new Date(r);
24
- i.setDate(r.getDate() + e);
25
- let a = i.toLocaleDateString(t, { weekday: "short" });
26
- n.push(a);
27
- }
28
- return n;
29
- }
30
- listWeeklyMatrix(e, t) {
31
- let n = this.getStartOfWeek(e), r = e.getMonth();
32
- return t.map((t) => Array.from({ length: 7 }, (i, a) => {
33
- let o = new Date(n);
34
- o.setDate(n.getDate() + a);
35
- let s = "current";
36
- return (o.getMonth() < r || o.getFullYear() < e.getFullYear()) && (s = "previous"), (o.getMonth() > r || o.getFullYear() > e.getFullYear()) && (s = "next"), {
37
- day: o.getDate(),
38
- month: o.getMonth(),
39
- year: o.getFullYear(),
40
- dayOwner: s,
41
- timeInMinutes: t
42
- };
43
- }));
44
- }
45
- listMonthlyMatrix(e) {
46
- let t = e.getFullYear(), n = e.getMonth(), r = new Date(t, n, 1).getDay(), i = new Date(t, n + 1, 0).getDate(), a = new Date(t, n, 0).getDate(), o = Math.ceil((r + i) / 7) * 7, s = [], c = 1, l = 1;
47
- for (let e = 0; e < o; e++) {
48
- let o = Math.floor(e / 7);
49
- if (s[o] || (s[o] = []), e < r) {
50
- let i = a - (r - e - 1), c = n === 0 ? 11 : n - 1, l = n === 0 ? t - 1 : t;
51
- s[o].push({
52
- day: i,
53
- month: c,
54
- year: l,
55
- dayOwner: "previous"
56
- });
57
- } else if (c <= i) s[o].push({
58
- day: c,
59
- month: n,
60
- year: t,
61
- dayOwner: "current"
62
- }), c++;
63
- else {
64
- let e = n === 11 ? 0 : n + 1, r = n === 11 ? t + 1 : t;
65
- s[o].push({
66
- day: l,
67
- month: e,
68
- year: r,
69
- dayOwner: "next"
70
- }), l++;
71
- }
72
- }
73
- return s;
74
- }
75
- nextMonth(e, t) {
76
- let n = new Date(e);
77
- n.setMonth(n.getMonth() + 1), t(n);
78
- }
79
- nextWeek(e, t) {
80
- let n = new Date(e);
81
- n.setDate(n.getDate() + 7), t(n);
82
- }
83
- nextDay(e, t) {
84
- let n = new Date(e);
85
- n.setDate(n.getDate() + 1), t(n);
86
- }
87
- previousMonth(e, t) {
88
- let n = new Date(e);
89
- n.setMonth(n.getMonth() - 1), t(n);
90
- }
91
- previousWeek(e, t) {
92
- let n = new Date(e);
93
- n.setDate(n.getDate() - 7), t(n);
94
- }
95
- previousDay(e, t) {
96
- let n = new Date(e);
97
- n.setDate(n.getDate() - 1), t(n);
98
- }
1
+ import { formatToCapitalizeFirstWordLetter as M } from "@arkyn/shared";
2
+ class p {
3
+ capitalize(n) {
4
+ return M(n);
5
+ }
6
+ listHours(n) {
7
+ const [e, t] = n, s = [];
8
+ for (let a = e * 60; a <= t * 60; a += 30)
9
+ s.push(a);
10
+ return s;
11
+ }
12
+ formatHourLabel(n) {
13
+ const e = Math.floor(n / 60), t = n % 60;
14
+ return `${String(e).padStart(2, "0")}:${String(t).padStart(2, "0")}`;
15
+ }
16
+ getStartOfWeek(n) {
17
+ const e = new Date(n);
18
+ return e.setHours(0, 0, 0, 0), e.setDate(e.getDate() - e.getDay()), e;
19
+ }
20
+ listWeek(n, e) {
21
+ const t = [], s = this.getStartOfWeek(n);
22
+ for (let a = 0; a < 7; a++) {
23
+ const i = new Date(s);
24
+ i.setDate(s.getDate() + a);
25
+ const D = i.toLocaleDateString(e, {
26
+ weekday: "short"
27
+ });
28
+ t.push(D);
29
+ }
30
+ return t;
31
+ }
32
+ listWeeklyMatrix(n, e) {
33
+ const t = this.getStartOfWeek(n), s = n.getMonth();
34
+ return e.map((a) => Array.from({ length: 7 }, (i, D) => {
35
+ const r = new Date(t);
36
+ r.setDate(t.getDate() + D);
37
+ let o = "current";
38
+ return (r.getMonth() < s || r.getFullYear() < n.getFullYear()) && (o = "previous"), (r.getMonth() > s || r.getFullYear() > n.getFullYear()) && (o = "next"), {
39
+ day: r.getDate(),
40
+ month: r.getMonth(),
41
+ year: r.getFullYear(),
42
+ dayOwner: o,
43
+ timeInMinutes: a
44
+ };
45
+ }));
46
+ }
47
+ listMonthlyMatrix(n) {
48
+ const e = n.getFullYear(), t = n.getMonth(), a = new Date(e, t, 1).getDay(), i = new Date(e, t + 1, 0).getDate(), D = new Date(e, t, 0).getDate(), r = Math.ceil((a + i) / 7) * 7, o = [];
49
+ let u = 1, g = 1;
50
+ for (let l = 0; l < r; l++) {
51
+ const c = Math.floor(l / 7);
52
+ if (o[c] || (o[c] = []), l < a) {
53
+ const h = D - (a - l - 1), y = t === 0 ? 11 : t - 1, f = t === 0 ? e - 1 : e;
54
+ o[c].push({
55
+ day: h,
56
+ month: y,
57
+ year: f,
58
+ dayOwner: "previous"
59
+ });
60
+ } else if (u <= i)
61
+ o[c].push({
62
+ day: u,
63
+ month: t,
64
+ year: e,
65
+ dayOwner: "current"
66
+ }), u++;
67
+ else {
68
+ const h = t === 11 ? 0 : t + 1, y = t === 11 ? e + 1 : e;
69
+ o[c].push({
70
+ day: g,
71
+ month: h,
72
+ year: y,
73
+ dayOwner: "next"
74
+ }), g++;
75
+ }
76
+ }
77
+ return o;
78
+ }
79
+ nextMonth(n, e) {
80
+ const t = new Date(n);
81
+ t.setMonth(t.getMonth() + 1), e(t);
82
+ }
83
+ nextWeek(n, e) {
84
+ const t = new Date(n);
85
+ t.setDate(t.getDate() + 7), e(t);
86
+ }
87
+ nextDay(n, e) {
88
+ const t = new Date(n);
89
+ t.setDate(t.getDate() + 1), e(t);
90
+ }
91
+ previousMonth(n, e) {
92
+ const t = new Date(n);
93
+ t.setMonth(t.getMonth() - 1), e(t);
94
+ }
95
+ previousWeek(n, e) {
96
+ const t = new Date(n);
97
+ t.setDate(t.getDate() - 7), e(t);
98
+ }
99
+ previousDay(n, e) {
100
+ const t = new Date(n);
101
+ t.setDate(t.getDate() - 1), e(t);
102
+ }
103
+ }
104
+ export {
105
+ p as ViewService
99
106
  };
100
- //#endregion
101
- export { t as ViewService };
@@ -1,11 +1,8 @@
1
- /* empty css */
2
- import { jsx as e } from "react/jsx-runtime";
3
- //#region src/components/fullCalendar/dayCalendar/dayCalendarContainer/index.tsx
4
- function t({ children: t }) {
5
- return /* @__PURE__ */ e("div", {
6
- className: "arkynDayCalendarContainer",
7
- children: t
8
- });
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ /* empty css */
3
+ function o({ children: a }) {
4
+ return /* @__PURE__ */ r("div", { className: "arkynDayCalendarContainer", children: a });
9
5
  }
10
- //#endregion
11
- export { t as DayCalendarContainer };
6
+ export {
7
+ o as DayCalendarContainer
8
+ };
@@ -1,71 +1,79 @@
1
- import { useFullCalendar as e } from "../../_fullCalendarProvider.js";
2
- /* empty css */
3
- import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
4
- //#region src/components/fullCalendar/dayCalendar/dayCalendarEvent/index.tsx
5
- var i = 30, a = 205;
6
- function o(o) {
7
- let { events: s, viewDate: c } = e(), l = c.getDate(), u = c.getMonth(), d = c.getFullYear(), f = s.map((e, t) => ({
8
- event: e,
9
- sourceIndex: t
10
- })).filter(({ event: e }) => e.initialDate.getDate() === l && e.initialDate.getMonth() === u && e.initialDate.getFullYear() === d).sort((e, t) => {
11
- let n = e.event.initialDate.getTime(), r = t.event.initialDate.getTime();
12
- if (n !== r) return n - r;
13
- let a = e.event.endDate?.getTime() ?? n + i * 6e4, o = t.event.endDate?.getTime() ?? r + i * 6e4;
14
- return a === o ? e.sourceIndex - t.sourceIndex : a - o;
15
- }), p = new Map(f.map((e, t) => [e.sourceIndex, t])), m = f.filter(({ event: e }) => {
16
- let t = Math.floor(o.timeInMinutes / 60), n = o.timeInMinutes % 60;
17
- function r() {
18
- let r = e.initialDate.getHours(), i = e.initialDate.getMinutes();
19
- if (r !== t) return !1;
20
- if (n === 0) return i < 30 && i >= 0;
21
- if (n === 30) return i >= 30 && i < 60;
22
- }
23
- return r() && e.initialDate.getDate() === l && e.initialDate.getMonth() === u && e.initialDate.getFullYear() === d;
24
- });
25
- if (m.length === 0) return /* @__PURE__ */ n(t, {});
26
- function h(e, t) {
27
- return `${l}-${u}-${d}-${t}-${e}`;
28
- }
29
- function g(e) {
30
- let t = e.getHours(), n = e.getMinutes();
31
- return n === 0 ? `${t}h` : `${t}h${n}`;
32
- }
33
- function _(e) {
34
- let t = e.initialDate.getHours() * 60 + e.initialDate.getMinutes(), n = e.endDate ? e.endDate.getHours() * 60 + e.endDate.getMinutes() : t + i;
35
- return {
36
- startMinutes: t,
37
- endMinutes: Math.max(n, t + 1)
38
- };
39
- }
40
- function v(e, t) {
41
- let n = _(e), r = p.get(t);
42
- return r == null ? 0 : f.reduce((e, t, i) => {
43
- if (i >= r) return e;
44
- let a = _(t.event);
45
- return a.startMinutes < n.endMinutes && a.endMinutes > n.startMinutes ? e + 1 : e;
46
- }, 0);
47
- }
48
- function y(e, t) {
49
- let { startMinutes: n, endMinutes: r } = _(e), s = n - o.timeInMinutes, c = Math.max(r - n, 1), l = s / i * 100, u = c / i * 100, d = v(e, t) * a;
50
- return {
51
- top: `${l}%`,
52
- height: `${u}%`,
53
- left: `${d}px`
54
- };
55
- }
56
- function b(e, t) {
57
- e.stopPropagation(), t.onClick?.(t.data);
58
- }
59
- return m.map(({ event: e, sourceIndex: t }, i) => /* @__PURE__ */ r("div", {
60
- className: `arkynDayCalendarEvent ${e?.scheme || "primary"}`,
61
- style: y(e, t),
62
- onClick: (t) => b(t, e),
63
- children: [/* @__PURE__ */ r("strong", { children: [
64
- g(e.initialDate),
65
- " ",
66
- e?.endDate && `- ${g(e.endDate)}`
67
- ] }), /* @__PURE__ */ n("p", { children: e.title })]
68
- }, h(i, t)));
1
+ import { jsx as p, Fragment as F, jsxs as y } from "react/jsx-runtime";
2
+ import { useFullCalendar as H } from "../../_fullCalendarProvider.js";
3
+ /* empty css */
4
+ const u = 30, k = 205;
5
+ function _(c) {
6
+ const { events: E, viewDate: l } = H(), d = l.getDate(), g = l.getMonth(), f = l.getFullYear(), M = E.map((t, n) => ({ event: t, sourceIndex: n })).filter(({ event: t }) => t.initialDate.getDate() === d && t.initialDate.getMonth() === g && t.initialDate.getFullYear() === f).sort((t, n) => {
7
+ var o, a;
8
+ const e = t.event.initialDate.getTime(), i = n.event.initialDate.getTime();
9
+ if (e !== i) return e - i;
10
+ const s = ((o = t.event.endDate) == null ? void 0 : o.getTime()) ?? e + u * 6e4, r = ((a = n.event.endDate) == null ? void 0 : a.getTime()) ?? i + u * 6e4;
11
+ return s !== r ? s - r : t.sourceIndex - n.sourceIndex;
12
+ }), I = new Map(
13
+ M.map((t, n) => [t.sourceIndex, n])
14
+ ), D = M.filter(({ event: t }) => {
15
+ const n = Math.floor(c.timeInMinutes / 60), e = c.timeInMinutes % 60;
16
+ function i() {
17
+ const s = t.initialDate.getHours(), r = t.initialDate.getMinutes();
18
+ if (s !== n) return !1;
19
+ if (e === 0) return r < 30 && r >= 0;
20
+ if (e === 30) return r >= 30 && r < 60;
21
+ }
22
+ return i() && t.initialDate.getDate() === d && t.initialDate.getMonth() === g && t.initialDate.getFullYear() === f;
23
+ });
24
+ if (D.length === 0) return /* @__PURE__ */ p(F, {});
25
+ function x(t, n) {
26
+ return `${d}-${g}-${f}-${n}-${t}`;
27
+ }
28
+ function h(t) {
29
+ const n = t.getHours(), e = t.getMinutes();
30
+ return e === 0 ? `${n}h` : `${n}h${e}`;
31
+ }
32
+ function m(t) {
33
+ const n = t.initialDate.getHours() * 60 + t.initialDate.getMinutes(), e = t.endDate ? t.endDate.getHours() * 60 + t.endDate.getMinutes() : n + u;
34
+ return {
35
+ startMinutes: n,
36
+ endMinutes: Math.max(e, n + 1)
37
+ };
38
+ }
39
+ function O(t, n) {
40
+ const e = m(t), i = I.get(n);
41
+ return i == null ? 0 : M.reduce((s, r, o) => {
42
+ if (o >= i) return s;
43
+ const a = m(r.event);
44
+ return a.startMinutes < e.endMinutes && a.endMinutes > e.startMinutes ? s + 1 : s;
45
+ }, 0);
46
+ }
47
+ function T(t, n) {
48
+ const { startMinutes: e, endMinutes: i } = m(t), s = e - c.timeInMinutes, r = Math.max(i - e, 1), o = s / u * 100, a = r / u * 100, $ = O(t, n) * k;
49
+ return {
50
+ top: `${o}%`,
51
+ height: `${a}%`,
52
+ left: `${$}px`
53
+ };
54
+ }
55
+ function C(t, n) {
56
+ var e;
57
+ t.stopPropagation(), (e = n.onClick) == null || e.call(n, n.data);
58
+ }
59
+ return D.map(({ event: t, sourceIndex: n }, e) => /* @__PURE__ */ y(
60
+ "div",
61
+ {
62
+ className: `arkynDayCalendarEvent ${(t == null ? void 0 : t.scheme) || "primary"}`,
63
+ style: T(t, n),
64
+ onClick: (i) => C(i, t),
65
+ children: [
66
+ /* @__PURE__ */ y("strong", { children: [
67
+ h(t.initialDate),
68
+ " ",
69
+ (t == null ? void 0 : t.endDate) && `- ${h(t.endDate)}`
70
+ ] }),
71
+ /* @__PURE__ */ p("p", { children: t.title })
72
+ ]
73
+ },
74
+ x(e, n)
75
+ ));
69
76
  }
70
- //#endregion
71
- export { o as DayCalendarEvent };
77
+ export {
78
+ _ as DayCalendarEvent
79
+ };
@@ -1,29 +1,34 @@
1
- import { ViewService as e } from "../../_viewService.js";
2
- import { useFullCalendar as t } from "../../_fullCalendarProvider.js";
3
- import { DayCalendarEvent as n } from "../dayCalendarEvent/index.js";
4
- /* empty css */
5
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
6
- //#region src/components/fullCalendar/dayCalendar/dayCalendarRow/index.tsx
7
- function a({ hour: a, timeInMinutes: o }) {
8
- let s = new e(), { blockedTimestamps: c, viewDate: l, onClickDate: u } = t();
9
- function d() {
10
- return c.some((e) => l >= e.initialDate && l <= e.endDate);
11
- }
12
- function f(e) {
13
- if (e.stopPropagation(), !d() && u) {
14
- let e = new Date(l);
15
- e.setHours(0, o, 0, 0), u(e);
16
- }
17
- }
18
- return /* @__PURE__ */ i("div", {
19
- className: `arkynDayCalendarRow ${d() ? "blocked" : ""}`,
20
- "data-time": o,
21
- onClick: f,
22
- children: [/* @__PURE__ */ r("p", { children: s.formatHourLabel(a) }), /* @__PURE__ */ r("div", {
23
- className: "arkynDayCalendarRowContent",
24
- children: /* @__PURE__ */ r(n, { timeInMinutes: o })
25
- })]
26
- });
1
+ import { jsxs as m, jsx as r } from "react/jsx-runtime";
2
+ import { useFullCalendar as f } from "../../_fullCalendarProvider.js";
3
+ import { ViewService as p } from "../../_viewService.js";
4
+ import { DayCalendarEvent as C } from "../dayCalendarEvent/index.js";
5
+ /* empty css */
6
+ function y({ hour: l, timeInMinutes: a }) {
7
+ const c = new p(), { blockedTimestamps: d, viewDate: o, onClickDate: n } = f();
8
+ function t() {
9
+ return d.some(
10
+ (e) => o >= e.initialDate && o <= e.endDate
11
+ );
12
+ }
13
+ function s(e) {
14
+ if (e.stopPropagation(), !t() && n) {
15
+ const i = new Date(o);
16
+ i.setHours(0, a, 0, 0), n(i);
17
+ }
18
+ }
19
+ return /* @__PURE__ */ m(
20
+ "div",
21
+ {
22
+ className: `arkynDayCalendarRow ${t() ? "blocked" : ""}`,
23
+ "data-time": a,
24
+ onClick: s,
25
+ children: [
26
+ /* @__PURE__ */ r("p", { children: c.formatHourLabel(l) }),
27
+ /* @__PURE__ */ r("div", { className: "arkynDayCalendarRowContent", children: /* @__PURE__ */ r(C, { timeInMinutes: a }) })
28
+ ]
29
+ }
30
+ );
27
31
  }
28
- //#endregion
29
- export { a as DayCalendarRow };
32
+ export {
33
+ y as DayCalendarRow
34
+ };
@@ -1,14 +1,11 @@
1
- import { useFullCalendar as e } from "../_fullCalendarProvider.js";
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { useFullCalendar as o } from "../_fullCalendarProvider.js";
2
3
  import { DayCalendarContainer as t } from "./dayCalendarContainer/index.js";
3
- import { DayCalendarRow as n } from "./dayCalendarRow/index.js";
4
- import { jsx as r } from "react/jsx-runtime";
5
- //#region src/components/fullCalendar/dayCalendar/index.tsx
6
- function i() {
7
- let { listHours: i } = e();
8
- return /* @__PURE__ */ r(t, { children: i.map((e) => /* @__PURE__ */ r(n, {
9
- hour: e,
10
- timeInMinutes: e
11
- })) });
4
+ import { DayCalendarRow as e } from "./dayCalendarRow/index.js";
5
+ function s() {
6
+ const { listHours: n } = o();
7
+ return /* @__PURE__ */ a(t, { children: n.map((r) => /* @__PURE__ */ a(e, { hour: r, timeInMinutes: r })) });
12
8
  }
13
- //#endregion
14
- export { i as DayCalendar };
9
+ export {
10
+ s as DayCalendar
11
+ };
@@ -1,11 +1,8 @@
1
- /* empty css */
2
- import { jsx as e } from "react/jsx-runtime";
3
- //#region src/components/fullCalendar/fullCalendarContainer/index.tsx
4
- function t({ children: t }) {
5
- return /* @__PURE__ */ e("div", {
6
- className: "arkynFullCalendarContainer",
7
- children: t
8
- });
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ /* empty css */
3
+ function l({ children: r }) {
4
+ return /* @__PURE__ */ n("div", { className: "arkynFullCalendarContainer", children: r });
9
5
  }
10
- //#endregion
11
- export { t as FullCalendarContainer };
6
+ export {
7
+ l as FullCalendarContainer
8
+ };
@@ -1,69 +1,72 @@
1
- import { IconButton as e } from "../../iconButton/index.js";
1
+ import { jsxs as r, jsx as n } from "react/jsx-runtime";
2
+ import { ChevronLeft as s, ChevronRight as h } from "lucide-react";
2
3
  import { CardTabButton as t } from "../../cardTab/cardTabButton/index.js";
3
- import { CardTabContainer as n } from "../../cardTab/cardTabContainer/index.js";
4
- import { useFullCalendar as r } from "../_fullCalendarProvider.js";
5
- /* empty css */
6
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
- import { ChevronLeft as o, ChevronRight as s } from "lucide-react";
8
- //#region src/components/fullCalendar/fullCalendarHeader/index.tsx
9
- function c(c) {
10
- let { setViewType: l, viewType: u } = c, d = r();
11
- function f() {
12
- switch (u) {
13
- case "day": return d.previousDay();
14
- case "week": return d.previousWeek();
15
- case "month": return d.previousMonth();
16
- }
17
- }
18
- function p() {
19
- switch (u) {
20
- case "day": return d.nextDay();
21
- case "week": return d.nextWeek();
22
- case "month": return d.nextMonth();
23
- }
24
- }
25
- return /* @__PURE__ */ a("div", {
26
- className: "arkynFullCalendarHeader",
27
- children: [/* @__PURE__ */ a(n, {
28
- defaultValue: u,
29
- onChange: (e) => l(e),
30
- children: [
31
- /* @__PURE__ */ i(t, {
32
- value: "day",
33
- children: "Dia"
34
- }),
35
- /* @__PURE__ */ i(t, {
36
- value: "week",
37
- children: "Semana"
38
- }),
39
- /* @__PURE__ */ i(t, {
40
- value: "month",
41
- children: "Mês"
42
- })
43
- ]
44
- }), /* @__PURE__ */ a("div", {
45
- className: "arkynFullCalendarHeaderActions",
46
- children: [
47
- /* @__PURE__ */ i(e, {
48
- variant: "outline",
49
- icon: o,
50
- "aria-label": "Handle previous",
51
- onClick: () => f()
52
- }),
53
- /* @__PURE__ */ i("p", { children: d.viewDate.toLocaleDateString("pt-BR", {
54
- day: "2-digit",
55
- month: "long",
56
- year: "numeric"
57
- }) }),
58
- /* @__PURE__ */ i(e, {
59
- variant: "outline",
60
- icon: s,
61
- "aria-label": "Handle next",
62
- onClick: () => p()
63
- })
64
- ]
65
- })]
66
- });
4
+ import { CardTabContainer as m } from "../../cardTab/cardTabContainer/index.js";
5
+ import { IconButton as i } from "../../iconButton/index.js";
6
+ import { useFullCalendar as p } from "../_fullCalendarProvider.js";
7
+ /* empty css */
8
+ function g(o) {
9
+ const { setViewType: l, viewType: a } = o, e = p();
10
+ function u() {
11
+ switch (a) {
12
+ case "day":
13
+ return e.previousDay();
14
+ case "week":
15
+ return e.previousWeek();
16
+ case "month":
17
+ return e.previousMonth();
18
+ }
19
+ }
20
+ function c() {
21
+ switch (a) {
22
+ case "day":
23
+ return e.nextDay();
24
+ case "week":
25
+ return e.nextWeek();
26
+ case "month":
27
+ return e.nextMonth();
28
+ }
29
+ }
30
+ return /* @__PURE__ */ r("div", { className: "arkynFullCalendarHeader", children: [
31
+ /* @__PURE__ */ r(
32
+ m,
33
+ {
34
+ defaultValue: a,
35
+ onChange: (d) => l(d),
36
+ children: [
37
+ /* @__PURE__ */ n(t, { value: "day", children: "Dia" }),
38
+ /* @__PURE__ */ n(t, { value: "week", children: "Semana" }),
39
+ /* @__PURE__ */ n(t, { value: "month", children: "Mês" })
40
+ ]
41
+ }
42
+ ),
43
+ /* @__PURE__ */ r("div", { className: "arkynFullCalendarHeaderActions", children: [
44
+ /* @__PURE__ */ n(
45
+ i,
46
+ {
47
+ variant: "outline",
48
+ icon: s,
49
+ "aria-label": "Handle previous",
50
+ onClick: () => u()
51
+ }
52
+ ),
53
+ /* @__PURE__ */ n("p", { children: e.viewDate.toLocaleDateString("pt-BR", {
54
+ day: "2-digit",
55
+ month: "long",
56
+ year: "numeric"
57
+ }) }),
58
+ /* @__PURE__ */ n(
59
+ i,
60
+ {
61
+ variant: "outline",
62
+ icon: h,
63
+ "aria-label": "Handle next",
64
+ onClick: () => c()
65
+ }
66
+ )
67
+ ] })
68
+ ] });
67
69
  }
68
- //#endregion
69
- export { c as FullCalendarHeader };
70
+ export {
71
+ g as FullCalendarHeader
72
+ };