@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
@@ -1914,11 +1914,28 @@
1914
1914
  }
1915
1915
  }
1916
1916
  };
1917
- const handleDefault = async ({ formatData, data, aspects = {}, ev, router, responseTypeDialog, endpoint, }) => {
1918
- const ok = Boolean(await API$2.send(formatData, router, endpoint === 'lead'));
1917
+ const handleDefault = async ({ formatData, data, aspects = {}, ev, router, responseTypeDialog, endpoint, withSnowplow, }) => {
1918
+ const response = await API$2.send(formatData, router, endpoint === 'lead');
1919
+ const ok = Boolean(response);
1919
1920
  responseTypeDialog.open({ ok });
1920
1921
  if (ok) {
1921
- handleAspects({ aspectsAttributes: data, aspects, ev });
1922
+ const { requestId } = response;
1923
+ const { phone } = formatData;
1924
+ const utms = router.pathname.split('?')[1];
1925
+ const eventJSON = JSON.stringify({
1926
+ id: requestId,
1927
+ phone: String(phone),
1928
+ utm: utms,
1929
+ });
1930
+ const snowplowAspect = {
1931
+ aspectName: 'snowplowEvent',
1932
+ params: {
1933
+ eventAction: 'clickdepapl',
1934
+ eventJSON,
1935
+ },
1936
+ };
1937
+ const aspectsData = withSnowplow ? [...(data ?? []), snowplowAspect] : data;
1938
+ handleAspects({ aspectsAttributes: aspectsData, aspects, ev });
1922
1939
  }
1923
1940
  };
1924
1941
 
@@ -2195,7 +2212,7 @@
2195
2212
 
2196
2213
  const DAY_COUNT = 6;
2197
2214
  const WEEK_COUNT = 7;
2198
- const renderCalendarCells = ({ today, firstDayOfWeek, totalDays, currentMonth, currentYear, min, max, onDateClick, }) => {
2215
+ const renderCalendarCells = ({ today, firstDayOfWeek, totalDays, currentMonth, currentYear, min, max, weekends, onDateClick, }) => {
2199
2216
  const calendarCells = [];
2200
2217
  let dayCounter = 1;
2201
2218
  for (let i = 0; i < DAY_COUNT; i++) {
@@ -2211,7 +2228,9 @@
2211
2228
  const currentDate = new Date(currentYear, currentMonth, dayCounter);
2212
2229
  const isToday = checkIsToday(currentDate, today);
2213
2230
  const isDisabled = checkIsDisabled(currentDate, min, max);
2214
- rowCells.push(jsx("td", { children: jsx("div", { className: getDayStyles(isToday, isDisabled), onClick: () => !isDisabled && onDateClick(currentDate), children: dayCounter }) }, `day-${dayCounter}`));
2231
+ const isWeekend = checkIsWeekend(currentDate, weekends);
2232
+ const isBlocked = isDisabled || isWeekend;
2233
+ rowCells.push(jsx("td", { children: jsx("div", { className: getDayStyles(isToday, isBlocked), onClick: () => !isBlocked && onDateClick(currentDate), children: dayCounter }) }, `day-${dayCounter}`));
2215
2234
  dayCounter++;
2216
2235
  }
2217
2236
  }
@@ -2221,12 +2240,19 @@
2221
2240
  };
2222
2241
  const checkIsToday = (currentDate, today) => today && currentDate.toDateString() === today.toDateString();
2223
2242
  const checkIsDisabled = (currentDate, min, max) => (min && currentDate.getTime() < min.getTime()) || (max && currentDate.getTime() > max.getTime());
2224
- const getDayStyles = (isToday = false, isDisabled = false) => style('p-s text-center rounded-md border', {
2243
+ const checkIsWeekend = (currentDate, weekends) => {
2244
+ if (!weekends || weekends.length === 0) {
2245
+ return false;
2246
+ }
2247
+ const dayOfWeek = currentDate.getDay() === 0 ? 7 : currentDate.getDay();
2248
+ return weekends.includes(dayOfWeek);
2249
+ };
2250
+ const getDayStyles = (isToday = false, isBlocked = false) => style('p-s text-center rounded-md border', {
2225
2251
  'border-transparent hover:bg-gray': !isToday,
2226
- }, isDisabled ? 'text-gray hover:bg-transparent' : 'cursor-pointer');
2252
+ }, isBlocked ? 'text-gray hover:bg-transparent' : 'cursor-pointer');
2227
2253
 
2228
2254
  const WEEK_DAYS = ['Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс'];
2229
- const Calendar = JSX(({ today, currentMonth, currentYear, min, max, onDateSelect = noop }) => {
2255
+ const Calendar = JSX(({ today, currentMonth, currentYear, min, max, weekends, onDateSelect = noop }) => {
2230
2256
  const { firstDayOfWeek, totalDays } = useMemo(() => ({
2231
2257
  firstDayOfWeek: new Date(currentYear, currentMonth, 1).getDay() - 1,
2232
2258
  totalDays: new Date(currentYear, currentMonth + 1, 0).getDate(),
@@ -2239,6 +2265,7 @@
2239
2265
  currentMonth,
2240
2266
  min,
2241
2267
  max,
2268
+ weekends,
2242
2269
  onDateClick: onDateSelect,
2243
2270
  }) })] }));
2244
2271
  });
@@ -2433,7 +2460,7 @@
2433
2460
  };
2434
2461
  const DatePicker = JSX(
2435
2462
  // eslint-disable-next-line max-lines-per-function
2436
- ({ className = '', label = '', value, valid = true, minDate, maxDate, disabled, onChange }) => {
2463
+ ({ className = '', label = '', value, valid = true, minDate, maxDate, disabled, weekends, onChange, }) => {
2437
2464
  const [isCalendarVisible, { setValue, setFalse: hideCalendar }] = useBool(false);
2438
2465
  const [selectedMonth, setSelectedMonth] = useState(value?.getMonth() || new Date().getMonth());
2439
2466
  const [selectedYear, setSelectedYear] = useState(value?.getFullYear() ?? new Date().getFullYear());
@@ -2462,7 +2489,7 @@
2462
2489
  setSelectedYear,
2463
2490
  }), isCalendarVisible && !disabled ? (jsxs("div", { className: style('absolute bg-white z-20 select-none', {
2464
2491
  'bottom-full': spaceAbove,
2465
- }), 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] })] }));
2492
+ }), 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] })] }));
2466
2493
  });
2467
2494
 
2468
2495
  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)] })));
@@ -3041,7 +3068,7 @@
3041
3068
  };
3042
3069
  const ApplicationForm = UniBlock(
3043
3070
  // eslint-disable-next-line max-lines-per-function
3044
- ({ className, title, typeForm = '', sections = [], button, link, endpoint, additionalParams, isContacts, data, onSuccess, ...rest }) => {
3071
+ ({ className, title, typeForm = '', sections = [], button, link, endpoint, additionalParams, withSnowplow, isContacts, data, onSuccess, ...rest }) => {
3045
3072
  const inputs = useMemo(() => (sections?.flatMap((_) => _?.inputs) || []), [sections]);
3046
3073
  const initialFormState = useMemo(() => getInitialFormState$2(inputs, typeForm), [inputs, typeForm]);
3047
3074
  const router = useRouter();
@@ -3062,6 +3089,7 @@
3062
3089
  verifyPhoneDialog,
3063
3090
  onSuccess,
3064
3091
  endpoint,
3092
+ withSnowplow,
3065
3093
  });
3066
3094
  }, [typeForm]);
3067
3095
  const [, { field, onSubmit }] = useForm(initialFormState, {
@@ -4586,12 +4614,12 @@
4586
4614
 
4587
4615
  const SelectField = UniBlock(({ field, source, fieldName, placeholder = 'Выберите из списка',
4588
4616
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
4589
- options, ...rest }) => {
4617
+ options, onChange, ...rest }) => {
4590
4618
  const leadOptions = source?.map((_) => ({
4591
4619
  key: _.key || '',
4592
4620
  text: _.value,
4593
4621
  })) || [];
4594
- return (jsx(SelectControl, { placeholder: placeholder, options: leadOptions, ...field(fieldName), ...rest }));
4622
+ return (jsx(SelectControl, { placeholder: placeholder, options: leadOptions, ...field(fieldName), ...rest, onChange: onChange ?? field(fieldName)?.onChange }));
4595
4623
  });
4596
4624
 
4597
4625
  const AmountWorkersField = JSX(({ field, input }) => {
@@ -4659,29 +4687,42 @@
4659
4687
  const CardCategoryField = JSX(({ field, input }) => {
4660
4688
  const [cardTypes, setCardTypes] = useState([]);
4661
4689
  const [programId] = useLocalStorage('programId');
4690
+ const { productType } = useRetailFormStore();
4691
+ const isSalaryCard = programId === '38';
4692
+ const isDebit = productType === 'debitCard';
4693
+ const isEsiaAuth = Boolean(field('esiaAccountTypeCd')?.value?.key);
4662
4694
  const { value: selectedCardCategory, onChange: cardCategoryChange } = field('cardCategory');
4663
4695
  const selectedPaymentSystem = field('paymentSystem')?.value?.key;
4696
+ const handleChangeIsMomentDebitCard = field('isMomentDebitCard')?.onChange;
4664
4697
  const getCardCategoryValue = useCallback((fetchedCardTypes) => fetchedCardTypes.length === 1
4665
4698
  ? {
4666
4699
  key: fetchedCardTypes[0].key,
4667
4700
  text: fetchedCardTypes[0].value,
4668
4701
  }
4669
4702
  : null, []);
4703
+ const onChange = useCallback((value) => {
4704
+ cardCategoryChange?.(value);
4705
+ handleChangeIsMomentDebitCard?.(value?.text?.toLowerCase()?.includes('неимен'));
4706
+ }, []);
4670
4707
  useEffect(() => {
4671
4708
  if (selectedPaymentSystem && programId) {
4672
4709
  (async () => {
4673
4710
  const fetchedCardTypes = await getCardTypes(selectedPaymentSystem, programId);
4674
- setCardTypes(fetchedCardTypes);
4675
- if (!isValidCardCategory(fetchedCardTypes, selectedCardCategory)) {
4676
- cardCategoryChange?.(getCardCategoryValue(fetchedCardTypes));
4711
+ const actualCardTypes = isDebit && !isEsiaAuth && !isSalaryCard
4712
+ ? excludeSomeСategoriesCards(fetchedCardTypes)
4713
+ : fetchedCardTypes;
4714
+ setCardTypes(actualCardTypes);
4715
+ if (!isValidCardCategory(actualCardTypes, selectedCardCategory)) {
4716
+ cardCategoryChange?.(getCardCategoryValue(actualCardTypes));
4677
4717
  }
4678
4718
  })();
4679
4719
  }
4680
4720
  }, [selectedPaymentSystem, getCardCategoryValue]);
4681
4721
  const description = useMemo(() => cardTypes?.find((_) => _.key === selectedCardCategory?.key)?.description, [cardTypes, selectedCardCategory]);
4682
- 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] }));
4722
+ 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] }));
4683
4723
  });
4684
4724
  const isValidCardCategory = (cardTypes, selectedCardCategory) => cardTypes.some((cardType) => cardType.key === selectedCardCategory?.key);
4725
+ const excludeSomeСategoriesCards = (cardTypes) => cardTypes.filter((cardType) => cardType.value && cardType.value.toLowerCase().includes(' именная'));
4685
4726
 
4686
4727
  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 })));
4687
4728
 
@@ -5280,14 +5321,37 @@
5280
5321
  return [employerOrganization, organization, amountWorkers, employerActivities].every(Boolean);
5281
5322
  };
5282
5323
 
5283
- 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() })));
5324
+ const MIN_DATE = new Date(Date.now() + 1 * 24 * 60 * 60 * 1000);
5325
+ const DeliveryDateFiels = JSX(({ field, input }) => {
5326
+ const { productType } = useRetailFormStore();
5327
+ const isDebit = productType === 'debitCard';
5328
+ const minDate = isDebit ? MIN_DATE : new Date();
5329
+ const { data } = useLeadFormData('DAYS_DELIVERY_SETTINGS');
5330
+ const weekends = useMemo(() => {
5331
+ const weekendItem = data?.find((item) => item.key === 'WEEKEND');
5332
+ if (weekendItem && weekendItem.value) {
5333
+ return weekendItem.value.split(',').map(Number);
5334
+ }
5335
+ return [];
5336
+ }, [data]);
5337
+ return (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438", ...field(input?.name ?? ''), minDate: minDate, weekends: isDebit ? weekends : [] }));
5338
+ });
5284
5339
 
5285
5340
  const DeliveryTimeField = JSX(({ field, input }) => {
5341
+ const { productType } = useRetailFormStore();
5342
+ const isDebit = productType === 'debitCard';
5286
5343
  const { data } = useLeadFormData('COURIER_DELIVERY_TIME');
5287
- const deliveryTime = useMemo(() => data?.map((_) => ({
5288
- id: _.key,
5289
- text: _.value,
5290
- })) ?? [], [data]);
5344
+ const creditDeliveryTime = ['TIME_1', 'TIME_2', 'TIME_3'];
5345
+ const debitDeliveryTime = ['TIME_4', 'TIME_5'];
5346
+ const deliveryTime = useMemo(() => {
5347
+ const allowedTimes = isDebit ? debitDeliveryTime : creditDeliveryTime;
5348
+ return (data || [])
5349
+ .filter((item) => item.key && allowedTimes.includes(item.key))
5350
+ .map((item) => ({
5351
+ id: item.key,
5352
+ text: item.value,
5353
+ }));
5354
+ }, [data, isDebit]);
5291
5355
  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 ?? '') }));
5292
5356
  });
5293
5357
 
@@ -5644,11 +5708,11 @@
5644
5708
  };
5645
5709
 
5646
5710
  const RegionRetailField = JSX(({ field, input }) => {
5647
- const { programId, productType } = useRetailFormStore();
5711
+ const { productType } = useRetailFormStore();
5648
5712
  const { data: regions } = useLeadFormData('REGION_RF');
5649
5713
  const { data: regionsDelivery } = useAsyncData('regionsDelivery', getRegionsCardDelivery);
5650
5714
  const { data: productSettings } = useLeadFormData(getCurrentProductSettings(productType));
5651
- const isSalaryCard = programId === '38';
5715
+ const isEsiaAuth = field('esiaAccountTypeCd')?.value?.key;
5652
5716
  const formatRegions = regions?.map(({ key, value }) => ({ key, text: value }));
5653
5717
  const isDeliveryActive = productSettings?.find((_) => _?.key === 'DELIVERY_ACTIVE')?.value === 'true';
5654
5718
  const handleChangeRegion = field('regionRetail')?.onChange;
@@ -5657,11 +5721,11 @@
5657
5721
  const onChange = useCallback((value) => {
5658
5722
  const regionHasDelivery = isDeliveryActive &&
5659
5723
  regionsDelivery?.find((_) => _.regionCode === value.key)?.deliveryFlg &&
5660
- !isSalaryCard;
5724
+ Boolean(isEsiaAuth);
5661
5725
  handleChangeRegionHasDelivery?.(regionHasDelivery);
5662
5726
  handleChangeMethodObtain?.(regionHasDelivery ? 'courier' : 'office');
5663
5727
  handleChangeRegion?.(value);
5664
- }, [regionsDelivery, isDeliveryActive]);
5728
+ }, [regionsDelivery, isDeliveryActive, isEsiaAuth]);
5665
5729
  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 }));
5666
5730
  });
5667
5731
  const getCurrentProductSettings = (productType) => productType === 'debitCard' ? 'DEBIT_CARD_LEAD_PROCESS_SETTINGS' : 'CREDIT_LEAD_PROCESS_SETTINGS';
@@ -8826,6 +8890,8 @@
8826
8890
  STATUS_TYPE["dboClient"] = "DBO_CLIENT";
8827
8891
  STATUS_TYPE["clientNotOk"] = "CLIENT_NOT_OK";
8828
8892
  STATUS_TYPE["notFound"] = "NOT_FOUND";
8893
+ STATUS_TYPE["clientFound"] = "CLIENT_FOUND";
8894
+ STATUS_TYPE["newClient"] = "NEW_CLIENT";
8829
8895
  })(STATUS_TYPE || (STATUS_TYPE = {}));
8830
8896
  const getTaskStatus = (body) => fetchRetailJSON('/user-data/getTaskStatus', 'POST', body);
8831
8897
 
@@ -10502,11 +10568,10 @@
10502
10568
  signalType: 'FIND_PERSON_SIGNAL',
10503
10569
  taskId,
10504
10570
  });
10505
- isOffice &&
10506
- (await sendSignalToProcess({
10507
- signalType: 'SET_PERSON_SIGNAL',
10508
- taskId,
10509
- }));
10571
+ await sendSignalToProcess({
10572
+ signalType: 'SET_PERSON_SIGNAL',
10573
+ taskId,
10574
+ });
10510
10575
  setStatus(statusCd || STATUS_TYPE.notFound);
10511
10576
  })();
10512
10577
  }, [taskId]);
@@ -10517,6 +10582,8 @@
10517
10582
  IN_PROCESS: jsx(PendingStatusContent, {}),
10518
10583
  NOT_FOUND: jsx(FailedStatusContent, {}),
10519
10584
  CLIENT_NOT_OK: jsx(FailedStatusContent, {}),
10585
+ NEW_CLIENT: jsx(SuccessStatusContent, { isOffice: isOffice }),
10586
+ CLIENT_FOUND: jsx(SuccessStatusContent, { isOffice: isOffice }),
10520
10587
  DBO_CLIENT: isSalaryCard ? jsx(SalaryDboClientStatusContent, {}) : jsx(DboClientStatusContent, {}),
10521
10588
  PRE_DECISION: jsx(SuccessStatusContent, { isOffice: isOffice }), //
10522
10589
  };
@@ -10569,6 +10636,7 @@
10569
10636
  },
10570
10637
  {
10571
10638
  paymentSystem: { key: '', text: '' },
10639
+ isMomentDebitCard: true,
10572
10640
  currency: '810',
10573
10641
  codeWord: '',
10574
10642
  latinName: '',
@@ -10676,7 +10744,7 @@
10676
10744
  formData: formData,
10677
10745
  }));
10678
10746
  }
10679
- if (isFinalStep || formData.methodObtain === 'courier') {
10747
+ if (isFinalStep) {
10680
10748
  onFinish?.();
10681
10749
  resetForm();
10682
10750
  }
@@ -10781,6 +10849,30 @@
10781
10849
  },
10782
10850
  ],
10783
10851
  },
10852
+ {
10853
+ inputs: [
10854
+ {
10855
+ name: 'deliveryDate',
10856
+ condition: {
10857
+ name: 'methodObtain',
10858
+ values: ['courier'],
10859
+ },
10860
+ required: true,
10861
+ },
10862
+ ],
10863
+ },
10864
+ {
10865
+ inputs: [
10866
+ {
10867
+ name: 'deliveryTime',
10868
+ condition: {
10869
+ name: 'methodObtain',
10870
+ values: ['courier'],
10871
+ },
10872
+ required: true,
10873
+ },
10874
+ ],
10875
+ },
10784
10876
  {
10785
10877
  inputs: [
10786
10878
  {
@@ -10856,6 +10948,20 @@
10856
10948
  },
10857
10949
  ],
10858
10950
  },
10951
+ {
10952
+ inputs: [
10953
+ {
10954
+ name: 'infoCard',
10955
+ condition: {
10956
+ name: 'methodObtain',
10957
+ values: ['courier'],
10958
+ },
10959
+ label:
10960
+ // eslint-disable-next-line max-len
10961
+ 'Проверьте полученные данные с портала Государственных услуг. При наличии ошибки, закройте заявку и оформите заявку заново без авторизации через портал Государственных услуг.',
10962
+ },
10963
+ ],
10964
+ },
10859
10965
  ];
10860
10966
  const DEBIT_CARD_CONTENT = [
10861
10967
  {
@@ -10872,16 +10978,40 @@
10872
10978
  {
10873
10979
  title: 'Отображение на карте',
10874
10980
  inputs: [],
10981
+ condition: {
10982
+ name: 'isMomentDebitCard',
10983
+ values: [false],
10984
+ },
10875
10985
  },
10876
10986
  {
10877
10987
  columns: 2,
10878
- inputs: [{ name: 'latinName' }, { name: 'latinSurname', required: true }],
10988
+ inputs: [
10989
+ {
10990
+ name: 'latinName',
10991
+ condition: {
10992
+ name: 'isMomentDebitCard',
10993
+ values: [false],
10994
+ },
10995
+ },
10996
+ {
10997
+ name: 'latinSurname',
10998
+ required: true,
10999
+ condition: {
11000
+ name: 'isMomentDebitCard',
11001
+ values: [false],
11002
+ },
11003
+ },
11004
+ ],
10879
11005
  },
10880
11006
  {
10881
11007
  inputs: [
10882
11008
  {
10883
11009
  name: 'infoCard',
10884
11010
  label: 'Проверьте корректность заполненных полей, при необходимости внесите изменения.',
11011
+ condition: {
11012
+ name: 'isMomentDebitCard',
11013
+ values: [false],
11014
+ },
10885
11015
  },
10886
11016
  ],
10887
11017
  },
@@ -10895,6 +11025,10 @@
10895
11025
  label:
10896
11026
  // eslint-disable-next-line max-len
10897
11027
  'Количество символов ограничивается 20. При этом, если фамилия и имя на карте содержит более 21 символа, то необходимо сократить имя и указывать на карте только первую букву имени и фамилию, если при таком сокращении фамилия и имя не умещается в количество символов – 20, то указывать только фамилию.',
11028
+ condition: {
11029
+ name: 'isMomentDebitCard',
11030
+ values: [false],
11031
+ },
10898
11032
  },
10899
11033
  ],
10900
11034
  },
@@ -12682,7 +12816,7 @@
12682
12816
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
12683
12817
  });
12684
12818
 
12685
- const packageVersion = "0.14.963";
12819
+ const packageVersion = "0.14.965";
12686
12820
 
12687
12821
  exports.Blocks = Blocks;
12688
12822
  exports.ContentPage = ContentPage;