@dartech/arsenal-ui 1.3.0 → 1.3.2

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 (269) hide show
  1. package/{index.ts → index.d.ts} +5 -5
  2. package/index.js +1 -0
  3. package/package.json +10 -3
  4. package/src/consts/index.d.ts +12 -0
  5. package/src/interfaces/common.d.ts +17 -0
  6. package/src/interfaces/definition.d.ts +107 -0
  7. package/src/interfaces/{index.ts → index.d.ts} +3 -3
  8. package/src/interfaces/ui.d.ts +70 -0
  9. package/src/lib/Alert/Alert.d.ts +53 -0
  10. package/src/lib/Alert/index.d.ts +1 -0
  11. package/src/lib/Breadcrumbs/Breadcrumbs.d.ts +9 -0
  12. package/src/lib/Breadcrumbs/Breadcrumbs.styled.d.ts +2 -0
  13. package/src/lib/Breadcrumbs/{index.ts → index.d.ts} +1 -1
  14. package/src/lib/ContentLayout/ContentLayout.d.ts +9 -0
  15. package/src/lib/ContentLayout/index.d.ts +1 -0
  16. package/src/lib/Definition/CreateDefinition/CreateDefinition.d.ts +11 -0
  17. package/src/lib/Definition/CreateDefinition/{index.ts → index.d.ts} +1 -1
  18. package/src/lib/Definition/DefinitionFiller/DefinitionFiller.d.ts +10 -0
  19. package/src/lib/Definition/DefinitionFiller/{index.ts → index.d.ts} +1 -1
  20. package/src/lib/Definition/DefinitionValueView/DefinitionValueView.d.ts +8 -0
  21. package/src/lib/Definition/DefinitionValueView/PropertyDataView.d.ts +9 -0
  22. package/src/lib/Definition/DefinitionValueView/{index.ts → index.d.ts} +1 -1
  23. package/src/lib/Definition/{index.ts → index.d.ts} +3 -3
  24. package/src/lib/Forms/BackButton.d.ts +7 -0
  25. package/src/lib/Forms/ControlAceEditor.d.ts +24 -0
  26. package/src/lib/Forms/ControlAutocomplete.d.ts +69 -0
  27. package/src/lib/Forms/ControlCheckbox.d.ts +51 -0
  28. package/src/lib/Forms/ControlDate.d.ts +18 -0
  29. package/src/lib/Forms/ControlDateTime.d.ts +18 -0
  30. package/src/lib/Forms/ControlDebouncedInput.d.ts +4 -0
  31. package/src/lib/Forms/ControlInput.d.ts +59 -0
  32. package/src/lib/Forms/ControlNumberInput.d.ts +51 -0
  33. package/src/lib/Forms/ControlQueryAutocomplete.d.ts +16 -0
  34. package/src/lib/Forms/ControlRadio.d.ts +66 -0
  35. package/src/lib/Forms/ControlSelect.d.ts +67 -0
  36. package/src/lib/Forms/ControlSwitch.d.ts +19 -0
  37. package/src/lib/Forms/ControlTime.d.ts +18 -0
  38. package/src/lib/Forms/CopyButton.d.ts +20 -0
  39. package/src/lib/Forms/{index.ts → index.d.ts} +15 -15
  40. package/src/lib/Forms/useAutocomplete.d.ts +10 -0
  41. package/src/lib/InfoItem/InfoItem.d.ts +10 -0
  42. package/src/lib/InfoItem/{index.ts → index.d.ts} +1 -1
  43. package/src/lib/JsonPathPicker/JsonPathPicker.d.ts +10 -0
  44. package/src/lib/JsonPathPicker/PropertyStep.d.ts +11 -0
  45. package/src/lib/JsonPathPicker/{index.ts → index.d.ts} +1 -1
  46. package/src/lib/JsonView/JsonView.d.ts +7 -0
  47. package/src/lib/JsonView/{index.ts → index.d.ts} +1 -1
  48. package/src/lib/Loader/Loader.d.ts +21 -0
  49. package/src/lib/Loader/{index.ts → index.d.ts} +1 -1
  50. package/src/lib/Modals/JsonModalView.d.ts +10 -0
  51. package/src/lib/Modals/{index.ts → index.d.ts} +1 -1
  52. package/src/lib/Property/PropertyFiller/JsonEditor.d.ts +10 -0
  53. package/src/lib/Property/PropertyFiller/MultiplePropertyFiller.d.ts +12 -0
  54. package/src/lib/Property/PropertyFiller/MultiplePropertyWidget.d.ts +11 -0
  55. package/src/lib/Property/PropertyFiller/PropertyFiller.d.ts +12 -0
  56. package/src/lib/Property/PropertyFiller/{index.ts → index.d.ts} +2 -2
  57. package/src/lib/Property/PropertyFiller/styled.d.ts +18 -0
  58. package/src/lib/Property/PropertyFiller/usePropertyFiller.d.ts +24 -0
  59. package/src/lib/Property/PropertyValidator/NodeValidator.d.ts +6 -0
  60. package/src/lib/Property/PropertyValidator/NodesList.d.ts +6 -0
  61. package/src/lib/Property/PropertyValidator/NumericTypeValidator.d.ts +8 -0
  62. package/src/lib/Property/PropertyValidator/PropertyValidator.d.ts +6 -0
  63. package/src/lib/Property/PropertyValidator/PropertyValidatorContext.d.ts +3 -0
  64. package/src/lib/Property/PropertyValidator/StringTypeValidator.d.ts +8 -0
  65. package/src/lib/Property/PropertyValidator/ValidationNodeSelector.d.ts +7 -0
  66. package/src/lib/Property/PropertyValidator/index.d.ts +1 -0
  67. package/src/lib/Property/PropertyValueField/BooleanValueField.d.ts +7 -0
  68. package/src/lib/Property/PropertyValueField/DateTimeValueField.d.ts +9 -0
  69. package/src/lib/Property/PropertyValueField/DateValueField.d.ts +9 -0
  70. package/src/lib/Property/PropertyValueField/JsonValueField.d.ts +10 -0
  71. package/src/lib/Property/PropertyValueField/PropertyValueField.d.ts +9 -0
  72. package/src/lib/Property/PropertyValueField/StringValueField.d.ts +9 -0
  73. package/src/lib/Property/PropertyValueField/TimeValueField.d.ts +9 -0
  74. package/src/lib/Property/PropertyValueField/{index.ts → index.d.ts} +1 -1
  75. package/src/lib/Property/PropertyWidget/PropertyWidget.d.ts +13 -0
  76. package/src/lib/Property/PropertyWidget/{index.ts → index.d.ts} +1 -1
  77. package/src/lib/Property/UpsertProperty/CreatePropertiesList.d.ts +13 -0
  78. package/src/lib/Property/UpsertProperty/CreatePropertyFormFields.d.ts +10 -0
  79. package/src/lib/Property/UpsertProperty/CustomPropertyField.d.ts +7 -0
  80. package/src/lib/Property/UpsertProperty/PropertyAdditionalFields/BigDecimalPropertyFields.d.ts +6 -0
  81. package/src/lib/Property/UpsertProperty/PropertyAdditionalFields/DateAdditionalFields.d.ts +7 -0
  82. package/src/lib/Property/UpsertProperty/PropertyAdditionalFields/EntityAdditionalFields.d.ts +8 -0
  83. package/src/lib/Property/UpsertProperty/PropertyAdditionalFields/EntityReferencePropertyFields.d.ts +6 -0
  84. package/src/lib/Property/UpsertProperty/PropertyAdditionalFields/PropertyAdditionalFields.d.ts +10 -0
  85. package/src/lib/Property/UpsertProperty/PropertyAdditionalFields/StringPropertyFields.d.ts +6 -0
  86. package/src/lib/Property/UpsertProperty/PropertyAdditionalFields/{index.ts → index.d.ts} +1 -1
  87. package/src/lib/Property/UpsertProperty/{index.ts → index.d.ts} +2 -2
  88. package/src/lib/Property/UpsertProperty/useCustomFields.d.ts +6 -0
  89. package/src/lib/Property/ViewPropertiesList/ViewPropertiesList.d.ts +8 -0
  90. package/src/lib/Property/ViewPropertiesList/{index.ts → index.d.ts} +1 -1
  91. package/src/lib/Property/ViewProperty/EntityPropertiesShortView.d.ts +7 -0
  92. package/src/lib/Property/ViewProperty/EntityPropertiesView.d.ts +8 -0
  93. package/src/lib/Property/ViewProperty/PropertyDataTable.d.ts +7 -0
  94. package/src/lib/Property/ViewProperty/PropertyItem.d.ts +9 -0
  95. package/src/lib/Property/ViewProperty/ViewProperty.d.ts +9 -0
  96. package/src/lib/Property/ViewProperty/{index.ts → index.d.ts} +1 -1
  97. package/src/lib/Property/{index.ts → index.d.ts} +5 -5
  98. package/src/lib/Sidebar/Sidebar.d.ts +10 -0
  99. package/src/lib/Sidebar/Sidebar.styled.d.ts +117 -0
  100. package/src/lib/Sidebar/SidebarContext.d.ts +11 -0
  101. package/src/lib/Sidebar/SidebarDrawer.d.ts +9 -0
  102. package/src/lib/Sidebar/SidebarLink/MenuIcon.d.ts +7 -0
  103. package/src/lib/Sidebar/SidebarLink/SidebarLink.d.ts +7 -0
  104. package/src/lib/Sidebar/SidebarLink/SidebarLinkItem.d.ts +8 -0
  105. package/src/lib/Sidebar/SidebarLink/SidebarNestedItem.d.ts +10 -0
  106. package/src/lib/Sidebar/SidebarLink/{index.ts → index.d.ts} +2 -2
  107. package/src/lib/Sidebar/index.d.ts +2 -0
  108. package/src/lib/Status/Status.d.ts +8 -0
  109. package/src/lib/Status/{index.ts → index.d.ts} +1 -1
  110. package/src/lib/StepperView/StepperView.d.ts +11 -0
  111. package/src/lib/StepperView/{index.ts → index.d.ts} +1 -1
  112. package/src/lib/Table/DataGrid/JsonTypeCell.d.ts +7 -0
  113. package/src/lib/Table/DataGrid/Table.d.ts +49 -0
  114. package/src/lib/Table/DataGrid/TableAction.d.ts +13 -0
  115. package/src/lib/Table/DataGrid/TableColumnMenu.d.ts +3 -0
  116. package/src/lib/Table/DataGrid/TablePagination.d.ts +3 -0
  117. package/src/lib/Table/DataGrid/index.d.ts +2 -0
  118. package/src/lib/Table/DataGrid/styles.d.ts +44 -0
  119. package/src/lib/Table/DataGrid/usePagination.d.ts +5 -0
  120. package/src/lib/Table/DataGrid/useTableQueryPagination.d.ts +11 -0
  121. package/src/lib/Table/DataGrid/useTableQuerySorting.d.ts +6 -0
  122. package/src/lib/Table/SimpleTable/SimpleTable.d.ts +17 -0
  123. package/src/lib/Table/SimpleTable/TableActionCell.d.ts +10 -0
  124. package/src/lib/Table/SimpleTable/index.d.ts +2 -0
  125. package/src/lib/Table/SimpleTable/useTablePagination.d.ts +7 -0
  126. package/src/lib/Table/SimpleTable/useTableSorting.d.ts +6 -0
  127. package/src/lib/Table/index.d.ts +2 -0
  128. package/src/lib/Tabs/RouteTabs.d.ts +11 -0
  129. package/src/lib/Tabs/TabPanel.d.ts +25 -0
  130. package/src/lib/Tabs/{index.ts → index.d.ts} +2 -2
  131. package/src/lib/{index.ts → index.d.ts} +16 -16
  132. package/src/theme/baseTheme.d.ts +2 -0
  133. package/src/theme/index.d.ts +1 -0
  134. package/src/theme/inputThemeOptions.d.ts +117 -0
  135. package/src/theme/stepperThemeOptions.d.ts +16 -0
  136. package/src/theme/tableThemeOptions.d.ts +47 -0
  137. package/src/theme/typographyThemeOptions.d.ts +29 -0
  138. package/src/utils/common.d.ts +7 -0
  139. package/src/utils/dem.d.ts +27 -0
  140. package/src/utils/hooks.d.ts +7 -0
  141. package/src/utils/{index.ts → index.d.ts} +5 -5
  142. package/src/utils/ui-utils.d.ts +16 -0
  143. package/src/utils/validators.d.ts +5 -0
  144. package/.babelrc +0 -13
  145. package/.eslintrc.json +0 -22
  146. package/jest.config.ts +0 -11
  147. package/project.json +0 -89
  148. package/rollup.config.js +0 -146
  149. package/src/assets/chevron_left_gray.svg +0 -3
  150. package/src/consts/index.ts +0 -13
  151. package/src/interfaces/common.ts +0 -18
  152. package/src/interfaces/definition.ts +0 -143
  153. package/src/interfaces/ui.ts +0 -80
  154. package/src/lib/Alert/Alert.tsx +0 -108
  155. package/src/lib/Alert/index.ts +0 -1
  156. package/src/lib/Breadcrumbs/Breadcrumbs.styled.tsx +0 -16
  157. package/src/lib/Breadcrumbs/Breadcrumbs.tsx +0 -40
  158. package/src/lib/ContentLayout/ContentLayout.tsx +0 -31
  159. package/src/lib/ContentLayout/index.ts +0 -1
  160. package/src/lib/Definition/CreateDefinition/CreateDefinition.tsx +0 -78
  161. package/src/lib/Definition/DefinitionFiller/DefinitionFiller.tsx +0 -71
  162. package/src/lib/Definition/DefinitionValueView/DefinitionValueView.tsx +0 -54
  163. package/src/lib/Definition/DefinitionValueView/PropertyDataView.tsx +0 -67
  164. package/src/lib/Forms/BackButton.tsx +0 -46
  165. package/src/lib/Forms/ControlAceEditor.tsx +0 -125
  166. package/src/lib/Forms/ControlAutocomplete.tsx +0 -145
  167. package/src/lib/Forms/ControlCheckbox.tsx +0 -113
  168. package/src/lib/Forms/ControlDate.tsx +0 -75
  169. package/src/lib/Forms/ControlDateTime.tsx +0 -77
  170. package/src/lib/Forms/ControlDebouncedInput.tsx +0 -80
  171. package/src/lib/Forms/ControlInput.tsx +0 -111
  172. package/src/lib/Forms/ControlNumberInput.tsx +0 -121
  173. package/src/lib/Forms/ControlQueryAutocomplete.tsx +0 -197
  174. package/src/lib/Forms/ControlRadio.tsx +0 -136
  175. package/src/lib/Forms/ControlSelect.tsx +0 -164
  176. package/src/lib/Forms/ControlSwitch.tsx +0 -71
  177. package/src/lib/Forms/ControlTime.tsx +0 -93
  178. package/src/lib/Forms/CopyButton.tsx +0 -46
  179. package/src/lib/Forms/useAutocomplete.tsx +0 -47
  180. package/src/lib/InfoItem/InfoItem.tsx +0 -40
  181. package/src/lib/InfoItem/styles.ts +0 -17
  182. package/src/lib/JsonPathPicker/JsonPathPicker.tsx +0 -73
  183. package/src/lib/JsonPathPicker/PropertyStep.tsx +0 -70
  184. package/src/lib/JsonView/JsonView.tsx +0 -41
  185. package/src/lib/Loader/Loader.tsx +0 -41
  186. package/src/lib/Modals/JsonModalView.tsx +0 -53
  187. package/src/lib/Property/PropertyFiller/JsonEditor.tsx +0 -58
  188. package/src/lib/Property/PropertyFiller/MultiplePropertyFiller.tsx +0 -129
  189. package/src/lib/Property/PropertyFiller/MultiplePropertyWidget.tsx +0 -85
  190. package/src/lib/Property/PropertyFiller/PropertyFiller.tsx +0 -199
  191. package/src/lib/Property/PropertyFiller/usePropertyFiller.ts +0 -72
  192. package/src/lib/Property/PropertyFiller/useStyles.ts +0 -12
  193. package/src/lib/Property/PropertyValidator/NodeValidator.tsx +0 -92
  194. package/src/lib/Property/PropertyValidator/NodesList.tsx +0 -26
  195. package/src/lib/Property/PropertyValidator/NumericTypeValidator.tsx +0 -59
  196. package/src/lib/Property/PropertyValidator/PropertyValidator.tsx +0 -42
  197. package/src/lib/Property/PropertyValidator/PropertyValidatorContext.tsx +0 -4
  198. package/src/lib/Property/PropertyValidator/StringTypeValidator.tsx +0 -36
  199. package/src/lib/Property/PropertyValidator/ValidationNodeSelector.tsx +0 -62
  200. package/src/lib/Property/PropertyValidator/index.ts +0 -1
  201. package/src/lib/Property/PropertyValueField/BooleanValueField.tsx +0 -49
  202. package/src/lib/Property/PropertyValueField/DateTimeValueField.tsx +0 -58
  203. package/src/lib/Property/PropertyValueField/DateValueField.tsx +0 -58
  204. package/src/lib/Property/PropertyValueField/JsonValueField.tsx +0 -65
  205. package/src/lib/Property/PropertyValueField/PropertyValueField.tsx +0 -49
  206. package/src/lib/Property/PropertyValueField/StringValueField.tsx +0 -50
  207. package/src/lib/Property/PropertyValueField/TimeValueField.tsx +0 -67
  208. package/src/lib/Property/PropertyWidget/PropertyWidget.tsx +0 -115
  209. package/src/lib/Property/UpsertProperty/CreatePropertiesList.tsx +0 -148
  210. package/src/lib/Property/UpsertProperty/CreatePropertyFormFields.tsx +0 -158
  211. package/src/lib/Property/UpsertProperty/CustomPropertyField.tsx +0 -40
  212. package/src/lib/Property/UpsertProperty/PropertyAdditionalFields/BigDecimalPropertyFields.tsx +0 -41
  213. package/src/lib/Property/UpsertProperty/PropertyAdditionalFields/DateAdditionalFields.tsx +0 -27
  214. package/src/lib/Property/UpsertProperty/PropertyAdditionalFields/EntityAdditionalFields.tsx +0 -133
  215. package/src/lib/Property/UpsertProperty/PropertyAdditionalFields/EntityReferencePropertyFields.tsx +0 -46
  216. package/src/lib/Property/UpsertProperty/PropertyAdditionalFields/PropertyAdditionalFields.tsx +0 -52
  217. package/src/lib/Property/UpsertProperty/PropertyAdditionalFields/StringPropertyFields.tsx +0 -103
  218. package/src/lib/Property/UpsertProperty/useCustomFields.ts +0 -22
  219. package/src/lib/Property/ViewPropertiesList/ViewPropertiesList.tsx +0 -37
  220. package/src/lib/Property/ViewProperty/EntityPropertiesShortView.tsx +0 -40
  221. package/src/lib/Property/ViewProperty/EntityPropertiesView.tsx +0 -48
  222. package/src/lib/Property/ViewProperty/PropertyDataTable.tsx +0 -148
  223. package/src/lib/Property/ViewProperty/PropertyItem.tsx +0 -43
  224. package/src/lib/Property/ViewProperty/ViewProperty.tsx +0 -52
  225. package/src/lib/Sidebar/Sidebar.styled.tsx +0 -157
  226. package/src/lib/Sidebar/Sidebar.tsx +0 -27
  227. package/src/lib/Sidebar/SidebarContext.tsx +0 -37
  228. package/src/lib/Sidebar/SidebarDrawer.tsx +0 -50
  229. package/src/lib/Sidebar/SidebarLink/MenuIcon.tsx +0 -16
  230. package/src/lib/Sidebar/SidebarLink/SidebarLink.tsx +0 -54
  231. package/src/lib/Sidebar/SidebarLink/SidebarLinkItem.tsx +0 -54
  232. package/src/lib/Sidebar/SidebarLink/SidebarNestedItem.tsx +0 -62
  233. package/src/lib/Sidebar/index.ts +0 -2
  234. package/src/lib/Status/Status.tsx +0 -16
  235. package/src/lib/Status/styles.ts +0 -21
  236. package/src/lib/StepperView/StepperView.tsx +0 -73
  237. package/src/lib/Table/DataGrid/JsonTypeCell.tsx +0 -51
  238. package/src/lib/Table/DataGrid/Table.tsx +0 -117
  239. package/src/lib/Table/DataGrid/TableAction.tsx +0 -43
  240. package/src/lib/Table/DataGrid/TableColumnMenu.tsx +0 -12
  241. package/src/lib/Table/DataGrid/TablePagination.tsx +0 -42
  242. package/src/lib/Table/DataGrid/index.ts +0 -2
  243. package/src/lib/Table/DataGrid/styles.ts +0 -59
  244. package/src/lib/Table/DataGrid/usePagination.ts +0 -15
  245. package/src/lib/Table/DataGrid/useTableQueryPagination.ts +0 -47
  246. package/src/lib/Table/DataGrid/useTableQuerySorting.ts +0 -47
  247. package/src/lib/Table/SimpleTable/SimpleTable.tsx +0 -138
  248. package/src/lib/Table/SimpleTable/TableActionCell.tsx +0 -67
  249. package/src/lib/Table/SimpleTable/index.ts +0 -2
  250. package/src/lib/Table/SimpleTable/useTablePagination.ts +0 -54
  251. package/src/lib/Table/SimpleTable/useTableSorting.ts +0 -50
  252. package/src/lib/Table/index.ts +0 -2
  253. package/src/lib/Tabs/RouteTabs.tsx +0 -54
  254. package/src/lib/Tabs/TabPanel.tsx +0 -42
  255. package/src/theme/baseTheme.ts +0 -41
  256. package/src/theme/fonts.d.ts +0 -2
  257. package/src/theme/index.ts +0 -126
  258. package/src/theme/inputThemeOptions.ts +0 -126
  259. package/src/theme/stepperThemeOptions.ts +0 -20
  260. package/src/theme/tableThemeOptions.ts +0 -50
  261. package/src/theme/typographyThemeOptions.ts +0 -32
  262. package/src/utils/common.ts +0 -73
  263. package/src/utils/dem.ts +0 -431
  264. package/src/utils/hooks.ts +0 -41
  265. package/src/utils/ui-utils.tsx +0 -134
  266. package/src/utils/validators.ts +0 -14
  267. package/tsconfig.json +0 -25
  268. package/tsconfig.lib.json +0 -23
  269. package/tsconfig.spec.json +0 -20
@@ -1,40 +0,0 @@
1
- import Typography from '@mui/material/Typography';
2
- import MuiBreadcrumbs from '@mui/material/Breadcrumbs';
3
- import { StyledLink } from './Breadcrumbs.styled';
4
- import NavigateNextIcon from '@mui/icons-material/NavigateNext';
5
-
6
- type Props = {
7
- crumbs: {
8
- title: string;
9
- link?: string;
10
- }[];
11
- };
12
-
13
- export const Breadcrumbs = ({ crumbs }: Props) => {
14
- return (
15
- <MuiBreadcrumbs
16
- separator={<NavigateNextIcon fontSize="small" />}
17
- aria-label="breadcrumb"
18
- sx={{
19
- '& li': {
20
- color: '#6D6E85',
21
- '&:last-child': {
22
- color: '#262842',
23
- },
24
- },
25
- }}
26
- >
27
- {crumbs.map((crumb, index) =>
28
- crumb.link ? (
29
- <StyledLink key={index} to={crumb.link} className="breadcrumb">
30
- {crumb.title}
31
- </StyledLink>
32
- ) : (
33
- <Typography key={index} className="breadcrumb">
34
- {crumb.title}
35
- </Typography>
36
- )
37
- )}
38
- </MuiBreadcrumbs>
39
- );
40
- };
@@ -1,31 +0,0 @@
1
- import { Suspense, ReactNode } from 'react';
2
- import Box from '@mui/material/Box';
3
- import { SxProps, Theme } from '@mui/material/styles';
4
- import Toolbar from '@mui/material/Toolbar';
5
- import { Outlet } from 'react-router-dom';
6
- import { Loader } from '../Loader';
7
-
8
- type Props = {
9
- children?: ReactNode;
10
- toolbar?: ReactNode;
11
- contentSx?: SxProps<Theme>;
12
- }
13
-
14
- export const ContentLayout = ({ children, toolbar, contentSx }: Props) => {
15
- return (
16
- <Box component="main" sx={{ flexGrow: 1, bgcolor: 'background.default' }}>
17
- <Toolbar
18
- sx={{
19
- borderBottom: '1px solid rgba(38, 40, 66, 0.08)',
20
- }}
21
- >{toolbar}</Toolbar>
22
- <Box sx={{ ...contentSx, height: 'calc(100vh - 56px)', overflow: 'scroll' }}>
23
- <Suspense fallback={<Loader />}>
24
- {
25
- children ?? <Outlet />
26
- }
27
- </Suspense>
28
- </Box>
29
- </Box>
30
- );
31
- };
@@ -1 +0,0 @@
1
- export * from './ContentLayout';
@@ -1,78 +0,0 @@
1
- import Box from '@mui/material/Box';
2
- import Grid from '@mui/material/Unstable_Grid2';
3
- import Typography from '@mui/material/Typography';
4
- import { ControlInput, ControlNumberInput } from '../../Forms';
5
- import CreatePropertiesList from '../../Property/UpsertProperty/CreatePropertiesList';
6
-
7
- import { useFormContext } from 'react-hook-form';
8
-
9
- type Props = {
10
- definitionFieldName?: string;
11
- title?: string;
12
- hideCodeField?: boolean;
13
- hideVersionField?: boolean;
14
- hideNameField?: boolean;
15
- required?: boolean;
16
- };
17
-
18
- export const CreateDefinition = ({
19
- definitionFieldName,
20
- title,
21
- hideCodeField,
22
- hideVersionField,
23
- hideNameField,
24
- required = false,
25
- }: Props) => {
26
- const { control } = useFormContext();
27
-
28
- return (
29
- <Grid container direction="column" spacing={2}>
30
- {title && (
31
- <Grid sm={12}>
32
- <Box my={2}>
33
- <Typography variant="h6">{title}</Typography>
34
- </Box>
35
- </Grid>
36
- )}
37
- {!hideNameField && (
38
- <Grid sm={12}>
39
- <ControlInput
40
- required
41
- control={control}
42
- name={definitionFieldName ? `${definitionFieldName}.name` : `name`}
43
- label="Name"
44
- />
45
- </Grid>
46
- )}
47
- {!hideCodeField && (
48
- <Grid sm={12}>
49
- <ControlInput
50
- required
51
- control={control}
52
- name={definitionFieldName ? `${definitionFieldName}.code` : `code`}
53
- label="Code"
54
- />
55
- </Grid>
56
- )}
57
- {!hideVersionField && (
58
- <Grid sm={12}>
59
- <ControlNumberInput
60
- required
61
- control={control}
62
- name={
63
- definitionFieldName ? `${definitionFieldName}.version` : `version`
64
- }
65
- label="Version"
66
- />
67
- </Grid>
68
- )}
69
-
70
- <CreatePropertiesList
71
- required={required}
72
- parentFieldName={definitionFieldName}
73
- />
74
- </Grid>
75
- );
76
- };
77
-
78
- export default CreateDefinition;
@@ -1,71 +0,0 @@
1
- import Box from '@mui/material/Box';
2
- import Grid from '@mui/material/Unstable_Grid2';
3
- import { StepperData, StepperView } from '../../StepperView';
4
- import { PropertyFiller } from '../../Property';
5
- import { MultiplePropertyFiller } from '../../Property';
6
-
7
- import { useMemo } from 'react';
8
-
9
- import { PropertiesArrayType } from '../../../interfaces';
10
-
11
- type Props = {
12
- properties: PropertiesArrayType;
13
- dataFieldName: string;
14
- useExpression?: boolean;
15
- title?: string;
16
- };
17
-
18
- export const DefinitionFiller = ({ properties, dataFieldName, useExpression = false, title }: Props) => {
19
- const stepperData: StepperData = useMemo(() => {
20
- if (properties) {
21
- return properties.map((property) => {
22
- const propertyType =
23
- typeof property.propertyType === 'string' ? property.propertyType : property['propertyType']['value'];
24
- return {
25
- label: (
26
- <Box display="flex" flexDirection="column">
27
- <b>
28
- {property.name}
29
- {property.isRequired ? '*' : ''}
30
- </b>
31
- <span>
32
- {property.key} | {property.isMultiple ? 'multiple' : 'single'} | {propertyType}
33
- </span>
34
- </Box>
35
- ),
36
- content: property.isMultiple ? (
37
- <MultiplePropertyFiller
38
- property={property}
39
- name={`${dataFieldName}.${property.key}`}
40
- useExpression={useExpression}
41
- label={property.name}
42
- required={property.isRequired}
43
- />
44
- ) : (
45
- <PropertyFiller
46
- property={property}
47
- name={`${dataFieldName}.${property.key}`}
48
- useExpression={useExpression}
49
- label={property.name}
50
- required={property.isRequired}
51
- />
52
- ),
53
- };
54
- });
55
- }
56
- return [];
57
- }, [properties, dataFieldName, useExpression]);
58
-
59
- return (
60
- <Grid container direction="column" spacing={2}>
61
- {title && (
62
- <Grid xs={12}>
63
- <div style={{ fontWeight: '600' }}>{title}</div>
64
- </Grid>
65
- )}
66
- <StepperView data={stepperData} />
67
- </Grid>
68
- );
69
- };
70
-
71
- export default DefinitionFiller;
@@ -1,54 +0,0 @@
1
- import Box from '@mui/material/Box';
2
- import Grid from '@mui/material/Unstable_Grid2';
3
- import { StepperData, StepperView } from '../../StepperView';
4
- import PropertyDataView from './PropertyDataView';
5
-
6
- import { useMemo } from 'react';
7
- import { PropertiesArrayType, PropertyType } from '../../../interfaces';
8
-
9
- type Props = {
10
- properties: PropertiesArrayType<unknown>;
11
- data: unknown;
12
- };
13
-
14
- export const DefinitionValueView = ({ properties, data }: Props) => {
15
- const stepperData: StepperData = useMemo(() => {
16
- if (properties && data) {
17
- return properties.map((property) => {
18
- const { key, name, isMultiple, propertyType } = property;
19
- const value = data[property.key] ?? data;
20
- return {
21
- label: (
22
- <Box display="flex" flexDirection="column">
23
- <b>{name}</b>
24
- <span>
25
- {key} | {isMultiple ? 'multiple' : 'single'} | {propertyType}
26
- </span>
27
- </Box>
28
- ),
29
- content:
30
- isMultiple && Array.isArray(value) && property.propertyType !== PropertyType.ANY ? (
31
- <>
32
- {value.map((itemValue, index) => (
33
- <Box key={index} mb={2}>
34
- <PropertyDataView property={property} data={itemValue} hasBackground />
35
- </Box>
36
- ))}
37
- </>
38
- ) : (
39
- <PropertyDataView property={property} data={value} />
40
- ),
41
- };
42
- });
43
- }
44
- return [];
45
- }, [properties, data]);
46
-
47
- return (
48
- <Grid container direction="column" spacing={2}>
49
- <StepperView data={stepperData} />
50
- </Grid>
51
- );
52
- };
53
-
54
- export default DefinitionValueView;
@@ -1,67 +0,0 @@
1
- import Box from '@mui/material/Box';
2
- import { JsonView } from '../../JsonView';
3
- import DefinitionValueView from './DefinitionValueView';
4
-
5
- import { useMemo } from 'react';
6
- import { isExpression, propertiesObjectToArray } from '../../../utils';
7
-
8
- import { PropertyUnion, PropertyType, PropertiesArrayType } from '../../../interfaces';
9
-
10
- type Props = {
11
- property: PropertyUnion;
12
- data: unknown;
13
- hasBackground?: boolean;
14
- };
15
-
16
- type PropertyValueComponentProps = {
17
- property: PropertyUnion;
18
- data: unknown;
19
- properties?: PropertiesArrayType;
20
- };
21
-
22
- const PropertyValueComponent = ({ property, data, properties }: PropertyValueComponentProps) => {
23
- const defaultRender = (value: any) => (
24
- <Box style={{ backgroundColor: '#fff', border: '1px solid #ccc', borderRadius: '4px', padding: '4px' }}>
25
- {value === null ? 'null' : value?.toString()}
26
- </Box>
27
- )
28
- if (isExpression(data)) {
29
- return defaultRender(data);
30
- } else {
31
- switch (property.propertyType) {
32
- case PropertyType.JSON:
33
- return <JsonView value={data} />;
34
- case PropertyType.ENTITY:
35
- return <DefinitionValueView properties={properties} data={data} />;
36
- case PropertyType.ANY:
37
- // TODO need to prefetch data and show as is
38
- return (typeof data === 'object' ? <JsonView value={data} /> : defaultRender(data));
39
- default:
40
- return defaultRender(data);
41
- }
42
- }
43
- };
44
-
45
- export const PropertyDataView = ({ property, data, hasBackground = false }: Props) => {
46
- const properties = useMemo(() => {
47
- if (property.propertyType === PropertyType.ENTITY) {
48
- if (Array.isArray(property.properties)) {
49
- return property.properties;
50
- }
51
- return propertiesObjectToArray(property.properties);
52
- }
53
- return [];
54
- }, [property]);
55
-
56
- return (
57
- <Box
58
- style={{
59
- backgroundColor: hasBackground ? '#f1f1f1' : 'none',
60
- }}
61
- >
62
- <PropertyValueComponent property={property} data={data} properties={properties} />
63
- </Box>
64
- );
65
- };
66
-
67
- export default PropertyDataView;
@@ -1,46 +0,0 @@
1
- import { useCallback, useMemo } from 'react';
2
- import SvgIcon from '@mui/material/SvgIcon';
3
- import { useNavigate, useLocation, Link } from 'react-router-dom';
4
- import IconButton from '@mui/material/IconButton';
5
- import Button from '@mui/material/Button';
6
- import Box from '@mui/material/Box';
7
-
8
- type Props = {
9
- text?: string;
10
- buttonProps?: Record<string, unknown>;
11
- };
12
- export const BackButton = ({ text, buttonProps = {} }: Props) => {
13
- const navigate = useNavigate();
14
- const { state } = useLocation();
15
- const fromLocation = useMemo(() => state?.['from'], [state]);
16
-
17
- const handleClick = useCallback(() => {
18
- if (fromLocation) {
19
- navigate(fromLocation);
20
- } else navigate(-1);
21
- }, [navigate, fromLocation]);
22
-
23
- return (
24
- <Box mr={2}>
25
- {text ? (
26
- <Button
27
- color="inherit"
28
- onClick={!fromLocation ? handleClick : null}
29
- component={Link}
30
- to={fromLocation ?? ''}
31
- {...buttonProps}
32
- >
33
- {text}
34
- </Button>
35
- ) : (
36
- <IconButton onClick={handleClick}>
37
- <SvgIcon>
38
- <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" />
39
- </SvgIcon>
40
- </IconButton>
41
- )}
42
- </Box>
43
- );
44
- };
45
-
46
- export default BackButton;
@@ -1,125 +0,0 @@
1
- import AceEditor from 'react-ace';
2
- import 'ace-builds/src-noconflict/mode-python';
3
- import 'ace-builds/src-noconflict/theme-monokai';
4
- import 'ace-builds/src-noconflict/ext-language_tools';
5
- import Typography from '@mui/material/Typography';
6
- import Box from '@mui/material/Box';
7
- import FormHelperText from '@mui/material/FormHelperText';
8
- import { Control, useFormContext, useController, useWatch } from 'react-hook-form';
9
- import { forwardRef } from 'react';
10
-
11
- export interface ControlAceEditorProps {
12
- name: string;
13
- control: Control<any>;
14
- mode?: string;
15
- label?: string;
16
- width?: string;
17
- height?: string;
18
- theme?: string;
19
- readOnly?: boolean;
20
- required?: boolean;
21
- validateJson?: boolean;
22
- fontSize?: number;
23
- validate?: boolean;
24
- parseValue?: boolean;
25
- [key: string]: unknown;
26
- }
27
-
28
- export const ControlAceEditor = forwardRef<AceEditor, ControlAceEditorProps>(({
29
- control,
30
- name,
31
- mode = 'json',
32
- label,
33
- width = '100%',
34
- height = '200px',
35
- theme = 'monokai',
36
- readOnly,
37
- required = false,
38
- validateJson = false,
39
- fontSize = 16,
40
- validate = true,
41
- parseValue,
42
- ...otherProps
43
- }, ref) => {
44
- const { setError, clearErrors } = useFormContext();
45
- const {
46
- field: { onChange },
47
- fieldState: { error },
48
- } = useController({ control, name });
49
- const value = useWatch({ control, name });
50
-
51
- const handleChange = (value) => {
52
- if (!value && required) {
53
- setError(name, { message: 'Required field' });
54
- } else {
55
- clearErrors(name);
56
- }
57
-
58
- if (validateJson) {
59
- try {
60
- JSON.parse(value);
61
- clearErrors(name);
62
- } catch (error) {
63
- setError(name, { message: 'Invalid JSON' });
64
- }
65
- }
66
-
67
- if (parseValue) {
68
- try {
69
- const val = JSON.parse(value);
70
- console.log('parsed val:', val);
71
- onChange(val);
72
- } catch (e) {
73
- onChange(value);
74
- }
75
- } else {
76
- onChange(value);
77
- }
78
- };
79
-
80
- return (
81
- <Box display="flex" flexDirection="column" width="100%">
82
- <Box>
83
- {label && (
84
- <Typography variant="subtitle1" display="inline" style={{ marginRight: 10 }}>
85
- {label}
86
- </Typography>
87
- )}
88
- </Box>
89
- <>
90
- <AceEditor
91
- ref={ref}
92
- focus
93
- wrapEnabled
94
- width={width}
95
- height={height}
96
- showPrintMargin={false}
97
- theme={theme}
98
- fontSize={fontSize}
99
- setOptions={{
100
- enableLiveAutocompletion: true,
101
- enableBasicAutocompletion: true,
102
- enableSnippets: true,
103
- showLineNumbers: true,
104
- tabSize: 2,
105
- useWorker: false
106
- }}
107
- style={{ lineHeight: 1.4, zIndex: 0, isolation: 'isolate' }}
108
- readOnly={readOnly}
109
- value={mode === 'json' && typeof value !== 'string' ? (value === null ? '' : JSON.stringify(value)) : value}
110
- onChange={handleChange}
111
- mode={mode}
112
- onLoad={(editor) => {
113
- if (!validate || !validateJson) {
114
- editor.getSession().setUseWorker(false);
115
- }
116
- }}
117
- {...otherProps}
118
- />
119
- {error && <FormHelperText error>{error.message}</FormHelperText>}
120
- </>
121
- </Box>
122
- );
123
- });
124
-
125
- export default ControlAceEditor;
@@ -1,145 +0,0 @@
1
- import Autocomplete, { AutocompleteProps } from '@mui/material/Autocomplete';
2
- import TextField, { TextFieldProps } from '@mui/material/TextField';
3
- import { Control, useController, useWatch } from 'react-hook-form';
4
-
5
- import useAutocomplete from './useAutocomplete';
6
- import { ValidateFunc } from '../../interfaces';
7
-
8
- /**
9
- * This interface is referencing the [[ControlAutocomplete]] component props.
10
- * @category Forms
11
- */
12
- export type ControlAutocompleteProps = Omit<
13
- AutocompleteProps<unknown, boolean, boolean, boolean, React.ElementType<any>>,
14
- 'renderInput'
15
- > & {
16
- /**
17
- * React Hook Form control `name` propery
18
- */
19
- name: string;
20
- /**
21
- * Label for MUI TextField select component
22
- */
23
- label?: string;
24
- /**
25
- * React Hook Form `control`
26
- */
27
- control: Control<any>;
28
- /**
29
- * Is input required flag
30
- */
31
- required?: boolean;
32
- /**
33
- * React Hook Form `defaultValue`
34
- */
35
- defaultValue?: unknown;
36
- /**
37
- * Is disabled input flag
38
- */
39
- disabled?: boolean;
40
- /**
41
- * React Hook Form validate function
42
- * ```typescript
43
- * type ValidateFunc = (value: string) => boolean | string;
44
- * ```
45
- */
46
- validate?: ValidateFunc | Record<string, ValidateFunc>;
47
- /**
48
- * Hide error message flag
49
- */
50
- hideErrorMessage?: boolean;
51
- /**
52
- * Custom onChange functionƒ
53
- */
54
- onChange?: (event: React.ChangeEvent<HTMLInputElement>, value: unknown) => void;
55
- /**
56
- * Key for option label
57
- */
58
- labelKey?: string;
59
- /**
60
- * Key for option value
61
- */
62
- valueKey?: string;
63
- /**
64
- * Select options
65
- */
66
- options: string[] | unknown[];
67
- textFieldProps?: TextFieldProps;
68
- };
69
-
70
- /**
71
- * Material UI `Autocomplete` controlled component. Used with react-hook-form
72
- * @category Forms
73
- */
74
- export const ControlAutocomplete = ({
75
- control,
76
- validate,
77
- name = '',
78
- label = '',
79
- required = false,
80
- defaultValue = '',
81
- disabled = false,
82
- hideErrorMessage = false,
83
- onChange: customOnChange,
84
- labelKey,
85
- valueKey,
86
- options = [],
87
- multiple,
88
- textFieldProps = {},
89
- disableCloseOnSelect,
90
- ...autocompleteProps
91
- }: ControlAutocompleteProps) => {
92
- const {
93
- field: { ref, onChange },
94
- fieldState: { error },
95
- } = useController({
96
- name,
97
- control,
98
- defaultValue,
99
- rules: {
100
- required: required && 'Please, fill this field',
101
- validate,
102
- },
103
- });
104
- const formValue = useWatch({ control, name, defaultValue: multiple ? [] : null });
105
- const { getOptionLabel, isOptionEqualToValue, renderOption } = useAutocomplete({ valueKey, labelKey });
106
-
107
- const handleChange = (_, value) => {
108
- onChange(value);
109
- };
110
-
111
- return (
112
- <Autocomplete
113
- fullWidth
114
- disablePortal
115
- size="small"
116
- readOnly={disabled}
117
- options={options}
118
- multiple={multiple}
119
- getOptionLabel={getOptionLabel}
120
- isOptionEqualToValue={isOptionEqualToValue}
121
- disableCloseOnSelect={disableCloseOnSelect || multiple}
122
- filterSelectedOptions={multiple}
123
- value={formValue}
124
- onChange={customOnChange ? customOnChange : handleChange}
125
- renderOption={renderOption}
126
- renderInput={(params) => {
127
- return (
128
- <TextField
129
- {...params}
130
- variant="outlined"
131
- name={name}
132
- label={label}
133
- error={!!error}
134
- inputRef={ref}
135
- helperText={!hideErrorMessage && error?.message}
136
- {...textFieldProps}
137
- />
138
- );
139
- }}
140
- {...autocompleteProps}
141
- />
142
- );
143
- };
144
-
145
- export default ControlAutocomplete;