@redneckz/wildless-cms-uni-blocks 0.14.964 → 0.14.966

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 (230) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +168 -34
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +3 -0
  5. package/bundle/components/ApplicationForm/handlers.d.ts +2 -1
  6. package/bundle/retail/api/getTaskStatus.d.ts +3 -1
  7. package/bundle/retail/components/Fields/SelectField.d.ts +2 -0
  8. package/bundle/retail/model/LeadFormState.d.ts +1 -0
  9. package/bundle/retail/model/NameFieldDef.d.ts +1 -1
  10. package/bundle/ui-kit/DatePicker/Calendar.d.ts +1 -0
  11. package/bundle/ui-kit/DatePicker/DatePicker.d.ts +1 -0
  12. package/bundle/ui-kit/DatePicker/DatePickerControl.d.ts +1 -0
  13. package/bundle/ui-kit/DatePicker/renderCalendarCells.d.ts +2 -1
  14. package/dist/components/ApplicationForm/ApplicationForm.js +2 -1
  15. package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  16. package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +3 -0
  17. package/dist/components/ApplicationForm/handlers.d.ts +2 -1
  18. package/dist/components/ApplicationForm/handlers.js +20 -3
  19. package/dist/components/ApplicationForm/handlers.js.map +1 -1
  20. package/dist/components/DebitForm/DebitFormStatusTracker.js +6 -5
  21. package/dist/components/DebitForm/DebitFormStatusTracker.js.map +1 -1
  22. package/dist/components/DebitForm/DebitFormStepsData.js +67 -1
  23. package/dist/components/DebitForm/DebitFormStepsData.js.map +1 -1
  24. package/dist/components/DebitForm/formStateMap.js +1 -0
  25. package/dist/components/DebitForm/formStateMap.js.map +1 -1
  26. package/dist/components/DebitForm/useDebitFormAPI.js +1 -1
  27. package/dist/components/DebitForm/useDebitFormAPI.js.map +1 -1
  28. package/dist/retail/api/getTaskStatus.d.ts +3 -1
  29. package/dist/retail/api/getTaskStatus.js +2 -0
  30. package/dist/retail/api/getTaskStatus.js.map +1 -1
  31. package/dist/retail/components/Fields/CardCategoryField.js +18 -4
  32. package/dist/retail/components/Fields/CardCategoryField.js.map +1 -1
  33. package/dist/retail/components/Fields/DeliveryDateFiels.js +18 -1
  34. package/dist/retail/components/Fields/DeliveryDateFiels.js.map +1 -1
  35. package/dist/retail/components/Fields/DeliveryTimeField.js +14 -4
  36. package/dist/retail/components/Fields/DeliveryTimeField.js.map +1 -1
  37. package/dist/retail/components/Fields/RegionRetailField.js +4 -4
  38. package/dist/retail/components/Fields/RegionRetailField.js.map +1 -1
  39. package/dist/retail/components/Fields/SelectField.d.ts +2 -0
  40. package/dist/retail/components/Fields/SelectField.js +2 -2
  41. package/dist/retail/components/Fields/SelectField.js.map +1 -1
  42. package/dist/retail/model/LeadFormState.d.ts +1 -0
  43. package/dist/retail/model/NameFieldDef.d.ts +1 -1
  44. package/dist/ui-kit/DatePicker/Calendar.d.ts +1 -0
  45. package/dist/ui-kit/DatePicker/Calendar.js +2 -1
  46. package/dist/ui-kit/DatePicker/Calendar.js.map +1 -1
  47. package/dist/ui-kit/DatePicker/DatePicker.d.ts +1 -0
  48. package/dist/ui-kit/DatePicker/DatePicker.js +2 -2
  49. package/dist/ui-kit/DatePicker/DatePicker.js.map +1 -1
  50. package/dist/ui-kit/DatePicker/DatePickerControl.d.ts +1 -0
  51. package/dist/ui-kit/DatePicker/DatePickerControl.js.map +1 -1
  52. package/dist/ui-kit/DatePicker/renderCalendarCells.d.ts +2 -1
  53. package/dist/ui-kit/DatePicker/renderCalendarCells.js +13 -4
  54. package/dist/ui-kit/DatePicker/renderCalendarCells.js.map +1 -1
  55. package/lib/components/ApplicationForm/ApplicationForm.fixture.d.ts +1 -0
  56. package/lib/components/ApplicationForm/ApplicationForm.js +2 -1
  57. package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  58. package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +3 -0
  59. package/lib/components/ApplicationForm/handlers.d.ts +2 -1
  60. package/lib/components/ApplicationForm/handlers.js +20 -3
  61. package/lib/components/ApplicationForm/handlers.js.map +1 -1
  62. package/lib/components/DebitForm/DebitFormStatusTracker.js +6 -5
  63. package/lib/components/DebitForm/DebitFormStatusTracker.js.map +1 -1
  64. package/lib/components/DebitForm/DebitFormStepsData.js +67 -1
  65. package/lib/components/DebitForm/DebitFormStepsData.js.map +1 -1
  66. package/lib/components/DebitForm/formStateMap.js +1 -0
  67. package/lib/components/DebitForm/formStateMap.js.map +1 -1
  68. package/lib/components/DebitForm/useDebitFormAPI.js +1 -1
  69. package/lib/components/DebitForm/useDebitFormAPI.js.map +1 -1
  70. package/lib/retail/api/getTaskStatus.d.ts +3 -1
  71. package/lib/retail/api/getTaskStatus.js +2 -0
  72. package/lib/retail/api/getTaskStatus.js.map +1 -1
  73. package/lib/retail/components/Fields/CardCategoryField.js +18 -4
  74. package/lib/retail/components/Fields/CardCategoryField.js.map +1 -1
  75. package/lib/retail/components/Fields/DeliveryDateFiels.js +18 -1
  76. package/lib/retail/components/Fields/DeliveryDateFiels.js.map +1 -1
  77. package/lib/retail/components/Fields/DeliveryTimeField.js +14 -4
  78. package/lib/retail/components/Fields/DeliveryTimeField.js.map +1 -1
  79. package/lib/retail/components/Fields/RegionRetailField.js +4 -4
  80. package/lib/retail/components/Fields/RegionRetailField.js.map +1 -1
  81. package/lib/retail/components/Fields/SelectField.d.ts +2 -0
  82. package/lib/retail/components/Fields/SelectField.js +2 -2
  83. package/lib/retail/components/Fields/SelectField.js.map +1 -1
  84. package/lib/retail/model/LeadFormState.d.ts +1 -0
  85. package/lib/retail/model/NameFieldDef.d.ts +1 -1
  86. package/lib/ui-kit/DatePicker/Calendar.d.ts +1 -0
  87. package/lib/ui-kit/DatePicker/Calendar.js +2 -1
  88. package/lib/ui-kit/DatePicker/Calendar.js.map +1 -1
  89. package/lib/ui-kit/DatePicker/DatePicker.d.ts +1 -0
  90. package/lib/ui-kit/DatePicker/DatePicker.js +2 -2
  91. package/lib/ui-kit/DatePicker/DatePicker.js.map +1 -1
  92. package/lib/ui-kit/DatePicker/DatePickerControl.d.ts +1 -0
  93. package/lib/ui-kit/DatePicker/DatePickerControl.js.map +1 -1
  94. package/lib/ui-kit/DatePicker/renderCalendarCells.d.ts +2 -1
  95. package/lib/ui-kit/DatePicker/renderCalendarCells.js +13 -4
  96. package/lib/ui-kit/DatePicker/renderCalendarCells.js.map +1 -1
  97. package/mobile/bundle/bundle.umd.js +168 -34
  98. package/mobile/bundle/bundle.umd.min.js +1 -1
  99. package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +3 -0
  100. package/mobile/bundle/components/ApplicationForm/handlers.d.ts +2 -1
  101. package/mobile/bundle/retail/api/getTaskStatus.d.ts +3 -1
  102. package/mobile/bundle/retail/components/Fields/SelectField.d.ts +2 -0
  103. package/mobile/bundle/retail/model/LeadFormState.d.ts +1 -0
  104. package/mobile/bundle/retail/model/NameFieldDef.d.ts +1 -1
  105. package/mobile/bundle/ui-kit/DatePicker/Calendar.d.ts +1 -0
  106. package/mobile/bundle/ui-kit/DatePicker/DatePicker.d.ts +1 -0
  107. package/mobile/bundle/ui-kit/DatePicker/DatePickerControl.d.ts +1 -0
  108. package/mobile/bundle/ui-kit/DatePicker/renderCalendarCells.d.ts +2 -1
  109. package/mobile/dist/components/ApplicationForm/ApplicationForm.js +2 -1
  110. package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  111. package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +3 -0
  112. package/mobile/dist/components/ApplicationForm/handlers.d.ts +2 -1
  113. package/mobile/dist/components/ApplicationForm/handlers.js +20 -3
  114. package/mobile/dist/components/ApplicationForm/handlers.js.map +1 -1
  115. package/mobile/dist/components/DebitForm/DebitFormStatusTracker.js +6 -5
  116. package/mobile/dist/components/DebitForm/DebitFormStatusTracker.js.map +1 -1
  117. package/mobile/dist/components/DebitForm/DebitFormStepsData.js +67 -1
  118. package/mobile/dist/components/DebitForm/DebitFormStepsData.js.map +1 -1
  119. package/mobile/dist/components/DebitForm/formStateMap.js +1 -0
  120. package/mobile/dist/components/DebitForm/formStateMap.js.map +1 -1
  121. package/mobile/dist/components/DebitForm/useDebitFormAPI.js +1 -1
  122. package/mobile/dist/components/DebitForm/useDebitFormAPI.js.map +1 -1
  123. package/mobile/dist/retail/api/getTaskStatus.d.ts +3 -1
  124. package/mobile/dist/retail/api/getTaskStatus.js +2 -0
  125. package/mobile/dist/retail/api/getTaskStatus.js.map +1 -1
  126. package/mobile/dist/retail/components/Fields/CardCategoryField.js +18 -4
  127. package/mobile/dist/retail/components/Fields/CardCategoryField.js.map +1 -1
  128. package/mobile/dist/retail/components/Fields/DeliveryDateFiels.js +18 -1
  129. package/mobile/dist/retail/components/Fields/DeliveryDateFiels.js.map +1 -1
  130. package/mobile/dist/retail/components/Fields/DeliveryTimeField.js +14 -4
  131. package/mobile/dist/retail/components/Fields/DeliveryTimeField.js.map +1 -1
  132. package/mobile/dist/retail/components/Fields/RegionRetailField.js +4 -4
  133. package/mobile/dist/retail/components/Fields/RegionRetailField.js.map +1 -1
  134. package/mobile/dist/retail/components/Fields/SelectField.d.ts +2 -0
  135. package/mobile/dist/retail/components/Fields/SelectField.js +2 -2
  136. package/mobile/dist/retail/components/Fields/SelectField.js.map +1 -1
  137. package/mobile/dist/retail/model/LeadFormState.d.ts +1 -0
  138. package/mobile/dist/retail/model/NameFieldDef.d.ts +1 -1
  139. package/mobile/dist/ui-kit/DatePicker/Calendar.d.ts +1 -0
  140. package/mobile/dist/ui-kit/DatePicker/Calendar.js +2 -1
  141. package/mobile/dist/ui-kit/DatePicker/Calendar.js.map +1 -1
  142. package/mobile/dist/ui-kit/DatePicker/DatePicker.d.ts +1 -0
  143. package/mobile/dist/ui-kit/DatePicker/DatePicker.js +2 -2
  144. package/mobile/dist/ui-kit/DatePicker/DatePicker.js.map +1 -1
  145. package/mobile/dist/ui-kit/DatePicker/DatePickerControl.d.ts +1 -0
  146. package/mobile/dist/ui-kit/DatePicker/DatePickerControl.js.map +1 -1
  147. package/mobile/dist/ui-kit/DatePicker/renderCalendarCells.d.ts +2 -1
  148. package/mobile/dist/ui-kit/DatePicker/renderCalendarCells.js +13 -4
  149. package/mobile/dist/ui-kit/DatePicker/renderCalendarCells.js.map +1 -1
  150. package/mobile/lib/components/ApplicationForm/ApplicationForm.js +2 -1
  151. package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  152. package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +3 -0
  153. package/mobile/lib/components/ApplicationForm/handlers.d.ts +2 -1
  154. package/mobile/lib/components/ApplicationForm/handlers.js +20 -3
  155. package/mobile/lib/components/ApplicationForm/handlers.js.map +1 -1
  156. package/mobile/lib/components/DebitForm/DebitFormStatusTracker.js +6 -5
  157. package/mobile/lib/components/DebitForm/DebitFormStatusTracker.js.map +1 -1
  158. package/mobile/lib/components/DebitForm/DebitFormStepsData.js +67 -1
  159. package/mobile/lib/components/DebitForm/DebitFormStepsData.js.map +1 -1
  160. package/mobile/lib/components/DebitForm/formStateMap.js +1 -0
  161. package/mobile/lib/components/DebitForm/formStateMap.js.map +1 -1
  162. package/mobile/lib/components/DebitForm/useDebitFormAPI.js +1 -1
  163. package/mobile/lib/components/DebitForm/useDebitFormAPI.js.map +1 -1
  164. package/mobile/lib/retail/api/getTaskStatus.d.ts +3 -1
  165. package/mobile/lib/retail/api/getTaskStatus.js +2 -0
  166. package/mobile/lib/retail/api/getTaskStatus.js.map +1 -1
  167. package/mobile/lib/retail/components/Fields/CardCategoryField.js +18 -4
  168. package/mobile/lib/retail/components/Fields/CardCategoryField.js.map +1 -1
  169. package/mobile/lib/retail/components/Fields/DeliveryDateFiels.js +18 -1
  170. package/mobile/lib/retail/components/Fields/DeliveryDateFiels.js.map +1 -1
  171. package/mobile/lib/retail/components/Fields/DeliveryTimeField.js +14 -4
  172. package/mobile/lib/retail/components/Fields/DeliveryTimeField.js.map +1 -1
  173. package/mobile/lib/retail/components/Fields/RegionRetailField.js +4 -4
  174. package/mobile/lib/retail/components/Fields/RegionRetailField.js.map +1 -1
  175. package/mobile/lib/retail/components/Fields/SelectField.d.ts +2 -0
  176. package/mobile/lib/retail/components/Fields/SelectField.js +2 -2
  177. package/mobile/lib/retail/components/Fields/SelectField.js.map +1 -1
  178. package/mobile/lib/retail/model/LeadFormState.d.ts +1 -0
  179. package/mobile/lib/retail/model/NameFieldDef.d.ts +1 -1
  180. package/mobile/lib/ui-kit/DatePicker/Calendar.d.ts +1 -0
  181. package/mobile/lib/ui-kit/DatePicker/Calendar.js +2 -1
  182. package/mobile/lib/ui-kit/DatePicker/Calendar.js.map +1 -1
  183. package/mobile/lib/ui-kit/DatePicker/DatePicker.d.ts +1 -0
  184. package/mobile/lib/ui-kit/DatePicker/DatePicker.js +2 -2
  185. package/mobile/lib/ui-kit/DatePicker/DatePicker.js.map +1 -1
  186. package/mobile/lib/ui-kit/DatePicker/DatePickerControl.d.ts +1 -0
  187. package/mobile/lib/ui-kit/DatePicker/DatePickerControl.js.map +1 -1
  188. package/mobile/lib/ui-kit/DatePicker/renderCalendarCells.d.ts +2 -1
  189. package/mobile/lib/ui-kit/DatePicker/renderCalendarCells.js +13 -4
  190. package/mobile/lib/ui-kit/DatePicker/renderCalendarCells.js.map +1 -1
  191. package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +2 -0
  192. package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +3 -0
  193. package/mobile/src/components/ApplicationForm/handlers.ts +26 -3
  194. package/mobile/src/components/DebitForm/DebitFormStatusTracker.tsx +6 -6
  195. package/mobile/src/components/DebitForm/DebitFormStepsData.tsx +67 -1
  196. package/mobile/src/components/DebitForm/formStateMap.tsx +1 -0
  197. package/mobile/src/components/DebitForm/useDebitFormAPI.tsx +1 -1
  198. package/mobile/src/retail/api/getTaskStatus.ts +2 -0
  199. package/mobile/src/retail/components/Fields/CardCategoryField.tsx +24 -3
  200. package/mobile/src/retail/components/Fields/DeliveryDateFiels.tsx +29 -3
  201. package/mobile/src/retail/components/Fields/DeliveryTimeField.tsx +16 -8
  202. package/mobile/src/retail/components/Fields/RegionRetailField.tsx +5 -5
  203. package/mobile/src/retail/components/Fields/SelectField.tsx +3 -0
  204. package/mobile/src/retail/model/LeadFormState.ts +1 -0
  205. package/mobile/src/retail/model/NameFieldDef.ts +1 -0
  206. package/mobile/src/ui-kit/DatePicker/Calendar.tsx +3 -1
  207. package/mobile/src/ui-kit/DatePicker/DatePicker.tsx +13 -1
  208. package/mobile/src/ui-kit/DatePicker/DatePickerControl.tsx +1 -0
  209. package/mobile/src/ui-kit/DatePicker/renderCalendarCells.tsx +18 -5
  210. package/package.json +1 -1
  211. package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +25 -0
  212. package/src/components/ApplicationForm/ApplicationForm.tsx +2 -0
  213. package/src/components/ApplicationForm/ApplicationFormContent.ts +3 -0
  214. package/src/components/ApplicationForm/handlers.ts +26 -3
  215. package/src/components/DebitForm/DebitFormStatusTracker.tsx +6 -6
  216. package/src/components/DebitForm/DebitFormStepsData.tsx +67 -1
  217. package/src/components/DebitForm/formStateMap.tsx +1 -0
  218. package/src/components/DebitForm/useDebitFormAPI.tsx +1 -1
  219. package/src/retail/api/getTaskStatus.ts +2 -0
  220. package/src/retail/components/Fields/CardCategoryField.tsx +24 -3
  221. package/src/retail/components/Fields/DeliveryDateFiels.tsx +29 -3
  222. package/src/retail/components/Fields/DeliveryTimeField.tsx +16 -8
  223. package/src/retail/components/Fields/RegionRetailField.tsx +5 -5
  224. package/src/retail/components/Fields/SelectField.tsx +3 -0
  225. package/src/retail/model/LeadFormState.ts +1 -0
  226. package/src/retail/model/NameFieldDef.ts +1 -0
  227. package/src/ui-kit/DatePicker/Calendar.tsx +3 -1
  228. package/src/ui-kit/DatePicker/DatePicker.tsx +13 -1
  229. package/src/ui-kit/DatePicker/DatePickerControl.tsx +1 -0
  230. package/src/ui-kit/DatePicker/renderCalendarCells.tsx +18 -5
@@ -1906,11 +1906,28 @@
1906
1906
  }
1907
1907
  }
1908
1908
  };
1909
- const handleDefault = async ({ formatData, data, aspects = {}, ev, router, responseTypeDialog, endpoint, }) => {
1910
- const ok = Boolean(await API$2.send(formatData, router, endpoint === 'lead'));
1909
+ const handleDefault = async ({ formatData, data, aspects = {}, ev, router, responseTypeDialog, endpoint, withSnowplow, }) => {
1910
+ const response = await API$2.send(formatData, router, endpoint === 'lead');
1911
+ const ok = Boolean(response);
1911
1912
  responseTypeDialog.open({ ok });
1912
1913
  if (ok) {
1913
- handleAspects({ aspectsAttributes: data, aspects, ev });
1914
+ const { requestId } = response;
1915
+ const { phone } = formatData;
1916
+ const utms = router.pathname.split('?')[1];
1917
+ const eventJSON = JSON.stringify({
1918
+ id: requestId,
1919
+ phone: String(phone),
1920
+ utm: utms,
1921
+ });
1922
+ const snowplowAspect = {
1923
+ aspectName: 'snowplowEvent',
1924
+ params: {
1925
+ eventAction: 'clickdepapl',
1926
+ eventJSON,
1927
+ },
1928
+ };
1929
+ const aspectsData = withSnowplow ? [...(data ?? []), snowplowAspect] : data;
1930
+ handleAspects({ aspectsAttributes: aspectsData, aspects, ev });
1914
1931
  }
1915
1932
  };
1916
1933
 
@@ -2187,7 +2204,7 @@
2187
2204
 
2188
2205
  const DAY_COUNT = 6;
2189
2206
  const WEEK_COUNT = 7;
2190
- const renderCalendarCells = ({ today, firstDayOfWeek, totalDays, currentMonth, currentYear, min, max, onDateClick, }) => {
2207
+ const renderCalendarCells = ({ today, firstDayOfWeek, totalDays, currentMonth, currentYear, min, max, weekends, onDateClick, }) => {
2191
2208
  const calendarCells = [];
2192
2209
  let dayCounter = 1;
2193
2210
  for (let i = 0; i < DAY_COUNT; i++) {
@@ -2203,7 +2220,9 @@
2203
2220
  const currentDate = new Date(currentYear, currentMonth, dayCounter);
2204
2221
  const isToday = checkIsToday(currentDate, today);
2205
2222
  const isDisabled = checkIsDisabled(currentDate, min, max);
2206
- rowCells.push(jsx("td", { children: jsx("div", { className: getDayStyles(isToday, isDisabled), onClick: () => !isDisabled && onDateClick(currentDate), children: dayCounter }) }, `day-${dayCounter}`));
2223
+ const isWeekend = checkIsWeekend(currentDate, weekends);
2224
+ const isBlocked = isDisabled || isWeekend;
2225
+ rowCells.push(jsx("td", { children: jsx("div", { className: getDayStyles(isToday, isBlocked), onClick: () => !isBlocked && onDateClick(currentDate), children: dayCounter }) }, `day-${dayCounter}`));
2207
2226
  dayCounter++;
2208
2227
  }
2209
2228
  }
@@ -2213,12 +2232,19 @@
2213
2232
  };
2214
2233
  const checkIsToday = (currentDate, today) => today && currentDate.toDateString() === today.toDateString();
2215
2234
  const checkIsDisabled = (currentDate, min, max) => (min && currentDate.getTime() < min.getTime()) || (max && currentDate.getTime() > max.getTime());
2216
- const getDayStyles = (isToday = false, isDisabled = false) => style('p-s text-center rounded-md border', {
2235
+ const checkIsWeekend = (currentDate, weekends) => {
2236
+ if (!weekends || weekends.length === 0) {
2237
+ return false;
2238
+ }
2239
+ const dayOfWeek = currentDate.getDay() === 0 ? 7 : currentDate.getDay();
2240
+ return weekends.includes(dayOfWeek);
2241
+ };
2242
+ const getDayStyles = (isToday = false, isBlocked = false) => style('p-s text-center rounded-md border', {
2217
2243
  'border-transparent hover:bg-gray': !isToday,
2218
- }, isDisabled ? 'text-gray hover:bg-transparent' : 'cursor-pointer');
2244
+ }, isBlocked ? 'text-gray hover:bg-transparent' : 'cursor-pointer');
2219
2245
 
2220
2246
  const WEEK_DAYS = ['Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс'];
2221
- const Calendar = JSX(({ today, currentMonth, currentYear, min, max, onDateSelect = noop }) => {
2247
+ const Calendar = JSX(({ today, currentMonth, currentYear, min, max, weekends, onDateSelect = noop }) => {
2222
2248
  const { firstDayOfWeek, totalDays } = useMemo(() => ({
2223
2249
  firstDayOfWeek: new Date(currentYear, currentMonth, 1).getDay() - 1,
2224
2250
  totalDays: new Date(currentYear, currentMonth + 1, 0).getDate(),
@@ -2231,6 +2257,7 @@
2231
2257
  currentMonth,
2232
2258
  min,
2233
2259
  max,
2260
+ weekends,
2234
2261
  onDateClick: onDateSelect,
2235
2262
  }) })] }));
2236
2263
  });
@@ -2425,7 +2452,7 @@
2425
2452
  };
2426
2453
  const DatePicker = JSX(
2427
2454
  // eslint-disable-next-line max-lines-per-function
2428
- ({ className = '', label = '', value, valid = true, minDate, maxDate, disabled, onChange }) => {
2455
+ ({ className = '', label = '', value, valid = true, minDate, maxDate, disabled, weekends, onChange, }) => {
2429
2456
  const [isCalendarVisible, { setValue, setFalse: hideCalendar }] = useBool(false);
2430
2457
  const [selectedMonth, setSelectedMonth] = useState(value?.getMonth() || new Date().getMonth());
2431
2458
  const [selectedYear, setSelectedYear] = useState(value?.getFullYear() ?? new Date().getFullYear());
@@ -2454,7 +2481,7 @@
2454
2481
  setSelectedYear,
2455
2482
  }), isCalendarVisible && !disabled ? (jsxs("div", { className: style('absolute bg-white z-20 select-none', {
2456
2483
  'bottom-full': spaceAbove,
2457
- }), children: [jsxs("div", { className: "flex gap-s", children: [jsx("div", { className: "my-auto", onClick: handlePrevMonth, children: jsx(Icon, { ...ICON_PROPS, className: "-rotate-90 cursor-pointer" }) }), jsx(Select, { onChange: handleSelectMonth, value: { key: months[selectedMonth] }, options: monthsOptions, ...SELECT_PROPS }), jsx(Select, { onChange: handleSelectYear, value: { key: String(selectedYear) }, options: yearsOptions, ...SELECT_PROPS }), jsx("div", { className: "my-auto", onClick: handleNextMonth, children: jsx(Icon, { ...ICON_PROPS, className: "rotate-90 cursor-pointer" }) })] }), jsx(Calendar, { today: value, currentMonth: selectedMonth, currentYear: selectedYear, min: minDate, max: maxDate, onDateSelect: handleDateSelect })] })) : null] })] }));
2484
+ }), children: [jsxs("div", { className: "flex gap-s", children: [jsx("div", { className: "my-auto", onClick: handlePrevMonth, children: jsx(Icon, { ...ICON_PROPS, className: "-rotate-90 cursor-pointer" }) }), jsx(Select, { onChange: handleSelectMonth, value: { key: months[selectedMonth] }, options: monthsOptions, ...SELECT_PROPS }), jsx(Select, { onChange: handleSelectYear, value: { key: String(selectedYear) }, options: yearsOptions, ...SELECT_PROPS }), jsx("div", { className: "my-auto", onClick: handleNextMonth, children: jsx(Icon, { ...ICON_PROPS, className: "rotate-90 cursor-pointer" }) })] }), jsx(Calendar, { today: value, currentMonth: selectedMonth, currentYear: selectedYear, min: minDate, max: maxDate, weekends: weekends, onDateSelect: handleDateSelect })] })) : null] })] }));
2458
2485
  });
2459
2486
 
2460
2487
  const DatePickerControl = JSX(({ className, label, error, required, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(DatePicker, { label: getRequiredLabel({ label, required }), valid: Boolean(!error), ...rest }), renderErrorText(error)] })));
@@ -3033,7 +3060,7 @@
3033
3060
  };
3034
3061
  const ApplicationForm = UniBlock(
3035
3062
  // eslint-disable-next-line max-lines-per-function
3036
- ({ className, title, typeForm = '', sections = [], button, link, endpoint, additionalParams, isContacts, data, onSuccess, ...rest }) => {
3063
+ ({ className, title, typeForm = '', sections = [], button, link, endpoint, additionalParams, withSnowplow, isContacts, data, onSuccess, ...rest }) => {
3037
3064
  const inputs = useMemo(() => (sections?.flatMap((_) => _?.inputs) || []), [sections]);
3038
3065
  const initialFormState = useMemo(() => getInitialFormState$2(inputs, typeForm), [inputs, typeForm]);
3039
3066
  const router = useRouter();
@@ -3054,6 +3081,7 @@
3054
3081
  verifyPhoneDialog,
3055
3082
  onSuccess,
3056
3083
  endpoint,
3084
+ withSnowplow,
3057
3085
  });
3058
3086
  }, [typeForm]);
3059
3087
  const [, { field, onSubmit }] = useForm(initialFormState, {
@@ -4578,12 +4606,12 @@
4578
4606
 
4579
4607
  const SelectField = UniBlock(({ field, source, fieldName, placeholder = 'Выберите из списка',
4580
4608
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
4581
- options, ...rest }) => {
4609
+ options, onChange, ...rest }) => {
4582
4610
  const leadOptions = source?.map((_) => ({
4583
4611
  key: _.key || '',
4584
4612
  text: _.value,
4585
4613
  })) || [];
4586
- return (jsx(SelectControl, { placeholder: placeholder, options: leadOptions, ...field(fieldName), ...rest }));
4614
+ return (jsx(SelectControl, { placeholder: placeholder, options: leadOptions, ...field(fieldName), ...rest, onChange: onChange ?? field(fieldName)?.onChange }));
4587
4615
  });
4588
4616
 
4589
4617
  const AmountWorkersField = JSX(({ field, input }) => {
@@ -4651,29 +4679,42 @@
4651
4679
  const CardCategoryField = JSX(({ field, input }) => {
4652
4680
  const [cardTypes, setCardTypes] = useState([]);
4653
4681
  const [programId] = useLocalStorage('programId');
4682
+ const { productType } = useRetailFormStore();
4683
+ const isSalaryCard = programId === '38';
4684
+ const isDebit = productType === 'debitCard';
4685
+ const isEsiaAuth = Boolean(field('esiaAccountTypeCd')?.value?.key);
4654
4686
  const { value: selectedCardCategory, onChange: cardCategoryChange } = field('cardCategory');
4655
4687
  const selectedPaymentSystem = field('paymentSystem')?.value?.key;
4688
+ const handleChangeIsMomentDebitCard = field('isMomentDebitCard')?.onChange;
4656
4689
  const getCardCategoryValue = useCallback((fetchedCardTypes) => fetchedCardTypes.length === 1
4657
4690
  ? {
4658
4691
  key: fetchedCardTypes[0].key,
4659
4692
  text: fetchedCardTypes[0].value,
4660
4693
  }
4661
4694
  : null, []);
4695
+ const onChange = useCallback((value) => {
4696
+ cardCategoryChange?.(value);
4697
+ handleChangeIsMomentDebitCard?.(value?.text?.toLowerCase()?.includes('неимен'));
4698
+ }, []);
4662
4699
  useEffect(() => {
4663
4700
  if (selectedPaymentSystem && programId) {
4664
4701
  (async () => {
4665
4702
  const fetchedCardTypes = await getCardTypes(selectedPaymentSystem, programId);
4666
- setCardTypes(fetchedCardTypes);
4667
- if (!isValidCardCategory(fetchedCardTypes, selectedCardCategory)) {
4668
- cardCategoryChange?.(getCardCategoryValue(fetchedCardTypes));
4703
+ const actualCardTypes = isDebit && !isEsiaAuth && !isSalaryCard
4704
+ ? excludeSomeСategoriesCards(fetchedCardTypes)
4705
+ : fetchedCardTypes;
4706
+ setCardTypes(actualCardTypes);
4707
+ if (!isValidCardCategory(actualCardTypes, selectedCardCategory)) {
4708
+ cardCategoryChange?.(getCardCategoryValue(actualCardTypes));
4669
4709
  }
4670
4710
  })();
4671
4711
  }
4672
4712
  }, [selectedPaymentSystem, getCardCategoryValue]);
4673
4713
  const description = useMemo(() => cardTypes?.find((_) => _.key === selectedCardCategory?.key)?.description, [cardTypes, selectedCardCategory]);
4674
- return (jsxs("div", { children: [jsx(SelectField, { field: field, source: cardTypes, label: "\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F \u043A\u0430\u0440\u0442\u044B", fieldName: "cardCategory", input: input }), description ? jsx(InfoCard, { __html: description }) : null] }));
4714
+ return (jsxs("div", { children: [jsx(SelectField, { field: field, source: cardTypes, label: "\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F \u043A\u0430\u0440\u0442\u044B", fieldName: "cardCategory", input: input, onChange: onChange }), description ? jsx(InfoCard, { __html: description }) : null] }));
4675
4715
  });
4676
4716
  const isValidCardCategory = (cardTypes, selectedCardCategory) => cardTypes.some((cardType) => cardType.key === selectedCardCategory?.key);
4717
+ const excludeSomeСategoriesCards = (cardTypes) => cardTypes.filter((cardType) => cardType.value && cardType.value.toLowerCase().includes(' именная'));
4677
4718
 
4678
4719
  const ChildrenField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0434\u0435\u0442\u0435\u0439 \u0434\u043E 18 \u043B\u0435\u0442", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, type: "number", ...field(input?.name ?? ''), ...input })));
4679
4720
 
@@ -5272,14 +5313,37 @@
5272
5313
  return [employerOrganization, organization, amountWorkers, employerActivities].every(Boolean);
5273
5314
  };
5274
5315
 
5275
- const DeliveryDateFiels = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438", ...field(input?.name ?? ''), minDate: new Date() })));
5316
+ const MIN_DATE = new Date(Date.now() + 1 * 24 * 60 * 60 * 1000);
5317
+ const DeliveryDateFiels = JSX(({ field, input }) => {
5318
+ const { productType } = useRetailFormStore();
5319
+ const isDebit = productType === 'debitCard';
5320
+ const minDate = isDebit ? MIN_DATE : new Date();
5321
+ const { data } = useLeadFormData('DAYS_DELIVERY_SETTINGS');
5322
+ const weekends = useMemo(() => {
5323
+ const weekendItem = data?.find((item) => item.key === 'WEEKEND');
5324
+ if (weekendItem && weekendItem.value) {
5325
+ return weekendItem.value.split(',').map(Number);
5326
+ }
5327
+ return [];
5328
+ }, [data]);
5329
+ return (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438", ...field(input?.name ?? ''), minDate: minDate, weekends: isDebit ? weekends : [] }));
5330
+ });
5276
5331
 
5277
5332
  const DeliveryTimeField = JSX(({ field, input }) => {
5333
+ const { productType } = useRetailFormStore();
5334
+ const isDebit = productType === 'debitCard';
5278
5335
  const { data } = useLeadFormData('COURIER_DELIVERY_TIME');
5279
- const deliveryTime = useMemo(() => data?.map((_) => ({
5280
- id: _.key,
5281
- text: _.value,
5282
- })) ?? [], [data]);
5336
+ const creditDeliveryTime = ['TIME_1', 'TIME_2', 'TIME_3'];
5337
+ const debitDeliveryTime = ['TIME_4', 'TIME_5'];
5338
+ const deliveryTime = useMemo(() => {
5339
+ const allowedTimes = isDebit ? debitDeliveryTime : creditDeliveryTime;
5340
+ return (data || [])
5341
+ .filter((item) => item.key && allowedTimes.includes(item.key))
5342
+ .map((item) => ({
5343
+ id: item.key,
5344
+ text: item.value,
5345
+ }));
5346
+ }, [data, isDebit]);
5283
5347
  return (jsx(RadioButtonGroupControl, { label: "\u0412\u0440\u0435\u043C\u044F \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438", className: "flex-row", items: deliveryTime, ...field(input?.name ?? '') }));
5284
5348
  });
5285
5349
 
@@ -5636,11 +5700,11 @@
5636
5700
  };
5637
5701
 
5638
5702
  const RegionRetailField = JSX(({ field, input }) => {
5639
- const { programId, productType } = useRetailFormStore();
5703
+ const { productType } = useRetailFormStore();
5640
5704
  const { data: regions } = useLeadFormData('REGION_RF');
5641
5705
  const { data: regionsDelivery } = useAsyncData('regionsDelivery', getRegionsCardDelivery);
5642
5706
  const { data: productSettings } = useLeadFormData(getCurrentProductSettings(productType));
5643
- const isSalaryCard = programId === '38';
5707
+ const isEsiaAuth = field('esiaAccountTypeCd')?.value?.key;
5644
5708
  const formatRegions = regions?.map(({ key, value }) => ({ key, text: value }));
5645
5709
  const isDeliveryActive = productSettings?.find((_) => _?.key === 'DELIVERY_ACTIVE')?.value === 'true';
5646
5710
  const handleChangeRegion = field('regionRetail')?.onChange;
@@ -5649,11 +5713,11 @@
5649
5713
  const onChange = useCallback((value) => {
5650
5714
  const regionHasDelivery = isDeliveryActive &&
5651
5715
  regionsDelivery?.find((_) => _.regionCode === value.key)?.deliveryFlg &&
5652
- !isSalaryCard;
5716
+ Boolean(isEsiaAuth);
5653
5717
  handleChangeRegionHasDelivery?.(regionHasDelivery);
5654
5718
  handleChangeMethodObtain?.(regionHasDelivery ? 'courier' : 'office');
5655
5719
  handleChangeRegion?.(value);
5656
- }, [regionsDelivery, isDeliveryActive]);
5720
+ }, [regionsDelivery, isDeliveryActive, isEsiaAuth]);
5657
5721
  return (jsx(SelectControl, { label: "\u0420\u0435\u0433\u0438\u043E\u043D", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0433\u0438\u043E\u043D", isSearch: true, options: formatRegions, ...field(input?.name ?? ''), onChange: onChange }));
5658
5722
  });
5659
5723
  const getCurrentProductSettings = (productType) => productType === 'debitCard' ? 'DEBIT_CARD_LEAD_PROCESS_SETTINGS' : 'CREDIT_LEAD_PROCESS_SETTINGS';
@@ -8834,6 +8898,8 @@
8834
8898
  STATUS_TYPE["dboClient"] = "DBO_CLIENT";
8835
8899
  STATUS_TYPE["clientNotOk"] = "CLIENT_NOT_OK";
8836
8900
  STATUS_TYPE["notFound"] = "NOT_FOUND";
8901
+ STATUS_TYPE["clientFound"] = "CLIENT_FOUND";
8902
+ STATUS_TYPE["newClient"] = "NEW_CLIENT";
8837
8903
  })(STATUS_TYPE || (STATUS_TYPE = {}));
8838
8904
  const getTaskStatus = (body) => fetchRetailJSON('/user-data/getTaskStatus', 'POST', body);
8839
8905
 
@@ -10510,11 +10576,10 @@
10510
10576
  signalType: 'FIND_PERSON_SIGNAL',
10511
10577
  taskId,
10512
10578
  });
10513
- isOffice &&
10514
- (await sendSignalToProcess({
10515
- signalType: 'SET_PERSON_SIGNAL',
10516
- taskId,
10517
- }));
10579
+ await sendSignalToProcess({
10580
+ signalType: 'SET_PERSON_SIGNAL',
10581
+ taskId,
10582
+ });
10518
10583
  setStatus(statusCd || STATUS_TYPE.notFound);
10519
10584
  })();
10520
10585
  }, [taskId]);
@@ -10525,6 +10590,8 @@
10525
10590
  IN_PROCESS: jsx(PendingStatusContent, {}),
10526
10591
  NOT_FOUND: jsx(FailedStatusContent, {}),
10527
10592
  CLIENT_NOT_OK: jsx(FailedStatusContent, {}),
10593
+ NEW_CLIENT: jsx(SuccessStatusContent, { isOffice: isOffice }),
10594
+ CLIENT_FOUND: jsx(SuccessStatusContent, { isOffice: isOffice }),
10528
10595
  DBO_CLIENT: isSalaryCard ? jsx(SalaryDboClientStatusContent, {}) : jsx(DboClientStatusContent, {}),
10529
10596
  PRE_DECISION: jsx(SuccessStatusContent, { isOffice: isOffice }), //
10530
10597
  };
@@ -10577,6 +10644,7 @@
10577
10644
  },
10578
10645
  {
10579
10646
  paymentSystem: { key: '', text: '' },
10647
+ isMomentDebitCard: true,
10580
10648
  currency: '810',
10581
10649
  codeWord: '',
10582
10650
  latinName: '',
@@ -10684,7 +10752,7 @@
10684
10752
  formData: formData,
10685
10753
  }));
10686
10754
  }
10687
- if (isFinalStep || formData.methodObtain === 'courier') {
10755
+ if (isFinalStep) {
10688
10756
  onFinish?.();
10689
10757
  resetForm();
10690
10758
  }
@@ -10789,6 +10857,30 @@
10789
10857
  },
10790
10858
  ],
10791
10859
  },
10860
+ {
10861
+ inputs: [
10862
+ {
10863
+ name: 'deliveryDate',
10864
+ condition: {
10865
+ name: 'methodObtain',
10866
+ values: ['courier'],
10867
+ },
10868
+ required: true,
10869
+ },
10870
+ ],
10871
+ },
10872
+ {
10873
+ inputs: [
10874
+ {
10875
+ name: 'deliveryTime',
10876
+ condition: {
10877
+ name: 'methodObtain',
10878
+ values: ['courier'],
10879
+ },
10880
+ required: true,
10881
+ },
10882
+ ],
10883
+ },
10792
10884
  {
10793
10885
  inputs: [
10794
10886
  {
@@ -10864,6 +10956,20 @@
10864
10956
  },
10865
10957
  ],
10866
10958
  },
10959
+ {
10960
+ inputs: [
10961
+ {
10962
+ name: 'infoCard',
10963
+ condition: {
10964
+ name: 'methodObtain',
10965
+ values: ['courier'],
10966
+ },
10967
+ label:
10968
+ // eslint-disable-next-line max-len
10969
+ 'Проверьте полученные данные с портала Государственных услуг. При наличии ошибки, закройте заявку и оформите заявку заново без авторизации через портал Государственных услуг.',
10970
+ },
10971
+ ],
10972
+ },
10867
10973
  ];
10868
10974
  const DEBIT_CARD_CONTENT = [
10869
10975
  {
@@ -10880,16 +10986,40 @@
10880
10986
  {
10881
10987
  title: 'Отображение на карте',
10882
10988
  inputs: [],
10989
+ condition: {
10990
+ name: 'isMomentDebitCard',
10991
+ values: [false],
10992
+ },
10883
10993
  },
10884
10994
  {
10885
10995
  columns: 2,
10886
- inputs: [{ name: 'latinName' }, { name: 'latinSurname', required: true }],
10996
+ inputs: [
10997
+ {
10998
+ name: 'latinName',
10999
+ condition: {
11000
+ name: 'isMomentDebitCard',
11001
+ values: [false],
11002
+ },
11003
+ },
11004
+ {
11005
+ name: 'latinSurname',
11006
+ required: true,
11007
+ condition: {
11008
+ name: 'isMomentDebitCard',
11009
+ values: [false],
11010
+ },
11011
+ },
11012
+ ],
10887
11013
  },
10888
11014
  {
10889
11015
  inputs: [
10890
11016
  {
10891
11017
  name: 'infoCard',
10892
11018
  label: 'Проверьте корректность заполненных полей, при необходимости внесите изменения.',
11019
+ condition: {
11020
+ name: 'isMomentDebitCard',
11021
+ values: [false],
11022
+ },
10893
11023
  },
10894
11024
  ],
10895
11025
  },
@@ -10903,6 +11033,10 @@
10903
11033
  label:
10904
11034
  // eslint-disable-next-line max-len
10905
11035
  'Количество символов ограничивается 20. При этом, если фамилия и имя на карте содержит более 21 символа, то необходимо сократить имя и указывать на карте только первую букву имени и фамилию, если при таком сокращении фамилия и имя не умещается в количество символов – 20, то указывать только фамилию.',
11036
+ condition: {
11037
+ name: 'isMomentDebitCard',
11038
+ values: [false],
11039
+ },
10906
11040
  },
10907
11041
  ],
10908
11042
  },
@@ -12900,7 +13034,7 @@
12900
13034
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
12901
13035
  });
12902
13036
 
12903
- const packageVersion = "0.14.963";
13037
+ const packageVersion = "0.14.965";
12904
13038
 
12905
13039
  exports.Blocks = Blocks;
12906
13040
  exports.ContentPage = ContentPage;