urfu-ui-kit-react 2.1.2 → 2.1.4

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 (408) hide show
  1. package/README.md +4 -25
  2. package/dist/components/Accordion/Accordion.js +18 -0
  3. package/dist/components/BreadCrumbs/BreadCrumbs.d.ts +1 -1
  4. package/dist/components/BreadCrumbs/BreadCrumbs.d.ts.map +1 -1
  5. package/dist/components/BreadCrumbs/BreadCrumbs.js +32 -0
  6. package/dist/components/Button/Button.d.ts +1 -0
  7. package/dist/components/Button/Button.d.ts.map +1 -1
  8. package/dist/components/Button/Button.js +88 -0
  9. package/dist/components/Button/Button.types.d.ts +9 -3
  10. package/dist/components/Button/Button.types.d.ts.map +1 -1
  11. package/dist/components/Button/ButtonRefreshIcon.js +35 -0
  12. package/dist/components/Calendar/Calendar.d.ts +1 -5
  13. package/dist/components/Calendar/Calendar.d.ts.map +1 -1
  14. package/dist/components/Calendar/Calendar.js +355 -0
  15. package/dist/components/Calendar/CalendarSelect.js +149 -0
  16. package/dist/components/Calendar/MaskedDateInput.d.ts.map +1 -1
  17. package/dist/components/Calendar/MaskedDateInput.js +191 -0
  18. package/dist/components/Calendar/dateMask.d.ts +0 -1
  19. package/dist/components/Calendar/dateMask.d.ts.map +1 -1
  20. package/dist/components/Card/Card.d.ts +1 -1
  21. package/dist/components/Card/Card.d.ts.map +1 -1
  22. package/dist/components/Card/Card.js +75 -0
  23. package/dist/components/Checkbox/Checkbox.js +30 -0
  24. package/dist/components/ColumnSettings/ColumnSettings.js +216 -0
  25. package/dist/components/ConfirmModal/ConfirmModal.d.ts +1 -0
  26. package/dist/components/ConfirmModal/ConfirmModal.d.ts.map +1 -1
  27. package/dist/components/ConfirmModal/ConfirmModal.js +40 -0
  28. package/dist/components/ErrorScreen/ErrorScreen.d.ts +1 -1
  29. package/dist/components/ErrorScreen/ErrorScreen.d.ts.map +1 -1
  30. package/dist/components/ErrorScreen/ErrorScreen.js +221 -0
  31. package/dist/components/ErrorScreen/ErrorScreenIllustration.js +57 -0
  32. package/dist/components/FormField/FormField.d.ts +1 -1
  33. package/dist/components/FormField/FormField.d.ts.map +1 -1
  34. package/dist/components/FormField/FormField.js +40 -0
  35. package/dist/components/Icon/Icon.d.ts +1 -1
  36. package/dist/components/Icon/Icon.d.ts.map +1 -1
  37. package/dist/components/Icon/Icon.js +32 -0
  38. package/dist/components/Icon/Icon.types.d.ts +3 -1
  39. package/dist/components/Icon/Icon.types.d.ts.map +1 -1
  40. package/dist/components/InputExpandTextarea/InputExpandTextarea.d.ts +1 -1
  41. package/dist/components/InputExpandTextarea/InputExpandTextarea.d.ts.map +1 -1
  42. package/dist/components/InputExpandTextarea/InputExpandTextarea.js +144 -0
  43. package/dist/components/InputFile/InputFile.d.ts +1 -1
  44. package/dist/components/InputFile/InputFile.d.ts.map +1 -1
  45. package/dist/components/InputFile/InputFile.js +203 -0
  46. package/dist/components/InputFile/InputFile.types.d.ts +0 -6
  47. package/dist/components/InputFile/InputFile.types.d.ts.map +1 -1
  48. package/dist/components/InputNumber/InputNumber.d.ts +1 -1
  49. package/dist/components/InputNumber/InputNumber.d.ts.map +1 -1
  50. package/dist/components/InputNumber/InputNumber.js +220 -0
  51. package/dist/components/InputText/InputAffix.d.ts +1 -1
  52. package/dist/components/InputText/InputAffix.js +109 -0
  53. package/dist/components/InputText/InputText.d.ts +2 -1
  54. package/dist/components/InputText/InputText.d.ts.map +1 -1
  55. package/dist/components/InputText/InputText.js +137 -0
  56. package/dist/components/InputTime/InputTime.d.ts +1 -1
  57. package/dist/components/InputTime/InputTime.d.ts.map +1 -1
  58. package/dist/components/InputTime/InputTime.js +335 -0
  59. package/dist/components/InputTime/InputTimeDropdown.js +31 -0
  60. package/dist/components/InputTime/inputTimeKeyDown.js +63 -0
  61. package/dist/components/InputTime/useInputTimeWheel.js +45 -0
  62. package/dist/components/Menu/Menu.d.ts +1 -1
  63. package/dist/components/Menu/Menu.d.ts.map +1 -1
  64. package/dist/components/Menu/Menu.js +113 -0
  65. package/dist/components/Message/Message.js +29 -0
  66. package/dist/components/Modal/Modal.d.ts +1 -0
  67. package/dist/components/Modal/Modal.d.ts.map +1 -1
  68. package/dist/components/Modal/Modal.js +102 -0
  69. package/dist/components/Modal/editorFocus.js +15 -0
  70. package/dist/components/Modal/useModalFocus.js +112 -0
  71. package/dist/components/Modal/useModalTitleClearance.js +48 -0
  72. package/dist/components/Multiselect/Multiselect.d.ts +1 -0
  73. package/dist/components/Multiselect/Multiselect.d.ts.map +1 -1
  74. package/dist/components/Multiselect/Multiselect.js +408 -0
  75. package/dist/components/Notification/Notification.d.ts +1 -1
  76. package/dist/components/Notification/Notification.d.ts.map +1 -1
  77. package/dist/components/Notification/Notification.js +156 -0
  78. package/dist/components/OfflineBanner/OfflineBanner.d.ts +1 -1
  79. package/dist/components/OfflineBanner/OfflineBanner.d.ts.map +1 -1
  80. package/dist/components/OfflineBanner/OfflineBanner.js +40 -0
  81. package/dist/components/Pagination/Pagination.d.ts +1 -1
  82. package/dist/components/Pagination/Pagination.d.ts.map +1 -1
  83. package/dist/components/Pagination/Pagination.js +126 -0
  84. package/dist/components/Preloader/Preloader.d.ts.map +1 -1
  85. package/dist/components/Preloader/Preloader.js +60 -0
  86. package/dist/components/Radio/Radio.js +34 -0
  87. package/dist/components/Search/Search.d.ts +1 -1
  88. package/dist/components/Search/Search.d.ts.map +1 -1
  89. package/dist/components/Search/Search.js +47 -0
  90. package/dist/components/SearchSelect/SearchSelect.js +295 -0
  91. package/dist/components/SearchSelect/SearchSelectOption.js +41 -0
  92. package/dist/components/SearchSelect/useFlippedPlacement.js +25 -0
  93. package/dist/components/Select/MobileOptionSheet.d.ts +1 -1
  94. package/dist/components/Select/MobileOptionSheet.d.ts.map +1 -1
  95. package/dist/components/Select/MobileOptionSheet.js +116 -0
  96. package/dist/components/Select/Select.js +319 -0
  97. package/dist/components/Skeleton/Skeleton.js +38 -0
  98. package/dist/components/Skeleton/Skeleton.types.d.ts +4 -2
  99. package/dist/components/Skeleton/Skeleton.types.d.ts.map +1 -1
  100. package/dist/components/Status/Status.js +43 -0
  101. package/dist/components/StickyActionBar/StickyActionBar.d.ts +1 -1
  102. package/dist/components/StickyActionBar/StickyActionBar.d.ts.map +1 -1
  103. package/dist/components/StickyActionBar/StickyActionBar.js +73 -0
  104. package/dist/components/Switch/Switch.d.ts +1 -1
  105. package/dist/components/Switch/Switch.d.ts.map +1 -1
  106. package/dist/components/Switch/Switch.js +29 -0
  107. package/dist/components/Table/Filter/DefaultInput.d.ts.map +1 -1
  108. package/dist/components/Table/Filter/DefaultInput.js +22 -0
  109. package/dist/components/Table/Filter/Filter.js +233 -0
  110. package/dist/components/Table/Filter/Filter.types.d.ts +17 -13
  111. package/dist/components/Table/Filter/Filter.types.d.ts.map +1 -1
  112. package/dist/components/Table/Filter/FilterBooleanBox.d.ts +1 -0
  113. package/dist/components/Table/Filter/FilterBooleanBox.d.ts.map +1 -1
  114. package/dist/components/Table/Filter/FilterBooleanBox.js +40 -0
  115. package/dist/components/Table/Filter/FilterBoxShell.js +89 -0
  116. package/dist/components/Table/Filter/FilterConditionSelect.js +14 -0
  117. package/dist/components/Table/Filter/FilterDateBox.d.ts +1 -0
  118. package/dist/components/Table/Filter/FilterDateBox.d.ts.map +1 -1
  119. package/dist/components/Table/Filter/FilterDateBox.js +173 -0
  120. package/dist/components/Table/Filter/FilterPanel.js +25 -0
  121. package/dist/components/Table/Filter/FilterSortIndicator.js +24 -0
  122. package/dist/components/Table/Filter/FilterStringBox.js +115 -0
  123. package/dist/components/Table/Filter/Functions.d.ts +0 -6
  124. package/dist/components/Table/Filter/Functions.d.ts.map +1 -1
  125. package/dist/components/Table/Filter/Functions.js +76 -0
  126. package/dist/components/Table/Filter/SelectFilter.js +114 -0
  127. package/dist/components/Table/Filter/SelectOptions.js +21 -0
  128. package/dist/components/Table/Filter/TableFilterOptions.d.ts +1 -0
  129. package/dist/components/Table/Filter/TableFilterOptions.d.ts.map +1 -1
  130. package/dist/components/Table/Filter/TableFilterOptions.js +268 -0
  131. package/dist/components/Table/Filter/TableFilterSortButton.js +17 -0
  132. package/dist/components/Table/Filter/filterBoxHelpers.js +2 -0
  133. package/dist/components/Table/Filter/filterExpression.js +48 -0
  134. package/dist/components/Table/Filter/filterLoading.js +2 -0
  135. package/dist/components/Table/Filter/useFilterDates.js +33 -0
  136. package/dist/components/Table/Filter/useFilterOptionsPreload.js +22 -0
  137. package/dist/components/Table/Filter/useLocalFilterSearch.js +32 -0
  138. package/dist/components/Table/Filter/usePagedFilterOptions.js +71 -0
  139. package/dist/components/Table/Filter/useServerFilterOptions.js +35 -0
  140. package/dist/components/Table/Filter/useVirtualOptionWindow.js +80 -0
  141. package/dist/components/Table/Functions.js +54 -0
  142. package/dist/components/Table/Skeleton/TableSkeleton.js +28 -0
  143. package/dist/components/Table/Skeleton/createSkeletonColumns.js +9 -0
  144. package/dist/components/Table/Table.d.ts +1 -0
  145. package/dist/components/Table/Table.d.ts.map +1 -1
  146. package/dist/components/Table/Table.dataPipeline.d.ts.map +1 -1
  147. package/dist/components/Table/Table.dataPipeline.js +75 -0
  148. package/dist/components/Table/Table.helpers.d.ts +2 -2
  149. package/dist/components/Table/Table.helpers.d.ts.map +1 -1
  150. package/dist/components/Table/Table.helpers.js +72 -0
  151. package/dist/components/Table/Table.js +419 -0
  152. package/dist/components/Table/Table.types.d.ts +6 -2
  153. package/dist/components/Table/Table.types.d.ts.map +1 -1
  154. package/dist/components/Table/TableHead.d.ts.map +1 -1
  155. package/dist/components/Table/TableHead.js +189 -0
  156. package/dist/components/Table/TableMobileCard.js +215 -0
  157. package/dist/components/Table/TableMobileFilters.js +56 -0
  158. package/dist/components/Table/TableMobileView.js +316 -0
  159. package/dist/components/Table/TableRow.js +136 -0
  160. package/dist/components/Table/useColumnResize.d.ts +3 -2
  161. package/dist/components/Table/useColumnResize.d.ts.map +1 -1
  162. package/dist/components/Table/useColumnResize.js +44 -0
  163. package/dist/components/Table/useDelayedSkeleton.d.ts +0 -2
  164. package/dist/components/Table/useDelayedSkeleton.d.ts.map +1 -1
  165. package/dist/components/Table/useDelayedSkeleton.js +32 -0
  166. package/dist/components/Table/useMobileFilterColumns.d.ts +1 -1
  167. package/dist/components/Table/useMobileFilterColumns.d.ts.map +1 -1
  168. package/dist/components/Table/useMobileFilterColumns.js +52 -0
  169. package/dist/components/Table/useStableColumnWidths.js +22 -0
  170. package/dist/components/Table/useTableColumnPinning.d.ts +2 -57
  171. package/dist/components/Table/useTableColumnPinning.d.ts.map +1 -1
  172. package/dist/components/Table/useTableColumnPinning.js +52 -0
  173. package/dist/components/Table/useTableFilters.js +39 -0
  174. package/dist/components/Table/useTableSortState.js +38 -0
  175. package/dist/components/Table/useTableVirtualization.js +145 -0
  176. package/dist/components/Tabs/Tabs.d.ts +1 -0
  177. package/dist/components/Tabs/Tabs.d.ts.map +1 -1
  178. package/dist/components/Tabs/Tabs.js +135 -0
  179. package/dist/components/Tabs/useTabsOverflow.js +49 -0
  180. package/dist/components/Textarea/Textarea.js +102 -0
  181. package/dist/components/Tooltip/Tooltip.d.ts +1 -0
  182. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  183. package/dist/components/Tooltip/Tooltip.js +218 -0
  184. package/dist/components/TreeView/TreeView.d.ts +1 -0
  185. package/dist/components/TreeView/TreeView.d.ts.map +1 -1
  186. package/dist/components/TreeView/TreeView.js +323 -0
  187. package/dist/components/TreeView/TreeView.types.d.ts +0 -4
  188. package/dist/components/TreeView/TreeView.types.d.ts.map +1 -1
  189. package/dist/dev/index.js +336 -336
  190. package/dist/dev/types/vanilla/src/dev/shown.d.ts +0 -2
  191. package/dist/dev/types/vanilla/src/dev/store.d.ts +0 -4
  192. package/dist/fonts/icons/urfu-ui-icon-font.eot +0 -0
  193. package/dist/fonts/icons/urfu-ui-icon-font.svg +3 -0
  194. package/dist/fonts/icons/urfu-ui-icon-font.ttf +0 -0
  195. package/dist/fonts/icons/urfu-ui-icon-font.woff +0 -0
  196. package/dist/fonts/icons/urfu-ui-icon-font.woff2 +0 -0
  197. package/dist/hooks/useActiveOptionScroll.js +20 -0
  198. package/dist/hooks/useAnchoredPosition.d.ts +12 -0
  199. package/dist/hooks/useAnchoredPosition.d.ts.map +1 -1
  200. package/dist/hooks/useAnchoredPosition.js +37 -0
  201. package/dist/hooks/useAutoId.d.ts +0 -1
  202. package/dist/hooks/useAutoId.d.ts.map +1 -1
  203. package/dist/hooks/useAutoId.js +7 -0
  204. package/dist/hooks/useAutoPortal.js +11 -0
  205. package/dist/hooks/useDebounce.js +11 -0
  206. package/dist/hooks/useDismiss.d.ts +1 -1
  207. package/dist/hooks/useDismiss.d.ts.map +1 -1
  208. package/dist/hooks/useDismiss.js +20 -0
  209. package/dist/hooks/useInputOverflow.d.ts +9 -0
  210. package/dist/hooks/useInputOverflow.d.ts.map +1 -0
  211. package/dist/hooks/useInputOverflow.js +16 -0
  212. package/dist/hooks/useMediaQuery.js +21 -0
  213. package/dist/hooks/useMobilePicker.js +7 -0
  214. package/dist/hooks/useMountTransition.d.ts +1 -1
  215. package/dist/hooks/useMountTransition.d.ts.map +1 -1
  216. package/dist/hooks/useMountTransition.js +21 -0
  217. package/dist/hooks/useOnlineStatus.js +11 -0
  218. package/dist/hooks/useOptionKeyboardNavigation.js +63 -0
  219. package/dist/hooks/usePagination.js +31 -0
  220. package/dist/hooks/useSelectEngine.d.ts +3 -3
  221. package/dist/hooks/useSelectEngine.d.ts.map +1 -1
  222. package/dist/hooks/useSelectEngine.js +96 -0
  223. package/dist/hooks/useTableSort.js +13 -0
  224. package/dist/index.d.ts +16 -0
  225. package/dist/index.d.ts.map +1 -1
  226. package/dist/responsive/uiKitResponsive.js +44 -0
  227. package/dist/shared/fieldAccessibility.js +8 -0
  228. package/dist/shared/iconNames.d.ts +5 -0
  229. package/dist/shared/iconNames.d.ts.map +1 -0
  230. package/dist/shared/inputOverflow.d.ts +10 -0
  231. package/dist/shared/inputOverflow.d.ts.map +1 -0
  232. package/dist/shared/kitCopy.js +9 -0
  233. package/dist/shared/optionStateColors.js +5 -0
  234. package/dist/shared/optionValue.d.ts +1 -1
  235. package/dist/shared/optionValue.d.ts.map +1 -1
  236. package/dist/shared/optionValue.js +11 -0
  237. package/dist/shared/popupTransition.js +11 -0
  238. package/dist/shared/size.d.ts +0 -1
  239. package/dist/shared/size.d.ts.map +1 -1
  240. package/dist/shared/size.js +4 -0
  241. package/dist/shared/sortRows.js +24 -0
  242. package/dist/shared/uiKitDefaults.js +25 -0
  243. package/dist/style-no-fonts.css +1 -1
  244. package/dist/style.css +1 -1
  245. package/dist/style.layer.css +9 -9
  246. package/dist/style.shell.css +15 -11
  247. package/dist/urfu-ui-kit-react.js +57 -17502
  248. package/dist/vanilla/core/BoundedOptionPageCache.js +41 -0
  249. package/dist/vanilla/core/dateMask.js +28 -0
  250. package/dist/vanilla/core/describeError.js +243 -0
  251. package/dist/vanilla/core/devLauncherOffset.js +20 -0
  252. package/dist/vanilla/core/distributeTabs.js +25 -0
  253. package/dist/vanilla/core/hasPreviousPage.js +6 -0
  254. package/dist/vanilla/core/inputMode.js +17 -0
  255. package/dist/vanilla/core/inputOverflow.js +34 -0
  256. package/dist/vanilla/core/kitRegistry.js +160 -0
  257. package/dist/vanilla/core/reconcileColumnOrder.js +5 -0
  258. package/dist/vanilla/core/sheetTitle.js +11 -0
  259. package/dist/vanilla/core/validation.js +21 -0
  260. package/dist/vendor/@floating-ui/core/dist/floating-ui.core.js +323 -0
  261. package/dist/vendor/@floating-ui/dom/dist/floating-ui.dom.js +383 -0
  262. package/dist/vendor/@floating-ui/react/dist/floating-ui.react.js +255 -0
  263. package/dist/vendor/@floating-ui/react-dom/dist/floating-ui.react-dom.js +183 -0
  264. package/dist/vendor/@floating-ui/utils/dist/floating-ui.utils.dom.js +110 -0
  265. package/dist/vendor/@floating-ui/utils/dist/floating-ui.utils.js +106 -0
  266. package/dist/vendor/clsx/dist/clsx.js +14 -0
  267. package/dist/vendor/date-fns/_lib/addLeadingZeros.js +5 -0
  268. package/dist/vendor/date-fns/_lib/defaultOptions.js +5 -0
  269. package/dist/vendor/date-fns/_lib/format/formatters.js +547 -0
  270. package/dist/vendor/date-fns/_lib/format/lightFormatters.js +56 -0
  271. package/dist/vendor/date-fns/_lib/format/longFormatters.js +47 -0
  272. package/dist/vendor/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +16 -0
  273. package/dist/vendor/date-fns/_lib/protectedTokens.js +16 -0
  274. package/dist/vendor/date-fns/addDays.js +7 -0
  275. package/dist/vendor/date-fns/addHours.js +6 -0
  276. package/dist/vendor/date-fns/addMilliseconds.js +7 -0
  277. package/dist/vendor/date-fns/addMinutes.js +6 -0
  278. package/dist/vendor/date-fns/addMonths.js +17 -0
  279. package/dist/vendor/date-fns/addQuarters.js +6 -0
  280. package/dist/vendor/date-fns/addSeconds.js +5 -0
  281. package/dist/vendor/date-fns/addWeeks.js +6 -0
  282. package/dist/vendor/date-fns/addYears.js +5 -0
  283. package/dist/vendor/date-fns/constants.js +2 -0
  284. package/dist/vendor/date-fns/constructFrom.js +4 -0
  285. package/dist/vendor/date-fns/differenceInCalendarDays.js +8 -0
  286. package/dist/vendor/date-fns/differenceInCalendarMonths.js +6 -0
  287. package/dist/vendor/date-fns/differenceInCalendarQuarters.js +7 -0
  288. package/dist/vendor/date-fns/differenceInCalendarYears.js +6 -0
  289. package/dist/vendor/date-fns/differenceInDays.js +13 -0
  290. package/dist/vendor/date-fns/endOfDay.js +6 -0
  291. package/dist/vendor/date-fns/endOfMonth.js +6 -0
  292. package/dist/vendor/date-fns/endOfWeek.js +8 -0
  293. package/dist/vendor/date-fns/endOfYear.js +6 -0
  294. package/dist/vendor/date-fns/format.js +53 -0
  295. package/dist/vendor/date-fns/getDate.js +5 -0
  296. package/dist/vendor/date-fns/getDay.js +5 -0
  297. package/dist/vendor/date-fns/getDayOfYear.js +8 -0
  298. package/dist/vendor/date-fns/getDaysInMonth.js +7 -0
  299. package/dist/vendor/date-fns/getDefaultOptions.js +5 -0
  300. package/dist/vendor/date-fns/getHours.js +5 -0
  301. package/dist/vendor/date-fns/getISODay.js +6 -0
  302. package/dist/vendor/date-fns/getISOWeek.js +9 -0
  303. package/dist/vendor/date-fns/getISOWeekYear.js +12 -0
  304. package/dist/vendor/date-fns/getMinutes.js +5 -0
  305. package/dist/vendor/date-fns/getMonth.js +5 -0
  306. package/dist/vendor/date-fns/getQuarter.js +6 -0
  307. package/dist/vendor/date-fns/getSeconds.js +5 -0
  308. package/dist/vendor/date-fns/getTime.js +5 -0
  309. package/dist/vendor/date-fns/getWeek.js +9 -0
  310. package/dist/vendor/date-fns/getWeekYear.js +14 -0
  311. package/dist/vendor/date-fns/getYear.js +5 -0
  312. package/dist/vendor/date-fns/isAfter.js +6 -0
  313. package/dist/vendor/date-fns/isBefore.js +6 -0
  314. package/dist/vendor/date-fns/isDate.js +4 -0
  315. package/dist/vendor/date-fns/isEqual.js +6 -0
  316. package/dist/vendor/date-fns/isSameDay.js +6 -0
  317. package/dist/vendor/date-fns/isSameMonth.js +6 -0
  318. package/dist/vendor/date-fns/isSameQuarter.js +6 -0
  319. package/dist/vendor/date-fns/isSameWeek.js +6 -0
  320. package/dist/vendor/date-fns/isSameYear.js +6 -0
  321. package/dist/vendor/date-fns/isValid.js +9 -0
  322. package/dist/vendor/date-fns/isWithinInterval.js +9 -0
  323. package/dist/vendor/date-fns/locale/_lib/buildFormatLongFn.js +7 -0
  324. package/dist/vendor/date-fns/locale/_lib/buildLocalizeFn.js +16 -0
  325. package/dist/vendor/date-fns/locale/_lib/buildMatchFn.js +29 -0
  326. package/dist/vendor/date-fns/locale/_lib/buildMatchPatternFn.js +13 -0
  327. package/dist/vendor/date-fns/locale/en-US/_lib/formatDistance.js +68 -0
  328. package/dist/vendor/date-fns/locale/en-US/_lib/formatLong.js +31 -0
  329. package/dist/vendor/date-fns/locale/en-US/_lib/formatRelative.js +9 -0
  330. package/dist/vendor/date-fns/locale/en-US/_lib/localize.js +153 -0
  331. package/dist/vendor/date-fns/locale/en-US/_lib/match.js +108 -0
  332. package/dist/vendor/date-fns/locale/en-US.js +18 -0
  333. package/dist/vendor/date-fns/locale/ru/_lib/formatDistance.js +182 -0
  334. package/dist/vendor/date-fns/locale/ru/_lib/formatLong.js +28 -0
  335. package/dist/vendor/date-fns/locale/ru/_lib/formatRelative.js +62 -0
  336. package/dist/vendor/date-fns/locale/ru/_lib/localize.js +177 -0
  337. package/dist/vendor/date-fns/locale/ru/_lib/match.js +109 -0
  338. package/dist/vendor/date-fns/locale/ru.js +18 -0
  339. package/dist/vendor/date-fns/max.js +9 -0
  340. package/dist/vendor/date-fns/min.js +9 -0
  341. package/dist/vendor/date-fns/parse/_lib/Parser.js +20 -0
  342. package/dist/vendor/date-fns/parse/_lib/Setter.js +36 -0
  343. package/dist/vendor/date-fns/parse/_lib/constants.js +46 -0
  344. package/dist/vendor/date-fns/parse/_lib/parsers/AMPMMidnightParser.js +46 -0
  345. package/dist/vendor/date-fns/parse/_lib/parsers/AMPMParser.js +46 -0
  346. package/dist/vendor/date-fns/parse/_lib/parsers/DateParser.js +59 -0
  347. package/dist/vendor/date-fns/parse/_lib/parsers/DayOfYearParser.js +49 -0
  348. package/dist/vendor/date-fns/parse/_lib/parsers/DayParser.js +45 -0
  349. package/dist/vendor/date-fns/parse/_lib/parsers/DayPeriodParser.js +46 -0
  350. package/dist/vendor/date-fns/parse/_lib/parsers/EraParser.js +29 -0
  351. package/dist/vendor/date-fns/parse/_lib/parsers/ExtendedYearParser.js +19 -0
  352. package/dist/vendor/date-fns/parse/_lib/parsers/FractionOfSecondParser.js +20 -0
  353. package/dist/vendor/date-fns/parse/_lib/parsers/Hour0To11Parser.js +30 -0
  354. package/dist/vendor/date-fns/parse/_lib/parsers/Hour0to23Parser.js +30 -0
  355. package/dist/vendor/date-fns/parse/_lib/parsers/Hour1To24Parser.js +31 -0
  356. package/dist/vendor/date-fns/parse/_lib/parsers/Hour1to12Parser.js +31 -0
  357. package/dist/vendor/date-fns/parse/_lib/parsers/ISODayParser.js +101 -0
  358. package/dist/vendor/date-fns/parse/_lib/parsers/ISOTimezoneParser.js +45 -0
  359. package/dist/vendor/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.js +45 -0
  360. package/dist/vendor/date-fns/parse/_lib/parsers/ISOWeekParser.js +47 -0
  361. package/dist/vendor/date-fns/parse/_lib/parsers/ISOWeekYearParser.js +38 -0
  362. package/dist/vendor/date-fns/parse/_lib/parsers/LocalDayParser.js +76 -0
  363. package/dist/vendor/date-fns/parse/_lib/parsers/LocalWeekParser.js +46 -0
  364. package/dist/vendor/date-fns/parse/_lib/parsers/LocalWeekYearParser.js +67 -0
  365. package/dist/vendor/date-fns/parse/_lib/parsers/MinuteParser.js +30 -0
  366. package/dist/vendor/date-fns/parse/_lib/parsers/MonthParser.js +73 -0
  367. package/dist/vendor/date-fns/parse/_lib/parsers/QuarterParser.js +71 -0
  368. package/dist/vendor/date-fns/parse/_lib/parsers/SecondParser.js +30 -0
  369. package/dist/vendor/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.js +76 -0
  370. package/dist/vendor/date-fns/parse/_lib/parsers/StandAloneMonthParser.js +73 -0
  371. package/dist/vendor/date-fns/parse/_lib/parsers/StandAloneQuarterParser.js +71 -0
  372. package/dist/vendor/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.js +20 -0
  373. package/dist/vendor/date-fns/parse/_lib/parsers/TimestampSecondsParser.js +20 -0
  374. package/dist/vendor/date-fns/parse/_lib/parsers/YearParser.js +47 -0
  375. package/dist/vendor/date-fns/parse/_lib/parsers.js +65 -0
  376. package/dist/vendor/date-fns/parse/_lib/utils.js +90 -0
  377. package/dist/vendor/date-fns/parse.js +85 -0
  378. package/dist/vendor/date-fns/parseISO.js +119 -0
  379. package/dist/vendor/date-fns/set.js +8 -0
  380. package/dist/vendor/date-fns/setDay.js +9 -0
  381. package/dist/vendor/date-fns/setHours.js +6 -0
  382. package/dist/vendor/date-fns/setISODay.js +8 -0
  383. package/dist/vendor/date-fns/setISOWeek.js +7 -0
  384. package/dist/vendor/date-fns/setMinutes.js +6 -0
  385. package/dist/vendor/date-fns/setMonth.js +10 -0
  386. package/dist/vendor/date-fns/setQuarter.js +7 -0
  387. package/dist/vendor/date-fns/setSeconds.js +6 -0
  388. package/dist/vendor/date-fns/setWeek.js +7 -0
  389. package/dist/vendor/date-fns/setYear.js +7 -0
  390. package/dist/vendor/date-fns/startOfDay.js +6 -0
  391. package/dist/vendor/date-fns/startOfISOWeek.js +5 -0
  392. package/dist/vendor/date-fns/startOfISOWeekYear.js +8 -0
  393. package/dist/vendor/date-fns/startOfMonth.js +6 -0
  394. package/dist/vendor/date-fns/startOfQuarter.js +6 -0
  395. package/dist/vendor/date-fns/startOfWeek.js +8 -0
  396. package/dist/vendor/date-fns/startOfWeekYear.js +10 -0
  397. package/dist/vendor/date-fns/startOfYear.js +7 -0
  398. package/dist/vendor/date-fns/subDays.js +5 -0
  399. package/dist/vendor/date-fns/subMonths.js +5 -0
  400. package/dist/vendor/date-fns/subQuarters.js +5 -0
  401. package/dist/vendor/date-fns/subWeeks.js +5 -0
  402. package/dist/vendor/date-fns/subYears.js +5 -0
  403. package/dist/vendor/date-fns/toDate.js +5 -0
  404. package/dist/vendor/date-fns/transpose.js +15 -0
  405. package/dist/vendor/react-datepicker/dist/es/index.js +2696 -0
  406. package/package.json +37 -35
  407. package/dist/hooks/useOutsideAlerter.d.ts +0 -3
  408. package/dist/hooks/useOutsideAlerter.d.ts.map +0 -1
@@ -0,0 +1,268 @@
1
+ import { jsx as u, jsxs as p } from "react/jsx-runtime";
2
+ import { useState as F, useRef as N, useEffect as M, useMemo as I } from "react";
3
+ import { Checkbox$u as le } from "../../Checkbox/Checkbox.js";
4
+ import { Button$u as L } from "../../Button/Button.js";
5
+ import Ne from "./DefaultInput.js";
6
+ /* empty css */
7
+ /* empty css */
8
+ import { TableFilterSortButton$u as we } from "./TableFilterSortButton.js";
9
+ import { useVirtualOptionWindow$u as ve } from "./useVirtualOptionWindow.js";
10
+ import { filterExpressionSummary$u as ke, bulkFilterExpression$u as Ee, filterExpressionSelected$u as Se, filterRuleMatches$u as Te, toggleFilterExpression$u as De } from "./filterExpression.js";
11
+ function He({
12
+ variant: _ = "values",
13
+ onSearchApply: P,
14
+ searchDebounceMs: U = 350,
15
+ options: f,
16
+ values: B = [],
17
+ onChange: d,
18
+ selection: l,
19
+ onSelectionChange: h,
20
+ loading: c = !1,
21
+ error: n,
22
+ onRetry: w,
23
+ onReset: J,
24
+ resetLabel: se = "Сбросить фильтр",
25
+ search: ue,
26
+ onSearchChange: K,
27
+ searchLabel: ce = "Поиск значений",
28
+ sort: ae,
29
+ onSort: ie,
30
+ sortUnavailableReason: oe,
31
+ conditionControl: R,
32
+ allOptions: O = f,
33
+ optionsAlreadyFiltered: z = !1,
34
+ selectFoundOnSearch: ne = !1,
35
+ virtualize: v = !1,
36
+ paged: r,
37
+ numeric: k,
38
+ paging: o,
39
+ complete: me = !1
40
+ }) {
41
+ const [fe, de] = F(""), [he, W] = F(!1), [G, E] = F(), S = N(null), Q = N(null), m = ue ?? fe, [X, Y] = F(!1), Z = N(void 0), V = N(P);
42
+ M(() => {
43
+ V.current = P;
44
+ }, [P]), M(() => {
45
+ if (_ !== "search" || c || X || m === Z.current) return;
46
+ const e = setTimeout(() => {
47
+ V.current && (Z.current = m, V.current(m));
48
+ }, Math.max(0, U));
49
+ return () => clearTimeout(e);
50
+ }, [_, m, c, X, U]);
51
+ const y = m.trim().length > 0 || !!k, i = I(() => z ? f : f.filter((e) => e.label.toLocaleLowerCase("ru").includes(m.trim().toLocaleLowerCase("ru"))), [z, f, m]), T = I(() => i.map((e, t) => v ? JSON.stringify([typeof e.value, typeof e.value == "object" && e.value !== null ? t : e.value, e.label]) : String(t)), [i, v]), a = ve(T, v, Q), $ = new Set((l == null ? void 0 : l.values) ?? B), be = I(() => JSON.stringify(r == null ? void 0 : r.expression), [r == null ? void 0 : r.expression]), xe = I(() => {
52
+ const e = /* @__PURE__ */ new Map();
53
+ return f.forEach((t) => {
54
+ e.has(t.value) || e.set(t.value, t);
55
+ }), e;
56
+ }, [f]), q = (e) => {
57
+ if (r) {
58
+ const t = xe.get(e);
59
+ return (t == null ? void 0 : t.expressionKey) === be && typeof t.selected == "boolean" ? t.selected : Se(r.expression, { value: e, label: (t == null ? void 0 : t.label) ?? String(e ?? "") });
60
+ }
61
+ return (l == null ? void 0 : l.mode) === "exclude" ? !$.has(e) : $.has(e);
62
+ }, C = r ? ke(r.expression, f, me && !y).allSelected : l ? l.mode === "exclude" && l.values.length === 0 : O.length > 0 && O.every((e) => q(e.value)), x = y && (ne || he || !C), H = x ? i : O, pe = (l || r) && !x ? C : H.length > 0 && H.every((e) => q(e.value)), g = x ? "Выбрать все найденные" : "Выбрать все", j = r ? !i.length && (c || !!n) : c || !!n, D = N(/* @__PURE__ */ new Map());
63
+ M(() => {
64
+ if (!r) return;
65
+ const e = /* @__PURE__ */ new Set([...r.expression.include, ...r.expression.exclude]);
66
+ D.current.forEach((t, s) => {
67
+ e.has(s) || D.current.delete(s);
68
+ }), f.forEach((t) => {
69
+ e.has(t.value) && D.current.set(t.value, t);
70
+ });
71
+ }, [f, r]);
72
+ const _e = (e) => {
73
+ const t = i.map((s) => s.value);
74
+ return D.current.forEach((s, b) => {
75
+ Te(s, e, k) && t.push(b);
76
+ }), t;
77
+ };
78
+ M(() => {
79
+ y || W(!1);
80
+ }, [y]);
81
+ const ee = (e) => {
82
+ de(e), K == null || K(e);
83
+ }, A = /* @__PURE__ */ p("div", { className: "u-table-filter-options__input", ref: S, children: [
84
+ /* @__PURE__ */ u(
85
+ Ne,
86
+ {
87
+ value: m,
88
+ "aria-label": ce,
89
+ maxLength: r ? 256 : void 0,
90
+ onChange: (e) => ee(e.target.value),
91
+ onCompositionStart: () => {
92
+ _ === "search" && Y(!0);
93
+ },
94
+ onCompositionEnd: () => Y(!1),
95
+ onKeyDown: (e) => {
96
+ _ !== "search" || e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(), e.stopPropagation());
97
+ },
98
+ placeholder: "Введите значение",
99
+ isSelectColumn: !0
100
+ }
101
+ ),
102
+ m ? /* @__PURE__ */ u(
103
+ L,
104
+ {
105
+ variant: "icon",
106
+ icon: "cross-small",
107
+ iconOnly: !0,
108
+ iconSize: 14,
109
+ className: "u-table-filter-options__clear",
110
+ "aria-label": "Очистить поиск",
111
+ onClick: () => {
112
+ var e, t;
113
+ ee(""), (t = (e = S.current) == null ? void 0 : e.querySelector("input")) == null || t.focus();
114
+ }
115
+ }
116
+ ) : null
117
+ ] }), te = /* @__PURE__ */ u(we, { sort: ae, onSort: ie, unavailableReason: oe });
118
+ if (_ === "search") return /* @__PURE__ */ u("div", { className: "u-table-filter-options u-table-filter-options--search", children: /* @__PURE__ */ p("div", { className: "u-table-filter-options__toolbar", children: [
119
+ A,
120
+ te
121
+ ] }) });
122
+ const ye = (e, t) => {
123
+ if (j) return;
124
+ if (r) {
125
+ try {
126
+ r.onChange(De(r.expression, e, t, r.maxExplicitValues)), E(void 0);
127
+ } catch (b) {
128
+ E(b instanceof Error ? b.message : "Не удалось изменить выбор.");
129
+ }
130
+ return;
131
+ }
132
+ const s = new Set((l == null ? void 0 : l.values) ?? B);
133
+ ((l == null ? void 0 : l.mode) === "exclude" ? !t : t) ? s.add(e) : s.delete(e), l ? h == null || h({ mode: l.mode, values: [...s] }) : d == null || d([...s]);
134
+ };
135
+ return /* @__PURE__ */ p("div", { className: "u-table-filter-options", children: [
136
+ /* @__PURE__ */ p("div", { className: "u-table-filter-options__toolbar", children: [
137
+ R ?? A,
138
+ te
139
+ ] }),
140
+ R ? /* @__PURE__ */ u("div", { className: "u-table-filter-options__search", children: A }) : null,
141
+ /* @__PURE__ */ p(
142
+ "ul",
143
+ {
144
+ className: "u-table-filter-options__list",
145
+ "aria-busy": c,
146
+ ref: Q,
147
+ onFocusCapture: (e) => {
148
+ const t = e.target.closest("li[data-option-index]");
149
+ a.rememberFocus(t ? T[Number(t.dataset.optionIndex)] : null);
150
+ },
151
+ onBlurCapture: (e) => {
152
+ e.relatedTarget && !e.currentTarget.contains(e.relatedTarget) && a.rememberFocus(null);
153
+ },
154
+ onScroll: (e) => {
155
+ if (a.readViewport(), !o || c || n) return;
156
+ const t = e.currentTarget;
157
+ t.scrollTop + t.clientHeight >= t.scrollHeight - 24 && o.hasNext ? o.next() : t.scrollTop <= 24 && o.hasPrevious && o.previous();
158
+ },
159
+ onKeyDown: (e) => {
160
+ if (!v || !["ArrowDown", "ArrowUp", "Home", "End"].includes(e.key)) return;
161
+ const t = e.target.closest("li[data-option-index]");
162
+ if (!t) return;
163
+ const s = Number(t.dataset.optionIndex);
164
+ if (o && !c && !n && (e.key === "ArrowDown" && s === i.length - 1 && o.hasNext || e.key === "ArrowUp" && s === 0 && o.hasPrevious)) {
165
+ e.preventDefault(), e.key === "ArrowDown" ? o.next() : o.previous();
166
+ return;
167
+ }
168
+ const b = e.key === "Home" ? 0 : e.key === "End" ? i.length - 1 : Math.max(0, Math.min(i.length - 1, s + (e.key === "ArrowDown" ? 1 : -1)));
169
+ e.preventDefault(), a.scrollToIndex(b);
170
+ },
171
+ children: [
172
+ n && (!r || !i.length) ? /* @__PURE__ */ p("li", { className: "select-column__li select-column__empty", role: "alert", children: [
173
+ n,
174
+ w ? /* @__PURE__ */ u(
175
+ L,
176
+ {
177
+ variant: "text",
178
+ size: "small",
179
+ disabled: c,
180
+ "aria-busy": c || void 0,
181
+ onClick: () => {
182
+ var e, t;
183
+ (t = (e = S.current) == null ? void 0 : e.querySelector("input")) == null || t.focus({ preventScroll: !0 }), w();
184
+ },
185
+ children: "Повторить"
186
+ }
187
+ ) : null
188
+ ] }) : c && (!r || !i.length) ? /* @__PURE__ */ u("li", { className: "select-column__li select-column__empty", role: "status", children: "Загрузка значений…" }) : null,
189
+ i.length && (r || !c && !n) ? /* @__PURE__ */ u("li", { className: "select-column__li u-table-filter-options__bulk", children: /* @__PURE__ */ u(
190
+ le,
191
+ {
192
+ className: "u-table-filter-options__option",
193
+ checked: pe,
194
+ disabled: j,
195
+ propsInput: { "aria-label": g },
196
+ onChange: (e) => {
197
+ if (y && W(!0), r) {
198
+ const s = x && !k ? m.trim() : "", b = x ? k : void 0;
199
+ try {
200
+ r.onChange(Ee(r.expression, s, b, e.target.checked, r.maxRules, _e(s))), E(void 0);
201
+ } catch (re) {
202
+ E(re instanceof Error ? re.message : "Не удалось изменить выбор.");
203
+ }
204
+ return;
205
+ }
206
+ if (l && !x) {
207
+ h == null || h({ mode: e.target.checked ? "exclude" : "include", values: [] });
208
+ return;
209
+ }
210
+ if (!x && !e.target.checked) {
211
+ d == null || d([]);
212
+ return;
213
+ }
214
+ const t = new Set((l == null ? void 0 : l.values) ?? B);
215
+ H.forEach((s) => {
216
+ ((l == null ? void 0 : l.mode) === "exclude" ? !e.target.checked : e.target.checked) ? t.add(s.value) : t.delete(s.value);
217
+ }), l ? h == null || h({ mode: l.mode, values: [...t] }) : d == null || d([...t]);
218
+ },
219
+ children: /* @__PURE__ */ u("h5", { className: "h5", children: g })
220
+ }
221
+ ) }) : !c && !n ? /* @__PURE__ */ u("li", { className: "select-column__li select-column__empty", children: "Не найдено" }) : null,
222
+ a.topPadding > 0 && /* @__PURE__ */ u("li", { "aria-hidden": "true", role: "presentation", style: { height: a.topPadding } }),
223
+ i.slice(a.start, a.end).map((e, t) => /* @__PURE__ */ u(
224
+ "li",
225
+ {
226
+ className: "select-column__li",
227
+ "data-option-index": a.start + t,
228
+ ref: (s) => a.register(T[a.start + t], s),
229
+ children: /* @__PURE__ */ u(
230
+ le,
231
+ {
232
+ className: "u-table-filter-options__option",
233
+ checked: q(e.value),
234
+ disabled: j,
235
+ propsInput: { "aria-label": e.label },
236
+ onChange: (s) => ye(e.value, s.target.checked),
237
+ children: /* @__PURE__ */ u("h5", { className: "h5", children: e.label })
238
+ }
239
+ )
240
+ },
241
+ T[a.start + t]
242
+ )),
243
+ a.bottomPadding > 0 && /* @__PURE__ */ u("li", { "aria-hidden": "true", role: "presentation", style: { height: a.bottomPadding } })
244
+ ]
245
+ }
246
+ ),
247
+ G ? /* @__PURE__ */ u("div", { className: "u-table-filter-options__notice", role: "alert", children: G }) : null,
248
+ o && n && i.length ? /* @__PURE__ */ p("div", { className: "u-table-filter-options__notice", role: "alert", children: [
249
+ n,
250
+ w ? /* @__PURE__ */ u(
251
+ L,
252
+ {
253
+ variant: "text",
254
+ size: "small",
255
+ disabled: c,
256
+ "aria-busy": c || void 0,
257
+ onClick: () => {
258
+ var e, t;
259
+ (t = (e = S.current) == null ? void 0 : e.querySelector("input")) == null || t.focus({ preventScroll: !0 }), w();
260
+ },
261
+ children: "Повторить"
262
+ }
263
+ ) : null
264
+ ] }) : null,
265
+ J ? /* @__PURE__ */ u(L, { className: "u-table-filter-options__reset", variant: "text", size: "small", onClick: J, children: se }) : null
266
+ ] });
267
+ }
268
+ export { He as TableFilterOptions$u };
@@ -0,0 +1,17 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { Tooltip$u as r } from "../../Tooltip/Tooltip.js";
3
+ function c({ sort: o, onSort: t, unavailableReason: n }) {
4
+ const e = t ? o === "asc" ? "По возрастанию; переключить на убывание" : o === "desc" ? "По убыванию; сбросить сортировку" : "Сортировать по возрастанию" : n;
5
+ return /* @__PURE__ */ i(r, { tooltipText: e, isActive: !!e, position: "top", portalOn: !0, children: /* @__PURE__ */ i(
6
+ "button",
7
+ {
8
+ type: "button",
9
+ className: "button-sort u-table-filter-options__sort",
10
+ onClick: t,
11
+ disabled: !t,
12
+ "aria-label": "Сортировка",
13
+ children: /* @__PURE__ */ i("i", { "aria-hidden": "true", className: "u-icon " + (o === "asc" ? "icon-up-arrow" : o === "desc" ? "icon-down-arrow" : "icon-sorting") })
14
+ }
15
+ ) });
16
+ }
17
+ export { c as TableFilterSortButton$u };
@@ -0,0 +1,2 @@
1
+ const n = (e, c) => (e == null ? void 0 : e.column) !== void 0 && e.column === c ? e.asc ? "asc" : "desc" : void 0, i = (e, c) => e ? c ? "Сбросить фильтр и сортировку" : "Сбросить сортировку" : "Сбросить фильтр";
2
+ export { n as getColumnSortDirection$u, i as getFilterResetLabel$u };
@@ -0,0 +1,48 @@
1
+ const i = (e) => e.toLocaleLowerCase("ru");
2
+ function a(e, t) {
3
+ const l = e.trim().replace(",", "."), r = /^-?\d+(?:\.\d+)?$/.test(l) ? Number(l) : t === void 0 ? Number.NaN : Number(String(t).replace(",", "."));
4
+ return Number.isFinite(r) ? r : void 0;
5
+ }
6
+ function s(e, t) {
7
+ return t.operator === "gt" ? e > t.value : t.operator === "lt" ? e < t.value : e === t.value;
8
+ }
9
+ function o(e, t, l) {
10
+ if (!i(e.label).includes(i(t))) return !1;
11
+ if (!l) return !0;
12
+ const r = a(e.label);
13
+ return r !== void 0 && s(r, l);
14
+ }
15
+ function g(e, t) {
16
+ if (e.exclude.includes(t.value)) return !1;
17
+ if (e.include.includes(t.value)) return !0;
18
+ let l = e.defaultSelected;
19
+ for (const r of e.rules) o(t, r.search, r.numeric) && (l = r.selected);
20
+ return l;
21
+ }
22
+ function h(e, t, l, r = 1e3) {
23
+ const n = e.include.filter((c) => c !== t), u = e.exclude.filter((c) => c !== t);
24
+ if ((l ? n : u).push(t), n.length + u.length > r) throw new Error("Выбрано слишком много отдельных значений. Используйте «Выбрать все найденные» или упростите условия.");
25
+ return { ...e, include: n, exclude: u };
26
+ }
27
+ function S(e, t, l, r, n = 10, u = []) {
28
+ if (!t && !l) return { defaultSelected: r, rules: [], include: [], exclude: [] };
29
+ const c = e.rules.filter((f) => f.search !== t || JSON.stringify(f.numeric) !== JSON.stringify(l));
30
+ if (c.length >= n) throw new Error("Достигнут предел условий поиска. Очистите поиск и выберите всё или ничего, чтобы упростить фильтр.");
31
+ const d = new Set(u);
32
+ return {
33
+ ...e,
34
+ rules: [...c, { search: t, ...l ? { numeric: l } : {}, selected: r }],
35
+ include: e.include.filter((f) => !d.has(f)),
36
+ exclude: e.exclude.filter((f) => !d.has(f))
37
+ };
38
+ }
39
+ function N(e, t, l) {
40
+ const r = e.defaultSelected && !e.rules.length && !e.exclude.length;
41
+ if (l) {
42
+ const u = JSON.stringify(e), c = t.filter((d) => d.expressionKey === u && typeof d.selected == "boolean" ? d.selected : g(e, d)).length;
43
+ return { allSelected: t.length > 0 ? c === t.length : r, count: c };
44
+ }
45
+ const n = !e.defaultSelected && !e.rules.length ? new Set(e.include.filter((u) => !e.exclude.includes(u))).size : void 0;
46
+ return { allSelected: r, count: n };
47
+ }
48
+ export { S as bulkFilterExpression$u, g as filterExpressionSelected$u, N as filterExpressionSummary$u, o as filterRuleMatches$u, s as matchesNumeric$u, a as parseFilterNumber$u, h as toggleFilterExpression$u };
@@ -0,0 +1,2 @@
1
+ const r = "Не удалось загрузить значения фильтра. Попробуйте ещё раз.", R = (e, t = !1) => e.trim() || t ? 300 : 0;
2
+ export { r as FILTER_LOAD_ERROR$u, R as getFilterSearchDelay$u };
@@ -0,0 +1,33 @@
1
+ import { useEffect as r } from "react";
2
+ import { selectDate$u as h } from "./SelectOptions.js";
3
+ const m = ({ field: a, isDate: l, filterDates: p, setFilterDates: F, method: c, setMethod: b }) => {
4
+ const n = p == null ? void 0 : p.find((e) => e.id === a);
5
+ r(() => {
6
+ if (!l) return;
7
+ const e = h.find((t) => t.id === (n == null ? void 0 : n.type));
8
+ b((t) => (t == null ? void 0 : t.typeFilterSearch.id) === (e == null ? void 0 : e.id) ? t : e ? { typeFilterSearch: e } : void 0);
9
+ }, [l, n == null ? void 0 : n.type, b]);
10
+ const S = (e, t) => {
11
+ F((g) => {
12
+ const y = g.find((f) => f.id === a), d = {
13
+ id: a,
14
+ type: (c == null ? void 0 : c.typeFilterSearch.id) ?? (y == null ? void 0 : y.type) ?? "exact",
15
+ begin: (y == null ? void 0 : y.begin) ?? null,
16
+ end: (y == null ? void 0 : y.end) ?? null,
17
+ [e]: t
18
+ }, x = g.filter((f) => f.id !== a);
19
+ return d.begin == null && d.end == null ? x : [...x, d];
20
+ });
21
+ }, E = (e) => {
22
+ const t = typeof e == "function" ? e(c) : e;
23
+ b(t), !(!l || !n) && F((g) => g.map((y) => y.id === a ? { ...y, type: (t == null ? void 0 : t.typeFilterSearch.id) ?? "exact" } : y));
24
+ };
25
+ return {
26
+ date: n == null ? void 0 : n.begin,
27
+ dateEnd: n == null ? void 0 : n.end,
28
+ setDate: (e) => S("begin", e),
29
+ setDateEnd: (e) => S("end", e),
30
+ changeMethod: E
31
+ };
32
+ };
33
+ export { m as useFilterDates$u };
@@ -0,0 +1,22 @@
1
+ import { useState as u, useEffect as b } from "react";
2
+ import { usePagedFilterOptions$u as h } from "./usePagedFilterOptions.js";
3
+ import { useServerFilterOptions$u as m } from "./useServerFilterOptions.js";
4
+ import { filterExpressionSummary$u as w } from "./filterExpression.js";
5
+ function x(t, i, c) {
6
+ var v;
7
+ const o = ((v = t.filterServer) == null ? void 0 : v.type) === "values" ? t.filterServer : void 0, e = o == null ? void 0 : o.paged, s = !!t.filterAdaptiveHeight && !t.renderFilter, r = !!o && !(t.filterType === "boolean" && t.filterShowConditions === !0), n = m(s && r ? o : void 0, "", i), a = e ? w(e.expression, [], !1) : void 0, g = !!a && !a.allSelected && a.count === void 0, l = h(e && (c && g || i) ? e : void 0, ""), p = e ? l : n, [S, f] = u(!1), d = s && r && !S && p.loading && !p.error;
8
+ return b(() => {
9
+ i ? d || f(!0) : f(!1);
10
+ }, [i, d]), {
11
+ paged: e,
12
+ basePages: l,
13
+ baseOptions: n,
14
+ waitingForOptions: d,
15
+ /** Готовые варианты для панели, чтобы она не повторяла первый запрос. */
16
+ panelBase: {
17
+ basePages: e ? l : void 0,
18
+ baseOptions: s && r && !e ? n : void 0
19
+ }
20
+ };
21
+ }
22
+ export { x as useFilterOptionsPreload$u };
@@ -0,0 +1,32 @@
1
+ import { useMemo as l, useState as O, useEffect as a } from "react";
2
+ import { filterOptionsFormatter$u as c, filterOptions$u as v, setMethodSearch$u as M, setMethodSearchNumber$u as N, getSearchСontainsText$u as p, getSearchEqualsNumber$u as x } from "./Functions.js";
3
+ import { selectText$u as h, selectNumber$u as k } from "./SelectOptions.js";
4
+ function _({
5
+ column: s,
6
+ filterEmptyLabel: r,
7
+ textSearch: o,
8
+ typeFilterSearch: e,
9
+ setTypeFilterSearch: m,
10
+ uncheckedValues: g,
11
+ setUncheckedValues: d
12
+ }) {
13
+ const t = l(
14
+ () => c(v(s.filterOptions), r),
15
+ [s.filterOptions, r]
16
+ ), [b, n] = O();
17
+ return a(() => {
18
+ var u;
19
+ if (s.filterServer) return;
20
+ const f = s.filterType === "string";
21
+ if (f || s.filterType === "number") {
22
+ !e && o.length > 0 && m({ typeFilterSearch: (f ? h : k)[0] });
23
+ const i = (u = e == null ? void 0 : e.typeFilterSearch) == null ? void 0 : u.id;
24
+ o ? i ? (f ? M : N)(i, o, n, t) : (f ? p : x)(o, n, t) : n(t);
25
+ }
26
+ if (s.filterType === "boolean" && d) {
27
+ const i = e == null ? void 0 : e.typeFilterSearch.id, T = i === "0" ? [] : i === "1" ? [!1, null, void 0] : i === "2" ? [!0] : void 0;
28
+ T && d({ ...g, [s.field]: T });
29
+ }
30
+ }, [o, t, e]), { checkBoxes: t, searched: b };
31
+ }
32
+ export { _ as useLocalFilterSearch$u };
@@ -0,0 +1,71 @@
1
+ import { useRef as n, useState as _, useEffect as W, useCallback as X } from "react";
2
+ import { getFilterSearchDelay$u as Y, FILTER_LOAD_ERROR$u as Z } from "./filterLoading.js";
3
+ import { BoundedOptionPageCache$u as R } from "../../../vanilla/core/BoundedOptionPageCache.js";
4
+ function te(c, x, z) {
5
+ var N, A, E, F;
6
+ const w = n(c);
7
+ w.current = c;
8
+ const s = n([]), u = n(new R(3)), y = n(new R(3)), P = n(), S = n("first"), [b, l] = _({ pages: [], loading: !!c }), [a, B] = _(0), g = JSON.stringify(z), f = c == null ? void 0 : c.contextKey, O = n(), v = n(0), i = JSON.stringify([f, x, g]), d = n(() => {
9
+ });
10
+ W(() => {
11
+ if (!w.current) {
12
+ d.current = () => {
13
+ };
14
+ return;
15
+ }
16
+ P.current !== f && (y.current.clear(), P.current = f);
17
+ const t = new AbortController();
18
+ let h = !1;
19
+ const J = async (r) => {
20
+ var T, k;
21
+ const K = w.current;
22
+ if (!K || h || t.signal.aborted) return;
23
+ const D = s.current, o = r === "next" ? (T = D.at(-1)) == null ? void 0 : T.nextCursor : r === "previous" ? (k = D[0]) == null ? void 0 : k.previousCursor : void 0;
24
+ if (r !== "first" && !o) return;
25
+ h = !0, S.current = r, l((e) => ({ ...e, loading: !0 }));
26
+ const U = JSON.stringify(K.expression);
27
+ try {
28
+ const e = await K.loadPage({ search: x, ...g ? { numeric: JSON.parse(g) } : {}, ...o ? { cursor: o } : {}, limit: 100 }, t.signal);
29
+ if (t.signal.aborted) return;
30
+ if (e.hasMore && !e.nextCursor || e.hasPrevious && !e.previousCursor || r === "next" && e.hasMore && e.nextCursor === o || r === "previous" && e.hasPrevious && e.previousCursor === o || e.options.length === 0 && (e.hasMore || e.hasPrevious) || e.options.length > 100) throw new Error("Invalid option page");
31
+ const I = { ...e, expressionKey: U };
32
+ r === "first" && u.current.clear(), r === "previous" ? u.current.setFirst("cursor:" + o, I) : u.current.set(o ? "cursor:" + o : "first", I), y.current.set(i, u.current);
33
+ const L = u.current.entries().map(([, V]) => V);
34
+ s.current = L, l({ pages: L, loading: !1 });
35
+ } catch {
36
+ t.signal.aborted || l((e) => ({ ...e, loading: !1, error: Z }));
37
+ } finally {
38
+ h = !1;
39
+ }
40
+ };
41
+ if (d.current = (r) => {
42
+ J(r);
43
+ }, O.current === i && s.current.length && v.current === a)
44
+ return l((r) => ({ ...r, pages: s.current, loading: !1 })), () => t.abort();
45
+ const m = v.current === a ? y.current.get(i) : void 0;
46
+ if (O.current = i, v.current = a, m != null && m.size)
47
+ return u.current = m, s.current = m.entries().map(([, r]) => r), l({ pages: s.current, loading: !1 }), () => t.abort();
48
+ s.current = [], u.current = new R(3), l((r) => ({ pages: [], loading: !0, error: a ? r.error : void 0 }));
49
+ const H = window.setTimeout(() => {
50
+ J("first");
51
+ }, Y(x, !!g));
52
+ return () => {
53
+ t.abort(), window.clearTimeout(H);
54
+ };
55
+ }, [f, x, g, i, a]);
56
+ const j = X(() => {
57
+ s.current.length ? d.current(S.current) : B((t) => t + 1);
58
+ }, []), C = O.current === i && v.current === a, G = !C && P.current === f && v.current === a ? (N = y.current.peek(i)) == null ? void 0 : N.entries().map(([, t]) => t) : void 0, p = C ? b.pages : G ?? [], M = !!c && (C ? b.loading : !p.length), q = C ? b.error : void 0;
59
+ return {
60
+ options: p.flatMap((t) => t.options.map((h) => ({ ...h, expressionKey: t.expressionKey }))),
61
+ loading: M,
62
+ error: q,
63
+ retry: j,
64
+ complete: p.length > 0 && !M && !q && !p[0].hasPrevious && !((A = p.at(-1)) != null && A.hasMore),
65
+ hasNext: !!((E = p.at(-1)) != null && E.hasMore),
66
+ hasPrevious: !!((F = p[0]) != null && F.hasPrevious),
67
+ next: () => d.current("next"),
68
+ previous: () => d.current("previous")
69
+ };
70
+ }
71
+ export { te as usePagedFilterOptions$u };
@@ -0,0 +1,35 @@
1
+ import { useState as S, useRef as m, useEffect as x } from "react";
2
+ import { FILTER_LOAD_ERROR$u as D, getFilterSearchDelay$u as L } from "./filterLoading.js";
3
+ function k(n, e, s = !0) {
4
+ var v, w, y;
5
+ const t = (n == null ? void 0 : n.type) === "values" && !n.paged ? n.loadOptions : void 0, [c, i] = S({ options: [], loading: !!t }), [u, A] = S(0), l = m(!1), r = m(), a = m(!1), g = ((v = r.current) == null ? void 0 : v.loader) === t && ((w = r.current) == null ? void 0 : w.search) === e, d = g && ((y = r.current) == null ? void 0 : y.attempt) === u;
6
+ x(() => {
7
+ var O, R, E;
8
+ if (!t || !s || ((O = r.current) == null ? void 0 : O.loader) === t && ((R = r.current) == null ? void 0 : R.search) === e && ((E = r.current) == null ? void 0 : E.attempt) === u && a.current) return;
9
+ r.current = { loader: t, search: e, attempt: u }, a.current = !1;
10
+ const o = new AbortController(), F = l.current;
11
+ l.current = !1, i((p) => ({ options: [], loading: !0, error: F ? p.error : void 0 }));
12
+ const T = window.setTimeout(() => {
13
+ t(e, o.signal).then((p) => {
14
+ o.signal.aborted || (a.current = !0, i({ options: p, loading: !1 }));
15
+ }).catch(() => {
16
+ o.signal.aborted || (a.current = !0, i({ options: [], loading: !1, error: D }));
17
+ });
18
+ }, L(e));
19
+ return () => {
20
+ o.abort(), window.clearTimeout(T);
21
+ };
22
+ }, [t, e, u, s]);
23
+ const f = !!t && s && (!d || c.loading);
24
+ return {
25
+ options: d ? c.options : [],
26
+ error: g ? c.error : void 0,
27
+ loading: f,
28
+ /** Словарь загружен для текущего запроса; пустой список выключенного загрузчика сюда не относится. */
29
+ complete: !!t && s && d && !f && !c.error,
30
+ retry: () => {
31
+ l.current = !0, A((o) => o + 1);
32
+ }
33
+ };
34
+ }
35
+ export { k as useServerFilterOptions$u };
@@ -0,0 +1,80 @@
1
+ import { useRef as w, useState as C, useLayoutEffect as g, useMemo as P, useCallback as B } from "react";
2
+ function _(r, i, l) {
3
+ const h = w(/* @__PURE__ */ new Map()), f = w(/* @__PURE__ */ new Map()), [S, b] = C(0), [n, I] = C({ top: 0, height: 170, prefix: 0, estimate: 40 }), [v, T] = C(null), m = w(null), O = w();
4
+ g(() => {
5
+ const t = new Set(r);
6
+ for (const e of h.current.keys()) t.has(e) || h.current.delete(e);
7
+ for (const e of f.current.keys()) t.has(e) || f.current.delete(e);
8
+ }, [r]);
9
+ const u = P(() => {
10
+ const t = [0];
11
+ for (const e of r) t.push(t[t.length - 1] + (h.current.get(e) ?? n.estimate));
12
+ return t;
13
+ }, [r, n.estimate, S]);
14
+ g(() => {
15
+ const t = O.current, e = l.current;
16
+ if (i && e && t && t.keys !== r) {
17
+ const o = Math.max(0, t.top - n.prefix), s = Math.max(0, t.offsets.findIndex((a, M) => M < t.keys.length && t.offsets[M + 1] > o)), c = r.indexOf(t.keys[s]);
18
+ c >= 0 ? e.scrollTop = Math.max(0, t.top + u[c] - t.offsets[s]) : r.some((a) => t.keys.includes(a)) || (e.scrollTop = 0), m.current && r.includes(m.current) && T(m.current);
19
+ }
20
+ O.current = { keys: r, offsets: u, top: (e == null ? void 0 : e.scrollTop) ?? n.top };
21
+ }, [i, r, u, n.top, n.prefix, l]);
22
+ const V = B((t) => {
23
+ let e = 0, o = r.length;
24
+ for (; e < o; ) {
25
+ const s = Math.floor((e + o) / 2);
26
+ u[s + 1] <= t ? e = s + 1 : o = s;
27
+ }
28
+ return Math.min(e, Math.max(0, r.length - 1));
29
+ }, [r.length, u]), d = i ? Math.max(0, V(Math.max(0, n.top - n.prefix)) - 3) : 0, x = i ? Math.min(r.length, V(Math.max(0, n.top + n.height - n.prefix)) + 4) : r.length, p = B(() => {
30
+ var c;
31
+ const t = l.current;
32
+ if (!t) return;
33
+ const e = ((c = t.querySelector(".u-table-filter-options__bulk")) == null ? void 0 : c.getBoundingClientRect().height) ?? 0, o = Number.parseFloat(getComputedStyle(t).getPropertyValue("--u-unit")) || 1, s = { top: t.scrollTop, height: t.clientHeight || 170, prefix: e, estimate: 40 * o };
34
+ I((a) => Object.entries(s).every(([M, K]) => a[M] === K) ? a : s);
35
+ }, [l]);
36
+ g(() => {
37
+ if (!i || (p(), !l.current)) return;
38
+ let e = !1;
39
+ for (const [o, s] of f.current) {
40
+ const c = s.getBoundingClientRect().height;
41
+ c > 0 && Math.abs((h.current.get(o) ?? n.estimate) - c) > 0.5 && (h.current.set(o, c), e = !0);
42
+ }
43
+ e && b((o) => o + 1);
44
+ }, [i, d, x, r, l, p, n.estimate, S]), g(() => {
45
+ const t = l.current;
46
+ if (!i || !t || typeof ResizeObserver > "u") return;
47
+ let e = t.getBoundingClientRect().width;
48
+ const o = new ResizeObserver(() => {
49
+ const s = t.getBoundingClientRect().width;
50
+ Math.abs(s - e) > 0.5 && (e = s, h.current.clear(), b((c) => c + 1)), p();
51
+ });
52
+ return o.observe(t), () => o.disconnect();
53
+ }, [i, l, p]), g(() => {
54
+ var e;
55
+ if (!v) return;
56
+ const t = (e = f.current.get(v)) == null ? void 0 : e.querySelector("input");
57
+ t && (t.focus({ preventScroll: !0 }), T(null));
58
+ }, [v, d, x]);
59
+ const F = (t) => {
60
+ const e = l.current;
61
+ if (!e || t < 0 || t >= r.length) return;
62
+ const o = n.prefix + u[t], s = n.prefix + u[t + 1];
63
+ (o < e.scrollTop || s > e.scrollTop + n.height) && (e.scrollTop = o < e.scrollTop ? o : Math.max(0, s - n.height)), T(r[t]), p();
64
+ };
65
+ return {
66
+ start: d,
67
+ end: x,
68
+ topPadding: i ? u[d] : 0,
69
+ bottomPadding: i ? Math.max(0, u[r.length] - u[x]) : 0,
70
+ readViewport: p,
71
+ scrollToIndex: F,
72
+ rememberFocus: (t) => {
73
+ m.current = t;
74
+ },
75
+ register: (t, e) => {
76
+ e ? f.current.set(t, e) : f.current.delete(t);
77
+ }
78
+ };
79
+ }
80
+ export { _ as useVirtualOptionWindow$u };