bmdl-sdk 1.5.9 → 2.0.0

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 (345) hide show
  1. package/.prettierrc +37 -0
  2. package/bin/dev.js +5 -4
  3. package/bin/init.js +2 -1
  4. package/bmdl-sdk-2.0.0.tgz +0 -0
  5. package/global.d.ts +9 -0
  6. package/next.config.ts +27 -0
  7. package/package.json +35 -8
  8. package/postcss.config.mjs +5 -0
  9. package/public/favicon.ico +0 -0
  10. package/public/images/bg/404.bg.dark.png +0 -0
  11. package/public/images/bg/404.bg.png +0 -0
  12. package/public/images/bg/maintenance.bg.dark.png +0 -0
  13. package/public/images/bg/maintenance.bg.png +0 -0
  14. package/public/images/bg/not-authorized.bg.dark.png +0 -0
  15. package/public/images/bg/not-authorized.bg.png +0 -0
  16. package/public/images/bg/redirect.bg.dark.png +0 -0
  17. package/public/images/bg/redirect.bg.png +0 -0
  18. package/public/images/cover/email-verify.cover.dark.png +0 -0
  19. package/public/images/cover/email-verify.cover.png +0 -0
  20. package/public/images/cover/login.cover.dark.png +0 -0
  21. package/public/images/cover/login.cover.png +0 -0
  22. package/public/images/cover/password-forgot.cover.dark.png +0 -0
  23. package/public/images/cover/password-forgot.cover.png +0 -0
  24. package/public/images/cover/password-reset.cover.dark.png +0 -0
  25. package/public/images/cover/password-reset.cover.png +0 -0
  26. package/public/images/cover/register.cover.dark.png +0 -0
  27. package/public/images/cover/register.cover.png +0 -0
  28. package/public/images/cover/two-factor-verify.cover.dark.png +0 -0
  29. package/public/images/cover/two-factor-verify.cover.png +0 -0
  30. package/public/images/lang/en.png +0 -0
  31. package/public/images/lang/ru.png +0 -0
  32. package/public/locales/en/datasets.json +92 -0
  33. package/public/locales/en/errors.json +402 -0
  34. package/public/locales/en/general.json +139 -0
  35. package/public/locales/ru/datasets.json +92 -0
  36. package/public/locales/ru/errors.json +406 -0
  37. package/public/locales/ru/general.json +139 -0
  38. package/src/app/datasets/page.tsx +25 -0
  39. package/src/app/layout.tsx +45 -0
  40. package/src/app/not-found.tsx +34 -0
  41. package/src/app/page.tsx +24 -0
  42. package/src/components/atoms/Actions/Actions.styles.ts +31 -0
  43. package/src/components/atoms/Actions/Actions.tsx +45 -0
  44. package/src/components/atoms/Actions/index.ts +1 -0
  45. package/src/components/atoms/Avatar/Avatar.styles.ts +95 -0
  46. package/src/components/atoms/Avatar/Avatar.tsx +46 -0
  47. package/src/components/atoms/Avatar/index.ts +1 -0
  48. package/src/components/atoms/Badge/Badge.styles.ts +93 -0
  49. package/src/components/atoms/Badge/Badge.tsx +31 -0
  50. package/src/components/atoms/Badge/index.ts +1 -0
  51. package/src/components/atoms/Button/Button.styles.ts +189 -0
  52. package/src/components/atoms/Button/Button.tsx +29 -0
  53. package/src/components/atoms/Button/index.ts +1 -0
  54. package/src/components/atoms/Calendar/Calendar.styles.ts +227 -0
  55. package/src/components/atoms/Calendar/Calendar.tsx +96 -0
  56. package/src/components/atoms/Calendar/index.ts +1 -0
  57. package/src/components/atoms/Checkbox/Checkbox.styles.ts +37 -0
  58. package/src/components/atoms/Checkbox/Checkbox.tsx +26 -0
  59. package/src/components/atoms/Checkbox/index.ts +1 -0
  60. package/src/components/atoms/Date/Date.styles.ts +6 -0
  61. package/src/components/atoms/Date/Date.tsx +27 -0
  62. package/src/components/atoms/Date/index.ts +1 -0
  63. package/src/components/atoms/DatePicker/DatePicker.styles.ts +53 -0
  64. package/src/components/atoms/DatePicker/DatePicker.tsx +114 -0
  65. package/src/components/atoms/DatePicker/DatePicker.utils.tsx +49 -0
  66. package/src/components/atoms/DatePicker/index.ts +1 -0
  67. package/src/components/atoms/Dialog/Dialog.styles.ts +71 -0
  68. package/src/components/atoms/Dialog/Dialog.tsx +55 -0
  69. package/src/components/atoms/Dialog/index.ts +1 -0
  70. package/src/components/atoms/Dropdown/Divider/Divider.styles.ts +8 -0
  71. package/src/components/atoms/Dropdown/Divider/Divider.tsx +14 -0
  72. package/src/components/atoms/Dropdown/Divider/index.ts +1 -0
  73. package/src/components/atoms/Dropdown/Dropdown.styles.ts +31 -0
  74. package/src/components/atoms/Dropdown/Dropdown.tsx +48 -0
  75. package/src/components/atoms/Dropdown/Item/Item.styles.ts +12 -0
  76. package/src/components/atoms/Dropdown/Item/Item.tsx +18 -0
  77. package/src/components/atoms/Dropdown/Item/index.ts +1 -0
  78. package/src/components/atoms/Dropdown/index.ts +1 -0
  79. package/src/components/atoms/Form/Form.styles.ts +23 -0
  80. package/src/components/atoms/Form/Form.tsx +21 -0
  81. package/src/components/atoms/Form/Item/Item.styles.ts +23 -0
  82. package/src/components/atoms/Form/Item/Item.tsx +11 -0
  83. package/src/components/atoms/Form/Item/index.ts +1 -0
  84. package/src/components/atoms/Form/Label/Label.tsx +11 -0
  85. package/src/components/atoms/Form/Label/index.ts +1 -0
  86. package/src/components/atoms/Form/Message/Message.tsx +29 -0
  87. package/src/components/atoms/Form/Message/index.ts +1 -0
  88. package/src/components/atoms/Form/index.ts +1 -0
  89. package/src/components/atoms/Input/Email/Email.tsx +11 -0
  90. package/src/components/atoms/Input/Email/index.ts +1 -0
  91. package/src/components/atoms/Input/Input.styles.ts +77 -0
  92. package/src/components/atoms/Input/Input.tsx +29 -0
  93. package/src/components/atoms/Input/Number/Number.tsx +12 -0
  94. package/src/components/atoms/Input/Number/index.ts +1 -0
  95. package/src/components/atoms/Input/OTP/OTP.styles.ts +30 -0
  96. package/src/components/atoms/Input/OTP/OTP.tsx +23 -0
  97. package/src/components/atoms/Input/OTP/index.ts +1 -0
  98. package/src/components/atoms/Input/Password/Password.tsx +11 -0
  99. package/src/components/atoms/Input/Password/index.ts +1 -0
  100. package/src/components/atoms/Input/Search/Search.tsx +12 -0
  101. package/src/components/atoms/Input/Search/index.ts +1 -0
  102. package/src/components/atoms/Input/index.ts +1 -0
  103. package/src/components/atoms/Label/Label.styles.ts +29 -0
  104. package/src/components/atoms/Label/Label.tsx +18 -0
  105. package/src/components/atoms/Label/index.ts +1 -0
  106. package/src/components/atoms/Logo/Logo.styles.ts +16 -0
  107. package/src/components/atoms/Logo/Logo.tsx +20 -0
  108. package/src/components/atoms/Logo/index.ts +1 -0
  109. package/src/components/atoms/Pagination/Pagination.styles.ts +77 -0
  110. package/src/components/atoms/Pagination/Pagination.tsx +131 -0
  111. package/src/components/atoms/Pagination/index.ts +1 -0
  112. package/src/components/atoms/Popover/Popover.styles.ts +28 -0
  113. package/src/components/atoms/Popover/Popover.tsx +46 -0
  114. package/src/components/atoms/Popover/index.ts +1 -0
  115. package/src/components/atoms/Radio/Item/Item.styles.ts +35 -0
  116. package/src/components/atoms/Radio/Item/Item.tsx +18 -0
  117. package/src/components/atoms/Radio/Item/index.ts +1 -0
  118. package/src/components/atoms/Radio/Radio.styles.ts +25 -0
  119. package/src/components/atoms/Radio/Radio.tsx +21 -0
  120. package/src/components/atoms/Radio/index.ts +1 -0
  121. package/src/components/atoms/RangeNumber/RangeNumber.tsx +33 -0
  122. package/src/components/atoms/RangeNumber/index.ts +1 -0
  123. package/src/components/atoms/Select/Item/Item.styles.ts +22 -0
  124. package/src/components/atoms/Select/Item/Item.tsx +17 -0
  125. package/src/components/atoms/Select/Item/index.ts +1 -0
  126. package/src/components/atoms/Select/Select.styles.ts +149 -0
  127. package/src/components/atoms/Select/Select.tsx +68 -0
  128. package/src/components/atoms/Select/index.ts +1 -0
  129. package/src/components/atoms/Separator/Separator.styles.ts +13 -0
  130. package/src/components/atoms/Separator/Separator.tsx +20 -0
  131. package/src/components/atoms/Separator/index.ts +1 -0
  132. package/src/components/atoms/Sheet/Sheet.styles.ts +100 -0
  133. package/src/components/atoms/Sheet/Sheet.tsx +53 -0
  134. package/src/components/atoms/Sheet/index.ts +1 -0
  135. package/src/components/atoms/Skeleton/Skeleton.styles.ts +30 -0
  136. package/src/components/atoms/Skeleton/Skeleton.tsx +11 -0
  137. package/src/components/atoms/Skeleton/index.ts +1 -0
  138. package/src/components/atoms/Spin/Spin.styles.ts +17 -0
  139. package/src/components/atoms/Spin/Spin.tsx +19 -0
  140. package/src/components/atoms/Spin/index.ts +1 -0
  141. package/src/components/atoms/Switch/Switch.styles.ts +34 -0
  142. package/src/components/atoms/Switch/Switch.tsx +20 -0
  143. package/src/components/atoms/Switch/index.ts +1 -0
  144. package/src/components/atoms/Table/FilterContent/FilterContent.styles.ts +33 -0
  145. package/src/components/atoms/Table/FilterContent/FilterContent.tsx +300 -0
  146. package/src/components/atoms/Table/FilterContent/index.ts +1 -0
  147. package/src/components/atoms/Table/FilterIcon/FilterIcon.tsx +16 -0
  148. package/src/components/atoms/Table/FilterIcon/index.ts +1 -0
  149. package/src/components/atoms/Table/SortIcon/SortIcon.tsx +32 -0
  150. package/src/components/atoms/Table/SortIcon/index.ts +1 -0
  151. package/src/components/atoms/Table/Table.styles.ts +178 -0
  152. package/src/components/atoms/Table/Table.tsx +484 -0
  153. package/src/components/atoms/Table/Table.utils.tsx +19 -0
  154. package/src/components/atoms/Table/index.ts +1 -0
  155. package/src/components/atoms/Tabs/Tabs.tsx +15 -0
  156. package/src/components/atoms/Tabs/index.ts +1 -0
  157. package/src/components/atoms/Textarea/Textarea.styles.ts +64 -0
  158. package/src/components/atoms/Textarea/Textarea.tsx +15 -0
  159. package/src/components/atoms/Textarea/index.ts +1 -0
  160. package/src/components/atoms/Toast/Toast.styles.ts +35 -0
  161. package/src/components/atoms/Toast/Toast.tsx +85 -0
  162. package/src/components/atoms/Toast/Toast.utils.tsx +43 -0
  163. package/src/components/atoms/Toast/index.ts +1 -0
  164. package/src/components/atoms/Tooltip/Tooltip.styles.ts +33 -0
  165. package/src/components/atoms/Tooltip/Tooltip.tsx +32 -0
  166. package/src/components/atoms/Tooltip/index.ts +1 -0
  167. package/src/components/atoms/Typography/Display/Display.styles.ts +26 -0
  168. package/src/components/atoms/Typography/Display/Display.tsx +11 -0
  169. package/src/components/atoms/Typography/Display/index.ts +1 -0
  170. package/src/components/atoms/Typography/Link/Link.styles.ts +32 -0
  171. package/src/components/atoms/Typography/Link/Link.tsx +25 -0
  172. package/src/components/atoms/Typography/Link/index.ts +1 -0
  173. package/src/components/atoms/Typography/Paragraph/Paragraph.styles.ts +32 -0
  174. package/src/components/atoms/Typography/Paragraph/Paragraph.tsx +11 -0
  175. package/src/components/atoms/Typography/Paragraph/index.ts +1 -0
  176. package/src/components/atoms/Typography/Text/Text.styles.ts +39 -0
  177. package/src/components/atoms/Typography/Text/Text.tsx +25 -0
  178. package/src/components/atoms/Typography/Text/index.ts +1 -0
  179. package/src/components/atoms/Typography/Title/Title.styles.ts +28 -0
  180. package/src/components/atoms/Typography/Title/Title.tsx +15 -0
  181. package/src/components/atoms/Typography/Title/index.ts +1 -0
  182. package/src/components/atoms/Typography/Typography.tsx +21 -0
  183. package/src/components/atoms/Typography/index.ts +1 -0
  184. package/src/components/atoms/icons/AvanpostIcon.tsx +31 -0
  185. package/src/components/atoms/icons/CheckIcon.tsx +22 -0
  186. package/src/components/atoms/icons/EmptyIcon.tsx +56 -0
  187. package/src/components/atoms/icons/LogoIcon.tsx +141 -0
  188. package/src/components/atoms/icons/NumberTypeIcon.tsx +25 -0
  189. package/src/components/atoms/icons/SidebarCloseIcon.tsx +75 -0
  190. package/src/components/atoms/icons/index.ts +6 -0
  191. package/src/components/atoms/index.ts +31 -0
  192. package/src/components/molecules/DataTable/CreationModal/CreationModal.tsx +31 -0
  193. package/src/components/molecules/DataTable/CreationModal/index.ts +1 -0
  194. package/src/components/molecules/DataTable/DataTable.styles.ts +23 -0
  195. package/src/components/molecules/DataTable/DataTable.tsx +167 -0
  196. package/src/components/molecules/DataTable/Name/Name.tsx +20 -0
  197. package/src/components/molecules/DataTable/Name/index.ts +1 -0
  198. package/src/components/molecules/DataTable/Skeleton/Skeleton.tsx +27 -0
  199. package/src/components/molecules/DataTable/Skeleton/index.ts +6 -0
  200. package/src/components/molecules/DataTable/index.ts +8 -0
  201. package/src/components/molecules/Header/Button/Button.styles.ts +24 -0
  202. package/src/components/molecules/Header/Button/Button.tsx +20 -0
  203. package/src/components/molecules/Header/Button/index.ts +1 -0
  204. package/src/components/molecules/Header/Header.styles.ts +16 -0
  205. package/src/components/molecules/Header/Header.tsx +20 -0
  206. package/src/components/molecules/Header/Navigate/Navigate.tsx +40 -0
  207. package/src/components/molecules/Header/Navigate/index.ts +1 -0
  208. package/src/components/molecules/Header/SelectLang/SelectLang.tsx +47 -0
  209. package/src/components/molecules/Header/SelectLang/index.ts +2 -0
  210. package/src/components/molecules/Header/SelectTheme/SelectTheme.tsx +43 -0
  211. package/src/components/molecules/Header/SelectTheme/index.ts +1 -0
  212. package/src/components/molecules/Header/index.ts +2 -0
  213. package/src/components/molecules/ProjectIcon/ProjectIcon.styles.ts +23 -0
  214. package/src/components/molecules/ProjectIcon/ProjectIcon.tsx +37 -0
  215. package/src/components/molecules/ProjectIcon/index.ts +1 -0
  216. package/src/components/molecules/Sidebar/Item/Item.styles.ts +52 -0
  217. package/src/components/molecules/Sidebar/Item/Item.tsx +30 -0
  218. package/src/components/molecules/Sidebar/Item/index.ts +1 -0
  219. package/src/components/molecules/Sidebar/Sidebar.styles.ts +97 -0
  220. package/src/components/molecules/Sidebar/Sidebar.tsx +122 -0
  221. package/src/components/molecules/Sidebar/Sidebar.utils.tsx +36 -0
  222. package/src/components/molecules/Sidebar/Trigger/Trigger.tsx +23 -0
  223. package/src/components/molecules/Sidebar/Trigger/index.ts +1 -0
  224. package/src/components/molecules/Sidebar/index.ts +1 -0
  225. package/src/components/molecules/Widget/Content/Content.tsx +80 -0
  226. package/src/components/molecules/Widget/Content/index.ts +1 -0
  227. package/src/components/molecules/Widget/Toolbox/Toolbox.tsx +0 -0
  228. package/src/components/molecules/Widget/Toolbox/index.ts +0 -0
  229. package/src/components/molecules/Widget/Widget.tsx +26 -0
  230. package/src/components/molecules/Widget/Widget.utils.tsx +31 -0
  231. package/src/components/molecules/Widget/index.ts +2 -0
  232. package/src/components/molecules/index.ts +6 -0
  233. package/src/components/organisms/ComponentWidget/ComponentWidget.tsx +107 -0
  234. package/src/components/organisms/ComponentWidget/index.ts +2 -0
  235. package/src/components/organisms/DatasetsTable/Creation/Creation.tsx +105 -0
  236. package/src/components/organisms/DatasetsTable/Creation/Navigate/Navigate.tsx +59 -0
  237. package/src/components/organisms/DatasetsTable/Creation/Navigate/index.ts +1 -0
  238. package/src/components/organisms/DatasetsTable/Creation/Step/Step.styles.ts +12 -0
  239. package/src/components/organisms/DatasetsTable/Creation/Step/Step.tsx +43 -0
  240. package/src/components/organisms/DatasetsTable/Creation/Step/index.ts +1 -0
  241. package/src/components/organisms/DatasetsTable/Creation/Steps/Step1/Step1.styles.ts +41 -0
  242. package/src/components/organisms/DatasetsTable/Creation/Steps/Step1/Step1.tsx +67 -0
  243. package/src/components/organisms/DatasetsTable/Creation/Steps/Step1/index.ts +1 -0
  244. package/src/components/organisms/DatasetsTable/Creation/Steps/Step2/SelectSource/SelectSource.tsx +252 -0
  245. package/src/components/organisms/DatasetsTable/Creation/Steps/Step2/SelectSource/index.ts +1 -0
  246. package/src/components/organisms/DatasetsTable/Creation/Steps/Step2/Step2.tsx +11 -0
  247. package/src/components/organisms/DatasetsTable/Creation/Steps/Step2/UploadFile/UploadFile.tsx +112 -0
  248. package/src/components/organisms/DatasetsTable/Creation/Steps/Step2/UploadFile/index.ts +1 -0
  249. package/src/components/organisms/DatasetsTable/Creation/Steps/Step2/index.ts +1 -0
  250. package/src/components/organisms/DatasetsTable/Creation/Steps/Step3/Step3.tsx +145 -0
  251. package/src/components/organisms/DatasetsTable/Creation/Steps/Step3/index.ts +1 -0
  252. package/src/components/organisms/DatasetsTable/Creation/Steps/Step4/Step4.tsx +120 -0
  253. package/src/components/organisms/DatasetsTable/Creation/Steps/Step4/index.ts +1 -0
  254. package/src/components/organisms/DatasetsTable/Creation/Steps/index.ts +4 -0
  255. package/src/components/organisms/DatasetsTable/Creation/index.ts +1 -0
  256. package/src/components/organisms/DatasetsTable/DatasetsTable.tsx +81 -0
  257. package/src/components/organisms/DatasetsTable/DatasetsTable.utils.tsx +125 -0
  258. package/src/components/organisms/DatasetsTable/Source/Source.styles.ts +7 -0
  259. package/src/components/organisms/DatasetsTable/Source/Source.tsx +39 -0
  260. package/src/components/organisms/DatasetsTable/Source/Source.utils.tsx +45 -0
  261. package/src/components/organisms/DatasetsTable/Source/index.ts +1 -0
  262. package/src/components/organisms/DatasetsTable/Status/Status.styles.ts +25 -0
  263. package/src/components/organisms/DatasetsTable/Status/Status.tsx +29 -0
  264. package/src/components/organisms/DatasetsTable/Status/Status.utils.tsx +29 -0
  265. package/src/components/organisms/DatasetsTable/Status/index.ts +1 -0
  266. package/src/components/organisms/DatasetsTable/Type/Type.styles.ts +7 -0
  267. package/src/components/organisms/DatasetsTable/Type/Type.tsx +32 -0
  268. package/src/components/organisms/DatasetsTable/Type/Type.utils.tsx +14 -0
  269. package/src/components/organisms/DatasetsTable/Type/index.ts +1 -0
  270. package/src/components/organisms/DatasetsTable/index.ts +1 -0
  271. package/src/components/organisms/index.ts +3 -0
  272. package/src/components/templates/DefaultLayout/DefaultLayout.styles.ts +26 -0
  273. package/src/components/templates/DefaultLayout/DefaultLayout.tsx +41 -0
  274. package/src/components/templates/DefaultLayout/index.ts +1 -0
  275. package/src/components/templates/PageLayout/PageLayout.styles.ts +25 -0
  276. package/src/components/templates/PageLayout/PageLayout.tsx +28 -0
  277. package/src/components/templates/PageLayout/index.ts +1 -0
  278. package/src/components/templates/index.ts +3 -0
  279. package/src/config/i18n.config.ts +46 -0
  280. package/src/constants/index.ts +10 -0
  281. package/src/contexts/CreateComponentContext/CreateComponentContext.tsx +17 -0
  282. package/src/contexts/CreateComponentContext/index.ts +4 -0
  283. package/src/contexts/CreateDatasetContext/CreateDatasetContext.tsx +25 -0
  284. package/src/contexts/CreateDatasetContext/index.ts +4 -0
  285. package/src/contexts/ProjectContext/ProjectContext.tsx +32 -0
  286. package/src/contexts/ProjectContext/index.ts +1 -0
  287. package/src/contexts/SidebarContext/SidebarContext.tsx +10 -0
  288. package/src/contexts/SidebarContext/index.ts +1 -0
  289. package/src/contexts/index.ts +10 -0
  290. package/src/hooks/index.ts +9 -0
  291. package/src/hooks/useCreateComponent.ts +15 -0
  292. package/src/hooks/useCreateDataset.ts +15 -0
  293. package/src/hooks/useDebounce.ts +17 -0
  294. package/src/hooks/useDebounced.ts +31 -0
  295. package/src/hooks/useIsMobile.ts +27 -0
  296. package/src/hooks/useSidebar.ts +15 -0
  297. package/src/hooks/useStickyHeader.ts +35 -0
  298. package/src/hooks/useWindowSize.ts +27 -0
  299. package/src/providers/CreateComponentProvider/CreateComponentProvider.tsx +53 -0
  300. package/src/providers/CreateComponentProvider/index.ts +1 -0
  301. package/src/providers/CreateDatasetProvider/CreateDatasetProvider.tsx +73 -0
  302. package/src/providers/CreateDatasetProvider/index.ts +1 -0
  303. package/src/providers/LangProvider/LangProvider.tsx +15 -0
  304. package/src/providers/LangProvider/index.ts +1 -0
  305. package/src/providers/ProjectProvider/ProjectProvider.tsx +110 -0
  306. package/src/providers/ProjectProvider/index.ts +1 -0
  307. package/src/providers/SidebarProvider/SidebarProvider.tsx +51 -0
  308. package/src/providers/SidebarProvider/index.ts +1 -0
  309. package/src/providers/ThemeProvider/ThemeProvider.tsx +20 -0
  310. package/src/providers/ThemeProvider/index.ts +1 -0
  311. package/src/providers/index.ts +6 -0
  312. package/src/store/index.ts +2 -0
  313. package/src/store/sidebar/sidebar.store.ts +17 -0
  314. package/src/store/sidebar/sidebar.type.ts +4 -0
  315. package/src/styles/globals.css +202 -0
  316. package/src/types/component.type.ts +13 -0
  317. package/src/types/dataset.type.ts +25 -0
  318. package/src/types/file.type.ts +13 -0
  319. package/src/types/general.type.ts +86 -0
  320. package/src/types/index.ts +9 -0
  321. package/src/types/layer.type.ts +7 -0
  322. package/src/types/project.type.ts +15 -0
  323. package/src/types/user.type.ts +6 -0
  324. package/src/types/widget.type.ts +12 -0
  325. package/src/utils/bm.util.ts +150 -0
  326. package/src/utils/bytes.util.ts +110 -0
  327. package/src/utils/date.util.ts +49 -0
  328. package/src/utils/dynamicMessage.util.ts +9 -0
  329. package/src/utils/getInitials.util.ts +10 -0
  330. package/src/utils/hideEmail.util.ts +14 -0
  331. package/src/utils/index.ts +12 -0
  332. package/src/utils/pagination.util.ts +144 -0
  333. package/src/utils/twJoin.util.ts +49 -0
  334. package/src/utils/twMerge.util.ts +6 -0
  335. package/src/utils/upload.util.ts +26 -0
  336. package/src/utils/url.util.ts +29 -0
  337. package/templates/App.tsx +1 -1
  338. package/templates/config.ts +1 -1
  339. package/templates/dataOptions.ts +1 -1
  340. package/templates/viewOptions.ts +1 -1
  341. package/tsconfig.json +40 -6
  342. package/bmdl-sdk-1.5.9.tgz +0 -0
  343. package/index.html +0 -12
  344. package/src/App.tsx +0 -187
  345. package/src/main.tsx +0 -15
@@ -0,0 +1,252 @@
1
+ import { useTranslations } from 'next-intl'
2
+
3
+ import { TbApi, TbDatabase } from 'react-icons/tb'
4
+
5
+ import { Input, Label, Radio, Typography } from '@/components/atoms'
6
+
7
+ const { Title, Text } = Typography
8
+
9
+ function SelectSource() {
10
+ const tg = useTranslations()
11
+ const t = useTranslations('datasets.creation.steps.two.source')
12
+ //
13
+ return (
14
+ <div className='flex flex-col gap-y-4'>
15
+ <Input.Search placeholder={tg('search')} />
16
+ <Title level={5}>{t('title')}</Title>
17
+ <div className='-mr-6 mb-4 max-h-95 overflow-y-auto pr-4'>
18
+ <Radio className='flex flex-col gap-y-3'>
19
+ <Label
20
+ htmlFor='sourse-1'
21
+ className='flex items-center justify-between'
22
+ >
23
+ <div className='flex w-full items-center gap-x-4'>
24
+ <div className='bg-gray/15 text-gray flex size-9.5 items-center justify-center rounded-lg [&_svg]:size-6'>
25
+ <TbDatabase />
26
+ </div>
27
+ <div className='flex flex-col whitespace-nowrap'>
28
+ <Text accent>1C_ЗУП</Text>
29
+ <Text muted size={'sm'}>
30
+ Postgres
31
+ </Text>
32
+ </div>
33
+ </div>
34
+
35
+ <Radio.Item value='sourse-1' id='sourse-1' />
36
+ </Label>
37
+
38
+ <Label
39
+ htmlFor='sourse-2'
40
+ className='flex items-center justify-between'
41
+ >
42
+ <div className='flex w-full items-center gap-x-4'>
43
+ <div className='bg-gray/15 text-gray flex size-9.5 items-center justify-center rounded-lg [&_svg]:size-6'>
44
+ <TbApi />
45
+ </div>
46
+ <div className='flex flex-col whitespace-nowrap'>
47
+ <Text accent>srv-obvp-243.bft.local:8080</Text>
48
+ <Text muted size={'sm'}>
49
+ ПА
50
+ </Text>
51
+ </div>
52
+ </div>
53
+
54
+ <Radio.Item value='sourse-2' id='sourse-2' />
55
+ </Label>
56
+
57
+ <Label
58
+ htmlFor='sourse-3'
59
+ className='flex items-center justify-between'
60
+ >
61
+ <div className='flex w-full items-center gap-x-4'>
62
+ <div className='bg-gray/15 text-gray flex size-9.5 items-center justify-center rounded-lg [&_svg]:size-6'>
63
+ <TbApi />
64
+ </div>
65
+ <div className='flex flex-col whitespace-nowrap'>
66
+ <Text accent>Тестовый стенд полиматики</Text>
67
+ <Text muted size={'sm'}>
68
+ ПА
69
+ </Text>
70
+ </div>
71
+ </div>
72
+
73
+ <Radio.Item value='sourse-3' id='sourse-3' />
74
+ </Label>
75
+
76
+ <Label
77
+ htmlFor='sourse-4'
78
+ className='flex items-center justify-between'
79
+ >
80
+ <div className='flex w-full items-center gap-x-4'>
81
+ <div className='bg-gray/15 text-gray flex size-9.5 items-center justify-center rounded-lg [&_svg]:size-6'>
82
+ <TbDatabase />
83
+ </div>
84
+ <div className='flex flex-col whitespace-nowrap'>
85
+ <Text accent>БД. НО</Text>
86
+ <Text muted size={'sm'}>
87
+ ClickHouse
88
+ </Text>
89
+ </div>
90
+ </div>
91
+
92
+ <Radio.Item value='sourse-4' id='sourse-4' />
93
+ </Label>
94
+
95
+ <Label
96
+ htmlFor='sourse-5'
97
+ className='flex items-center justify-between'
98
+ >
99
+ <div className='flex w-full items-center gap-x-4'>
100
+ <div className='bg-gray/15 text-gray flex size-9.5 items-center justify-center rounded-lg [&_svg]:size-6'>
101
+ <TbDatabase />
102
+ </div>
103
+ <div className='flex flex-col whitespace-nowrap'>
104
+ <Text accent>БД. УО</Text>
105
+ <Text muted size={'sm'}>
106
+ Postgres
107
+ </Text>
108
+ </div>
109
+ </div>
110
+
111
+ <Radio.Item value='sourse-5' id='sourse-5' />
112
+ </Label>
113
+
114
+ <Label
115
+ htmlFor='sourse-6'
116
+ className='flex items-center justify-between'
117
+ >
118
+ <div className='flex w-full items-center gap-x-4'>
119
+ <div className='bg-gray/15 text-gray flex size-9.5 items-center justify-center rounded-lg [&_svg]:size-6'>
120
+ <TbApi />
121
+ </div>
122
+ <div className='flex flex-col whitespace-nowrap'>
123
+ <Text accent>Источник ПА</Text>
124
+ <Text muted size={'sm'}>
125
+ ПА
126
+ </Text>
127
+ </div>
128
+ </div>
129
+
130
+ <Radio.Item value='sourse-6' id='sourse-6' />
131
+ </Label>
132
+
133
+ <Label
134
+ htmlFor='sourse-7'
135
+ className='flex items-center justify-between'
136
+ >
137
+ <div className='flex w-full items-center gap-x-4'>
138
+ <div className='bg-gray/15 text-gray flex size-9.5 items-center justify-center rounded-lg [&_svg]:size-6'>
139
+ <TbDatabase />
140
+ </div>
141
+ <div className='flex flex-col whitespace-nowrap'>
142
+ <Text accent>1C_ЗУП</Text>
143
+ <Text muted size={'sm'}>
144
+ Postgres
145
+ </Text>
146
+ </div>
147
+ </div>
148
+
149
+ <Radio.Item value='sourse-7' id='sourse-7' />
150
+ </Label>
151
+
152
+ <Label
153
+ htmlFor='sourse-8'
154
+ className='flex items-center justify-between'
155
+ >
156
+ <div className='flex w-full items-center gap-x-4'>
157
+ <div className='bg-gray/15 text-gray flex size-9.5 items-center justify-center rounded-lg [&_svg]:size-6'>
158
+ <TbApi />
159
+ </div>
160
+ <div className='flex flex-col whitespace-nowrap'>
161
+ <Text accent>srv-obvp-243.bft.local:8080</Text>
162
+ <Text muted size={'sm'}>
163
+ ПА
164
+ </Text>
165
+ </div>
166
+ </div>
167
+
168
+ <Radio.Item value='sourse-8' id='sourse-8' />
169
+ </Label>
170
+
171
+ <Label
172
+ htmlFor='sourse-9'
173
+ className='flex items-center justify-between'
174
+ >
175
+ <div className='flex w-full items-center gap-x-4'>
176
+ <div className='bg-gray/15 text-gray flex size-9.5 items-center justify-center rounded-lg [&_svg]:size-6'>
177
+ <TbApi />
178
+ </div>
179
+ <div className='flex flex-col whitespace-nowrap'>
180
+ <Text accent>Тестовый стенд полиматики</Text>
181
+ <Text muted size={'sm'}>
182
+ ПА
183
+ </Text>
184
+ </div>
185
+ </div>
186
+
187
+ <Radio.Item value='sourse-9' id='sourse-9' />
188
+ </Label>
189
+
190
+ <Label
191
+ htmlFor='sourse-10'
192
+ className='flex items-center justify-between'
193
+ >
194
+ <div className='flex w-full items-center gap-x-4'>
195
+ <div className='bg-gray/15 text-gray flex size-9.5 items-center justify-center rounded-lg [&_svg]:size-6'>
196
+ <TbDatabase />
197
+ </div>
198
+ <div className='flex flex-col whitespace-nowrap'>
199
+ <Text accent>БД. НО</Text>
200
+ <Text muted size={'sm'}>
201
+ ClickHouse
202
+ </Text>
203
+ </div>
204
+ </div>
205
+
206
+ <Radio.Item value='sourse-10' id='sourse-10' />
207
+ </Label>
208
+
209
+ <Label
210
+ htmlFor='sourse-11'
211
+ className='flex items-center justify-between'
212
+ >
213
+ <div className='flex w-full items-center gap-x-4'>
214
+ <div className='bg-gray/15 text-gray flex size-9.5 items-center justify-center rounded-lg [&_svg]:size-6'>
215
+ <TbDatabase />
216
+ </div>
217
+ <div className='flex flex-col whitespace-nowrap'>
218
+ <Text accent>БД. УО</Text>
219
+ <Text muted size={'sm'}>
220
+ Postgres
221
+ </Text>
222
+ </div>
223
+ </div>
224
+
225
+ <Radio.Item value='sourse-11' id='sourse-11' />
226
+ </Label>
227
+
228
+ <Label
229
+ htmlFor='sourse-12'
230
+ className='flex items-center justify-between'
231
+ >
232
+ <div className='flex w-full items-center gap-x-4'>
233
+ <div className='bg-gray/15 text-gray flex size-9.5 items-center justify-center rounded-lg [&_svg]:size-6'>
234
+ <TbApi />
235
+ </div>
236
+ <div className='flex flex-col whitespace-nowrap'>
237
+ <Text accent>Источник ПА</Text>
238
+ <Text muted size={'sm'}>
239
+ ПА
240
+ </Text>
241
+ </div>
242
+ </div>
243
+
244
+ <Radio.Item value='sourse-12' id='sourse-12' />
245
+ </Label>
246
+ </Radio>
247
+ </div>
248
+ </div>
249
+ )
250
+ }
251
+
252
+ export { SelectSource }
@@ -0,0 +1 @@
1
+ export { SelectSource } from './SelectSource'
@@ -0,0 +1,11 @@
1
+ import { SelectSource } from './SelectSource'
2
+ import { UploadFile } from './UploadFile'
3
+ import { useCreateDataset } from '@/hooks'
4
+
5
+ function Step2() {
6
+ const { sourceType } = useCreateDataset()
7
+
8
+ return sourceType === 'source' ? <SelectSource /> : <UploadFile />
9
+ }
10
+
11
+ export { Step2 }
@@ -0,0 +1,112 @@
1
+ 'use client'
2
+
3
+ import { useTranslations } from 'next-intl'
4
+ import { useState } from 'react'
5
+
6
+ import { DatasetFileEncoding } from '@/graphql'
7
+
8
+ import { Input, Label, Select, Typography, Upload } from '@/components/atoms'
9
+
10
+ import { useCreateDataset } from '@/hooks'
11
+ import { bytes, SizeStringValue } from '@/utils'
12
+
13
+ const { Title } = Typography
14
+
15
+ const maxSize = bytes(
16
+ process.env.NEXT_PUBLIC_DATASET_MAX_SIZE as SizeStringValue
17
+ )
18
+
19
+ function UploadFile() {
20
+ const t = useTranslations('datasets.creation.steps.two.file')
21
+ //
22
+ const {
23
+ setName,
24
+ //
25
+ fileInfo,
26
+ setFileInfo,
27
+ //
28
+ datasetFileInfo,
29
+ setDatasetFileInfo
30
+ } = useCreateDataset()
31
+ //
32
+ const [format, setFormat] = useState('.csv,.txt')
33
+ //
34
+ const changeHandler = (files: any[]) => {
35
+ setName(files[0] ? files[0].originalName! : '')
36
+ setFileInfo(files[0] ? { ...files[0], progress: 100 } : null)
37
+ setDatasetFileInfo(prev => {
38
+ return {
39
+ ...prev,
40
+ path: files[0]?.path!
41
+ }
42
+ })
43
+ }
44
+ //
45
+ return (
46
+ <div className='mb-4 flex flex-col gap-y-4'>
47
+ <div className='grid grid-cols-24 gap-4'>
48
+ <div className='col-span-7 flex flex-col gap-1'>
49
+ <Label>{t('fields.format')}</Label>
50
+ <Select defaultValue={format} onValueChange={setFormat}>
51
+ <Select.Item value='.csv,.txt'>CSV</Select.Item>
52
+ <Select.Item value='.xlsx,.xls'>XLSX</Select.Item>
53
+ <Select.Item value='.json'>JSON</Select.Item>
54
+ <Select.Item value='.xml'>XML</Select.Item>
55
+ </Select>
56
+ </div>
57
+ {/* */}
58
+ <div className='col-span-9 flex flex-col gap-1'>
59
+ <Label>{t('fields.encoding')}</Label>
60
+ <Select
61
+ defaultValue={datasetFileInfo.encoding}
62
+ onValueChange={(value: DatasetFileEncoding) => {
63
+ setDatasetFileInfo(prev => {
64
+ return {
65
+ ...prev,
66
+ encoding: value
67
+ }
68
+ })
69
+ }}
70
+ disabled={!format.includes('csv')}
71
+ >
72
+ {/* <Select.Item value='windows-1251'>
73
+ windows-1251
74
+ </Select.Item>
75
+ <Select.Item value='maccyrillic'>
76
+ maccyrillic
77
+ </Select.Item>
78
+ <Select.Item value='koi8_r'>koi8_r</Select.Item>
79
+ <Select.Item value='utf-16'>utf-16</Select.Item> */}
80
+ <Select.Item value={DatasetFileEncoding.Utf_8}>
81
+ utf-8
82
+ </Select.Item>
83
+ </Select>
84
+ </div>
85
+ {/* */}
86
+ <div className='col-span-8 flex flex-col gap-1'>
87
+ <Label>{t('fields.separator')}</Label>
88
+ <Input
89
+ value={datasetFileInfo.separator}
90
+ onChange={e => {
91
+ setDatasetFileInfo(prev => {
92
+ return {
93
+ ...prev,
94
+ separator: e.target.value
95
+ }
96
+ })
97
+ }}
98
+ disabled={!format.includes('csv')}
99
+ />
100
+ </div>
101
+ </div>
102
+ <Upload
103
+ onChange={changeHandler}
104
+ acceptedTypes={format}
105
+ maxSize={maxSize}
106
+ defaultValue={fileInfo ? [fileInfo] : []}
107
+ />
108
+ </div>
109
+ )
110
+ }
111
+
112
+ export { UploadFile }
@@ -0,0 +1 @@
1
+ export { UploadFile } from './UploadFile'
@@ -0,0 +1 @@
1
+ export { Step2 } from './Step2'
@@ -0,0 +1,145 @@
1
+ 'use client'
2
+
3
+ import { useTranslations } from 'next-intl'
4
+ import { useEffect } from 'react'
5
+
6
+ import { useGetColumnsFromFileMutation } from '@/graphql'
7
+
8
+ import { BsToggles } from 'react-icons/bs'
9
+ import { TbCalendar, TbLetterCase } from 'react-icons/tb'
10
+
11
+ import { NumberTypeIcon } from '@/components/atoms/icons'
12
+
13
+ import { Select, Spin, Table, Typography } from '@/components/atoms'
14
+
15
+ import { useCreateDataset } from '@/hooks'
16
+
17
+ const { Title, Text } = Typography
18
+
19
+ function Step3() {
20
+ const tg = useTranslations()
21
+ const t = useTranslations('datasets.creation.steps.three')
22
+ //
23
+ const { datasetFileInfo, setColumns } = useCreateDataset()
24
+ //
25
+ const [getColumnsFromFile, { data, loading }] =
26
+ useGetColumnsFromFileMutation({
27
+ onCompleted(data) {
28
+ setColumns(data.getColumnsFromFile)
29
+ }
30
+ })
31
+ //
32
+ useEffect(() => {
33
+ if (datasetFileInfo.path) {
34
+ getColumnsFromFile({
35
+ variables: {
36
+ data: datasetFileInfo
37
+ }
38
+ })
39
+ }
40
+ }, [datasetFileInfo.path])
41
+ // const handleUpload = (files: Partial<FileModel>[]) => {
42
+
43
+ // }
44
+ //
45
+ const typeChangeHandler = (path: string, value: any) => {
46
+ setColumns(prev => {
47
+ const changeColumn = prev.find((col: any) => col.path === path)
48
+ //
49
+ // if (changeColumn) changeColumn.type = value
50
+ //
51
+ return prev
52
+ })
53
+ }
54
+ //
55
+ const onRowSelectionHandler = (ids: string[]) => {
56
+ // @ts-ignore
57
+ setColumns(prev => {
58
+ // // Проверяем, действительно ли нужно обновление
59
+ // const currentIds = prev.map(col => col.path).sort()
60
+ // const newIds = (ids as string[]).sort()
61
+
62
+ // if (
63
+ // currentIds.length === newIds.length &&
64
+ // currentIds.every((id, i) => id === newIds[i])
65
+ // ) {
66
+ // return prev // Возвращаем тот же массив, если нет изменений
67
+ // }
68
+
69
+ return data?.getColumnsFromFile
70
+ .filter(i => ids.includes(i.path))
71
+ .map(i => ({
72
+ name: i.name,
73
+ path: i.path,
74
+ type: i.type
75
+ }))
76
+ })
77
+ }
78
+ //
79
+ const getTableData = (data: any) => {
80
+ return data
81
+ ? data.getColumnsFromFile.map((dataItem: any) => {
82
+ return {
83
+ id: dataItem.path,
84
+ name: <Text>{dataItem.name}</Text>,
85
+ type: (
86
+ <Select
87
+ defaultValue={dataItem.type}
88
+ onValueChange={(value: any) =>
89
+ typeChangeHandler(dataItem.path, value)
90
+ }
91
+ className='w-34'
92
+ >
93
+ <Select.Item
94
+ value={
95
+ dataItem.type === 'DECIMAL'
96
+ ? 'DECIMAL'
97
+ : 'BIGINT'
98
+ }
99
+ >
100
+ <NumberTypeIcon /> {tg('typeof.number')}
101
+ </Select.Item>
102
+ <Select.Item value='TEXT'>
103
+ <TbLetterCase /> {tg('typeof.string')}
104
+ </Select.Item>
105
+ <Select.Item value='TIMESTAMP'>
106
+ <TbCalendar /> {tg('typeof.date')}
107
+ </Select.Item>
108
+ <Select.Item value='BOOLEAN'>
109
+ <BsToggles /> {tg('typeof.boolean')}
110
+ </Select.Item>
111
+ </Select>
112
+ )
113
+ }
114
+ })
115
+ : []
116
+ }
117
+
118
+ return (
119
+ <div className='flex flex-col gap-y-4'>
120
+ {loading ? (
121
+ <Spin />
122
+ ) : (
123
+ <Table
124
+ inModal
125
+ isAllChecked
126
+ dataSource={getTableData(data)}
127
+ columns={[
128
+ {
129
+ key: 'name',
130
+ title: t('columns.name')
131
+ },
132
+ {
133
+ key: 'type',
134
+ title: t('columns.type')
135
+ }
136
+ ]}
137
+ onRowSelection={onRowSelectionHandler}
138
+ className='mb-4 max-h-95 overflow-y-auto'
139
+ />
140
+ )}
141
+ </div>
142
+ )
143
+ }
144
+
145
+ export { Step3 }
@@ -0,0 +1 @@
1
+ export { Step3 } from './Step3'
@@ -0,0 +1,120 @@
1
+ import { zodResolver } from '@hookform/resolvers/zod'
2
+ import { useTranslations } from 'next-intl'
3
+ import { Controller, useForm } from 'react-hook-form'
4
+
5
+ import { useCreateDatasetMutation } from '@/graphql'
6
+
7
+ import { TbChevronLeft } from 'react-icons/tb'
8
+
9
+ import { CheckIcon } from '@/components/atoms/icons'
10
+
11
+ import {
12
+ Button,
13
+ Form,
14
+ Input,
15
+ Label,
16
+ Tags,
17
+ Textarea,
18
+ Typography
19
+ } from '@/components/atoms'
20
+
21
+ import { useCreateDataset } from '@/hooks'
22
+ import { createDatasetSchema, TypeCreateDatasetSchema } from '@/schemas'
23
+
24
+ const { Title } = Typography
25
+
26
+ type Step4Props = {
27
+ prevTabHandler: () => void
28
+ }
29
+
30
+ function Step4({ prevTabHandler }: Step4Props) {
31
+ const tg = useTranslations('')
32
+ const t = useTranslations('datasets.creation.steps.four')
33
+ //
34
+ const { name, columns, fileInfo } = useCreateDataset()
35
+ //
36
+ const {
37
+ handleSubmit,
38
+ control,
39
+ formState: { errors }
40
+ } = useForm<TypeCreateDatasetSchema>({
41
+ resolver: zodResolver(createDatasetSchema),
42
+ defaultValues: {
43
+ name,
44
+ description: ''
45
+ }
46
+ })
47
+ //
48
+ const [createDataset, { loading }] = useCreateDatasetMutation({
49
+ onCompleted() {},
50
+ onError(error) {}
51
+ })
52
+ //
53
+ const onSubmit = (data: TypeCreateDatasetSchema) => {
54
+ createDataset({
55
+ variables: {
56
+ data: {
57
+ ...data,
58
+ ...(fileInfo && { fileId: fileInfo.id }),
59
+ columns: columns.map(col => {
60
+ // @ts-ignore
61
+ delete col.__typename
62
+ return col
63
+ })
64
+ }
65
+ }
66
+ })
67
+ }
68
+ //
69
+ return (
70
+ <div className='flex flex-col gap-y-4'>
71
+ <Form layout='vertical' onSubmit={handleSubmit(onSubmit)}>
72
+ <Form.Item>
73
+ <Label htmlFor='name'>{t('fields.name')}*</Label>
74
+ <Controller
75
+ name='name'
76
+ control={control}
77
+ render={({ field }) => <Input id='name' {...field} />}
78
+ />
79
+ <Form.Message error={errors.name} />
80
+ </Form.Item>
81
+
82
+ <Form.Item className='max-h-36'>
83
+ <Label htmlFor='description'>
84
+ {t('fields.description')}
85
+ </Label>
86
+ <Controller
87
+ name='description'
88
+ control={control}
89
+ render={({ field }) => (
90
+ <Textarea id='description' {...field} />
91
+ )}
92
+ />
93
+ <Form.Message error={errors.description} />
94
+ </Form.Item>
95
+
96
+ <Form.Item>
97
+ <Label htmlFor='name'>{t('fields.access-rights')}</Label>
98
+ <Tags id='guards' />
99
+ </Form.Item>
100
+
101
+ <div className='mt-auto flex justify-between'>
102
+ <Button
103
+ color='secondary'
104
+ variant='label'
105
+ onClick={prevTabHandler}
106
+ >
107
+ <TbChevronLeft />
108
+ {tg('back')}
109
+ </Button>
110
+
111
+ <Button type='submit' color='success' disabled={loading}>
112
+ {tg('create')} <CheckIcon />
113
+ </Button>
114
+ </div>
115
+ </Form>
116
+ </div>
117
+ )
118
+ }
119
+
120
+ export { Step4 }
@@ -0,0 +1 @@
1
+ export { Step4 } from './Step4'
@@ -0,0 +1,4 @@
1
+ export { Step1 } from './Step1'
2
+ export { Step2 } from './Step2'
3
+ export { Step3 } from './Step3'
4
+ export { Step4 } from './Step4'
@@ -0,0 +1 @@
1
+ export { DatasetCreation } from './Creation'