drf-react-by-schema 0.28.8 → 0.28.9

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 (232) hide show
  1. package/dist/@types/index.d.ts +410 -0
  2. package/dist/@types/index.d.ts.map +1 -0
  3. package/dist/@types/index.js +9 -0
  4. package/dist/@types/string-mask.d.ts +10 -0
  5. package/dist/@types/string-mask.d.ts.map +1 -0
  6. package/dist/@types/string-mask.js +1 -0
  7. package/dist/api.d.ts +81 -0
  8. package/dist/api.d.ts.map +1 -0
  9. package/dist/api.js +1118 -0
  10. package/dist/components/DataGridBySchemaEditable/BooleanInputCell.d.ts +8 -0
  11. package/dist/components/DataGridBySchemaEditable/BooleanInputCell.d.ts.map +1 -0
  12. package/dist/components/DataGridBySchemaEditable/BooleanInputCell.js +86 -0
  13. package/dist/components/DataGridBySchemaEditable/ConditionalEditWrapper.d.ts +12 -0
  14. package/dist/components/DataGridBySchemaEditable/ConditionalEditWrapper.d.ts.map +1 -0
  15. package/dist/components/DataGridBySchemaEditable/ConditionalEditWrapper.js +71 -0
  16. package/dist/components/DataGridBySchemaEditable/ConfirmDialog.d.ts +9 -0
  17. package/dist/components/DataGridBySchemaEditable/ConfirmDialog.d.ts.map +1 -0
  18. package/dist/components/DataGridBySchemaEditable/ConfirmDialog.js +21 -0
  19. package/dist/components/DataGridBySchemaEditable/CustomToolbar.d.ts +26 -0
  20. package/dist/components/DataGridBySchemaEditable/CustomToolbar.d.ts.map +1 -0
  21. package/dist/components/DataGridBySchemaEditable/CustomToolbar.js +146 -0
  22. package/dist/components/DataGridBySchemaEditable/DataGridDesktop.d.ts +73 -0
  23. package/dist/components/DataGridBySchemaEditable/DataGridDesktop.d.ts.map +1 -0
  24. package/dist/components/DataGridBySchemaEditable/DataGridDesktop.js +421 -0
  25. package/dist/components/DataGridBySchemaEditable/DataGridMobile.d.ts +18 -0
  26. package/dist/components/DataGridBySchemaEditable/DataGridMobile.d.ts.map +1 -0
  27. package/dist/components/DataGridBySchemaEditable/DataGridMobile.js +105 -0
  28. package/dist/components/DataGridBySchemaEditable/FileInputCell.d.ts +11 -0
  29. package/dist/components/DataGridBySchemaEditable/FileInputCell.d.ts.map +1 -0
  30. package/dist/components/DataGridBySchemaEditable/FileInputCell.js +155 -0
  31. package/dist/components/DataGridBySchemaEditable/FooterToolbar.d.ts +12 -0
  32. package/dist/components/DataGridBySchemaEditable/FooterToolbar.d.ts.map +1 -0
  33. package/dist/components/DataGridBySchemaEditable/FooterToolbar.js +36 -0
  34. package/dist/components/DataGridBySchemaEditable/GeoEditCell.d.ts +10 -0
  35. package/dist/components/DataGridBySchemaEditable/GeoEditCell.d.ts.map +1 -0
  36. package/dist/components/DataGridBySchemaEditable/GeoEditCell.js +85 -0
  37. package/dist/components/DataGridBySchemaEditable/GeoThumbCell.d.ts +11 -0
  38. package/dist/components/DataGridBySchemaEditable/GeoThumbCell.d.ts.map +1 -0
  39. package/dist/components/DataGridBySchemaEditable/GeoThumbCell.js +87 -0
  40. package/dist/components/DataGridBySchemaEditable/GridActionsCellItemLink.d.ts +18 -0
  41. package/dist/components/DataGridBySchemaEditable/GridActionsCellItemLink.d.ts.map +1 -0
  42. package/dist/components/DataGridBySchemaEditable/GridActionsCellItemLink.js +24 -0
  43. package/dist/components/DataGridBySchemaEditable/GridDateInput.d.ts +8 -0
  44. package/dist/components/DataGridBySchemaEditable/GridDateInput.d.ts.map +1 -0
  45. package/dist/components/DataGridBySchemaEditable/GridDateInput.js +166 -0
  46. package/dist/components/DataGridBySchemaEditable/GridDateTimeInput.d.ts +6 -0
  47. package/dist/components/DataGridBySchemaEditable/GridDateTimeInput.d.ts.map +1 -0
  48. package/dist/components/DataGridBySchemaEditable/GridDateTimeInput.js +154 -0
  49. package/dist/components/DataGridBySchemaEditable/GridDecimalInput.d.ts +10 -0
  50. package/dist/components/DataGridBySchemaEditable/GridDecimalInput.d.ts.map +1 -0
  51. package/dist/components/DataGridBySchemaEditable/GridDecimalInput.js +78 -0
  52. package/dist/components/DataGridBySchemaEditable/GridGenericInput.d.ts +8 -0
  53. package/dist/components/DataGridBySchemaEditable/GridGenericInput.d.ts.map +1 -0
  54. package/dist/components/DataGridBySchemaEditable/GridGenericInput.js +30 -0
  55. package/dist/components/DataGridBySchemaEditable/GridPatternInput.d.ts +7 -0
  56. package/dist/components/DataGridBySchemaEditable/GridPatternInput.d.ts.map +1 -0
  57. package/dist/components/DataGridBySchemaEditable/GridPatternInput.js +74 -0
  58. package/dist/components/DataGridBySchemaEditable/InputInterval.d.ts +21 -0
  59. package/dist/components/DataGridBySchemaEditable/InputInterval.d.ts.map +1 -0
  60. package/dist/components/DataGridBySchemaEditable/InputInterval.js +131 -0
  61. package/dist/components/DataGridBySchemaEditable/MobileSearchBar.d.ts +9 -0
  62. package/dist/components/DataGridBySchemaEditable/MobileSearchBar.d.ts.map +1 -0
  63. package/dist/components/DataGridBySchemaEditable/MobileSearchBar.js +70 -0
  64. package/dist/components/DataGridBySchemaEditable/RowEditingWatcher.d.ts +7 -0
  65. package/dist/components/DataGridBySchemaEditable/RowEditingWatcher.d.ts.map +1 -0
  66. package/dist/components/DataGridBySchemaEditable/RowEditingWatcher.js +41 -0
  67. package/dist/components/DataGridBySchemaEditable/SelectEditInputCell.d.ts +24 -0
  68. package/dist/components/DataGridBySchemaEditable/SelectEditInputCell.d.ts.map +1 -0
  69. package/dist/components/DataGridBySchemaEditable/SelectEditInputCell.js +259 -0
  70. package/dist/components/DataGridBySchemaEditable/geoConstants.d.ts +5 -0
  71. package/dist/components/DataGridBySchemaEditable/geoConstants.d.ts.map +1 -0
  72. package/dist/components/DataGridBySchemaEditable/geoConstants.js +6 -0
  73. package/dist/components/DataGridBySchemaEditable/hooks/useDataGridActions.d.ts +33 -0
  74. package/dist/components/DataGridBySchemaEditable/hooks/useDataGridActions.d.ts.map +1 -0
  75. package/dist/components/DataGridBySchemaEditable/hooks/useDataGridActions.js +161 -0
  76. package/dist/components/DataGridBySchemaEditable/hooks/useOptionsAC.d.ts +14 -0
  77. package/dist/components/DataGridBySchemaEditable/hooks/useOptionsAC.d.ts.map +1 -0
  78. package/dist/components/DataGridBySchemaEditable/hooks/useOptionsAC.js +69 -0
  79. package/dist/components/DataGridBySchemaEditable/hooks/usePreparedColumns.d.ts +9 -0
  80. package/dist/components/DataGridBySchemaEditable/hooks/usePreparedColumns.d.ts.map +1 -0
  81. package/dist/components/DataGridBySchemaEditable/hooks/usePreparedColumns.js +73 -0
  82. package/dist/components/DataGridBySchemaEditable/hooks/useProcessRowUpdate.d.ts +30 -0
  83. package/dist/components/DataGridBySchemaEditable/hooks/useProcessRowUpdate.d.ts.map +1 -0
  84. package/dist/components/DataGridBySchemaEditable/hooks/useProcessRowUpdate.js +199 -0
  85. package/dist/components/DataGridBySchemaEditable/utils/columnFactory.d.ts +33 -0
  86. package/dist/components/DataGridBySchemaEditable/utils/columnFactory.d.ts.map +1 -0
  87. package/dist/components/DataGridBySchemaEditable/utils/columnFactory.js +270 -0
  88. package/dist/components/DataGridBySchemaEditable/utils.d.ts +40 -0
  89. package/dist/components/DataGridBySchemaEditable/utils.d.ts.map +1 -0
  90. package/dist/components/DataGridBySchemaEditable/utils.js +181 -0
  91. package/dist/components/DataGridBySchemaEditable.d.ts +64 -0
  92. package/dist/components/DataGridBySchemaEditable.d.ts.map +1 -0
  93. package/dist/components/DataGridBySchemaEditable.js +172 -0
  94. package/dist/components/DataTotals.d.ts +12 -0
  95. package/dist/components/DataTotals.d.ts.map +1 -0
  96. package/dist/components/DataTotals.js +32 -0
  97. package/dist/components/DataTotalsServer.d.ts +10 -0
  98. package/dist/components/DataTotalsServer.d.ts.map +1 -0
  99. package/dist/components/DataTotalsServer.js +18 -0
  100. package/dist/components/DialogActions.d.ts +11 -0
  101. package/dist/components/DialogActions.d.ts.map +1 -0
  102. package/dist/components/DialogActions.js +20 -0
  103. package/dist/components/FileTypeIcon.d.ts +18 -0
  104. package/dist/components/FileTypeIcon.d.ts.map +1 -0
  105. package/dist/components/FileTypeIcon.js +48 -0
  106. package/dist/components/GenericModelList.d.ts +53 -0
  107. package/dist/components/GenericModelList.d.ts.map +1 -0
  108. package/dist/components/GenericModelList.js +194 -0
  109. package/dist/components/GenericRelatedModelList.d.ts +55 -0
  110. package/dist/components/GenericRelatedModelList.d.ts.map +1 -0
  111. package/dist/components/GenericRelatedModelList.js +181 -0
  112. package/dist/components/GenericRelatedModelListTable.d.ts +56 -0
  113. package/dist/components/GenericRelatedModelListTable.d.ts.map +1 -0
  114. package/dist/components/GenericRelatedModelListTable.js +31 -0
  115. package/dist/components/Image.d.ts +10 -0
  116. package/dist/components/Image.d.ts.map +1 -0
  117. package/dist/components/Image.js +111 -0
  118. package/dist/components/details/DetailBySchema.d.ts +4 -0
  119. package/dist/components/details/DetailBySchema.d.ts.map +1 -0
  120. package/dist/components/details/DetailBySchema.js +175 -0
  121. package/dist/components/details/DetailFieldBySchema.d.ts +4 -0
  122. package/dist/components/details/DetailFieldBySchema.d.ts.map +1 -0
  123. package/dist/components/details/DetailFieldBySchema.js +88 -0
  124. package/dist/components/forms/ChangePasswordForm.d.ts +7 -0
  125. package/dist/components/forms/ChangePasswordForm.d.ts.map +1 -0
  126. package/dist/components/forms/ChangePasswordForm.js +93 -0
  127. package/dist/components/forms/DialogFormBySchema.d.ts +22 -0
  128. package/dist/components/forms/DialogFormBySchema.d.ts.map +1 -0
  129. package/dist/components/forms/DialogFormBySchema.js +97 -0
  130. package/dist/components/forms/FieldBySchema.d.ts +4 -0
  131. package/dist/components/forms/FieldBySchema.d.ts.map +1 -0
  132. package/dist/components/forms/FieldBySchema.js +80 -0
  133. package/dist/components/forms/ForgotPasswordForm.d.ts +11 -0
  134. package/dist/components/forms/ForgotPasswordForm.d.ts.map +1 -0
  135. package/dist/components/forms/ForgotPasswordForm.js +114 -0
  136. package/dist/components/forms/Form.d.ts +61 -0
  137. package/dist/components/forms/Form.d.ts.map +1 -0
  138. package/dist/components/forms/Form.js +264 -0
  139. package/dist/components/forms/FormActions.d.ts +20 -0
  140. package/dist/components/forms/FormActions.d.ts.map +1 -0
  141. package/dist/components/forms/FormActions.js +55 -0
  142. package/dist/components/forms/FormBySchema.d.ts +21 -0
  143. package/dist/components/forms/FormBySchema.d.ts.map +1 -0
  144. package/dist/components/forms/FormBySchema.js +280 -0
  145. package/dist/components/forms/FormWatcher.d.ts +10 -0
  146. package/dist/components/forms/FormWatcher.d.ts.map +1 -0
  147. package/dist/components/forms/FormWatcher.js +25 -0
  148. package/dist/components/forms/inputs/AutocompleteFieldBySchema.d.ts +13 -0
  149. package/dist/components/forms/inputs/AutocompleteFieldBySchema.d.ts.map +1 -0
  150. package/dist/components/forms/inputs/AutocompleteFieldBySchema.js +133 -0
  151. package/dist/components/forms/inputs/BooleanFieldBySchema.d.ts +4 -0
  152. package/dist/components/forms/inputs/BooleanFieldBySchema.d.ts.map +1 -0
  153. package/dist/components/forms/inputs/BooleanFieldBySchema.js +39 -0
  154. package/dist/components/forms/inputs/DesktopDatePickerBySchema.d.ts +5 -0
  155. package/dist/components/forms/inputs/DesktopDatePickerBySchema.d.ts.map +1 -0
  156. package/dist/components/forms/inputs/DesktopDatePickerBySchema.js +54 -0
  157. package/dist/components/forms/inputs/DesktopDateTimePickerBySchema.d.ts +5 -0
  158. package/dist/components/forms/inputs/DesktopDateTimePickerBySchema.d.ts.map +1 -0
  159. package/dist/components/forms/inputs/DesktopDateTimePickerBySchema.js +47 -0
  160. package/dist/components/forms/inputs/EditableAutocompleteFieldBySchema.d.ts +14 -0
  161. package/dist/components/forms/inputs/EditableAutocompleteFieldBySchema.d.ts.map +1 -0
  162. package/dist/components/forms/inputs/EditableAutocompleteFieldBySchema.js +272 -0
  163. package/dist/components/forms/inputs/FileFieldBySchema.d.ts +4 -0
  164. package/dist/components/forms/inputs/FileFieldBySchema.d.ts.map +1 -0
  165. package/dist/components/forms/inputs/FileFieldBySchema.js +144 -0
  166. package/dist/components/forms/inputs/FloatFieldBySchema.d.ts +4 -0
  167. package/dist/components/forms/inputs/FloatFieldBySchema.d.ts.map +1 -0
  168. package/dist/components/forms/inputs/FloatFieldBySchema.js +64 -0
  169. package/dist/components/forms/inputs/GeometryFieldBySchema.d.ts +8 -0
  170. package/dist/components/forms/inputs/GeometryFieldBySchema.d.ts.map +1 -0
  171. package/dist/components/forms/inputs/GeometryFieldBySchema.js +61 -0
  172. package/dist/components/forms/inputs/MapGeometryPicker.d.ts +19 -0
  173. package/dist/components/forms/inputs/MapGeometryPicker.d.ts.map +1 -0
  174. package/dist/components/forms/inputs/MapGeometryPicker.js +344 -0
  175. package/dist/components/forms/inputs/PatternFieldBySchema.d.ts +4 -0
  176. package/dist/components/forms/inputs/PatternFieldBySchema.d.ts.map +1 -0
  177. package/dist/components/forms/inputs/PatternFieldBySchema.js +56 -0
  178. package/dist/components/forms/inputs/TextFieldBySchema.d.ts +4 -0
  179. package/dist/components/forms/inputs/TextFieldBySchema.d.ts.map +1 -0
  180. package/dist/components/forms/inputs/TextFieldBySchema.js +56 -0
  181. package/dist/components/forms/inputs/leafletMarker.d.ts +12 -0
  182. package/dist/components/forms/inputs/leafletMarker.d.ts.map +1 -0
  183. package/dist/components/forms/inputs/leafletMarker.js +52 -0
  184. package/dist/context/APIWrapper.d.ts +18 -0
  185. package/dist/context/APIWrapper.d.ts.map +1 -0
  186. package/dist/context/APIWrapper.js +593 -0
  187. package/dist/context/APIWrapperContext.d.ts +132 -0
  188. package/dist/context/APIWrapperContext.d.ts.map +1 -0
  189. package/dist/context/APIWrapperContext.js +63 -0
  190. package/dist/context/DRFReactBySchemaContext.d.ts +31 -0
  191. package/dist/context/DRFReactBySchemaContext.d.ts.map +1 -0
  192. package/dist/context/DRFReactBySchemaContext.js +20 -0
  193. package/dist/context/DRFReactBySchemaProvider.d.ts +5 -0
  194. package/dist/context/DRFReactBySchemaProvider.d.ts.map +1 -0
  195. package/dist/context/DRFReactBySchemaProvider.js +105 -0
  196. package/dist/context/Overlays.d.ts +5 -0
  197. package/dist/context/Overlays.d.ts.map +1 -0
  198. package/dist/context/Overlays.js +114 -0
  199. package/dist/context/PrivateContext.d.ts +10 -0
  200. package/dist/context/PrivateContext.d.ts.map +1 -0
  201. package/dist/context/PrivateContext.js +16 -0
  202. package/dist/hooks/useDeepMemo.d.ts +2 -0
  203. package/dist/hooks/useDeepMemo.d.ts.map +1 -0
  204. package/dist/hooks/useDeepMemo.js +13 -0
  205. package/dist/hooks/useWhyDidYouUpdate.d.ts +4 -0
  206. package/dist/hooks/useWhyDidYouUpdate.d.ts.map +1 -0
  207. package/dist/hooks/useWhyDidYouUpdate.js +26 -0
  208. package/dist/index.d.ts +37 -0
  209. package/dist/index.d.ts.map +1 -0
  210. package/dist/index.js +108 -0
  211. package/dist/styles/grid.d.ts +3 -0
  212. package/dist/styles/grid.d.ts.map +1 -0
  213. package/dist/styles/grid.js +38 -0
  214. package/dist/styles/index.d.ts +3 -0
  215. package/dist/styles/index.d.ts.map +1 -0
  216. package/dist/styles/index.js +38 -0
  217. package/dist/styles/layout.d.ts +23 -0
  218. package/dist/styles/layout.d.ts.map +1 -0
  219. package/dist/styles/layout.js +71 -0
  220. package/dist/styles/texts.d.ts +66 -0
  221. package/dist/styles/texts.d.ts.map +1 -0
  222. package/dist/styles/texts.js +73 -0
  223. package/dist/styles/theme.d.ts +29 -0
  224. package/dist/styles/theme.d.ts.map +1 -0
  225. package/dist/styles/theme.js +226 -0
  226. package/dist/utils/index.d.ts +2 -0
  227. package/dist/utils/index.d.ts.map +1 -0
  228. package/dist/utils/index.js +17 -0
  229. package/dist/utils/utils.d.ts +107 -0
  230. package/dist/utils/utils.d.ts.map +1 -0
  231. package/dist/utils/utils.js +957 -0
  232. package/package.json +1 -1
@@ -0,0 +1,226 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const styles_1 = require("@mui/material/styles");
4
+ const locale_1 = require("@mui/material/locale");
5
+ const locales_1 = require("@mui/x-data-grid/locales");
6
+ const locales_2 = require("@mui/x-date-pickers/locales");
7
+ const texts_1 = require("./texts");
8
+ locales_1.ptBR.components.MuiDataGrid.defaultProps.localeText = Object.assign(Object.assign({}, locales_1.ptBR.components.MuiDataGrid.defaultProps.localeText), { toolbarQuickFilterPlaceholder: 'Buscar...', toolbarQuickFilterLabel: 'Buscar', toolbarQuickFilterDeleteIconLabel: 'Limpar busca' });
9
+ const palette = {
10
+ avatars: [
11
+ '#e60049',
12
+ '#0bb4ff',
13
+ '#50e991',
14
+ '#e6d800',
15
+ '#9b19f5',
16
+ '#ffa300',
17
+ '#dc0ab4',
18
+ '#b3d4ff',
19
+ '#00bfa0',
20
+ ],
21
+ avatarsMore: [
22
+ '#023fa5',
23
+ '#8e063b',
24
+ '#d33f6a',
25
+ '#11c638',
26
+ '#ef9708',
27
+ '#0fcfc0',
28
+ '#f79cd4',
29
+ '#7d87b9',
30
+ '#bb7784',
31
+ '#4a6fe3',
32
+ '#8595e1',
33
+ '#b5bbe3',
34
+ '#e6afb9',
35
+ '#e07b91',
36
+ '#8dd593',
37
+ '#c6dec7',
38
+ '#ead3c6',
39
+ '#f0b98d',
40
+ '#9cded6',
41
+ '#d5eae7',
42
+ '#f3e1eb',
43
+ '#f6c4e1',
44
+ '#bec1d4',
45
+ '#d6bcc0',
46
+ ],
47
+ topBarButton: {
48
+ main: '#ffffff',
49
+ },
50
+ producao: {
51
+ main: '#e60049',
52
+ contrastText: '#fff',
53
+ },
54
+ empreendimento: {
55
+ main: '#0bb4ff',
56
+ contrastText: '#fff',
57
+ },
58
+ comercializacao: {
59
+ main: '#ffa300',
60
+ contrastText: '#fff',
61
+ },
62
+ credito: {
63
+ main: '#dc0ab4',
64
+ contrastText: '#fff',
65
+ },
66
+ certificacao: {
67
+ main: '#9b19f5',
68
+ contrastText: '#fff',
69
+ },
70
+ background: {
71
+ default: '#D9D9D9',
72
+ },
73
+ primary: {
74
+ main: '#3949AB',
75
+ },
76
+ secondary: {
77
+ main: '#9ca4d5',
78
+ contrastText: '#fff',
79
+ },
80
+ successButton: {
81
+ main: '#CDDC39',
82
+ contrastText: '#fff',
83
+ },
84
+ success: {
85
+ main: '#0e0',
86
+ contrastText: '#fff',
87
+ semaphoric: '#0e0',
88
+ },
89
+ error: {
90
+ main: '#d32f2f',
91
+ semaphoric: '#f66',
92
+ },
93
+ warning: {
94
+ main: '#ee0',
95
+ semaphoric: '#ee0',
96
+ },
97
+ selectedItem: {
98
+ main: '#2962FF',
99
+ },
100
+ tableColumnHeader: {
101
+ main: '#ECEFF1',
102
+ },
103
+ formCard: {
104
+ main: '#FFF',
105
+ },
106
+ };
107
+ const defaultTheme = (0, styles_1.createTheme)({
108
+ palette,
109
+ texts: texts_1.DEFAULT_TEXTS,
110
+ components: {
111
+ MuiButton: {
112
+ styleOverrides: {
113
+ contained: {
114
+ // borderRadius: 50
115
+ },
116
+ },
117
+ },
118
+ MuiTextField: {
119
+ styleOverrides: {
120
+ root: {
121
+ '&.Mui-required .MuiFormLabel-asterisk': {
122
+ // color: '#F00'
123
+ },
124
+ },
125
+ },
126
+ },
127
+ MuiListItemButton: {
128
+ styleOverrides: {
129
+ root: {
130
+ '&.Mui-selected, :hover': {
131
+ color: palette.selectedItem.main,
132
+ '& .MuiListItemIcon-root': {
133
+ color: palette.selectedItem.main,
134
+ },
135
+ },
136
+ '&.Mui-selected:hover': {
137
+ color: palette.selectedItem.main,
138
+ '& .MuiListItemIcon-root': {
139
+ color: palette.selectedItem.main,
140
+ },
141
+ },
142
+ '&.disabled': {
143
+ opacity: 0.5,
144
+ },
145
+ },
146
+ },
147
+ },
148
+ MuiDataGrid: {
149
+ styleOverrides: {
150
+ root: {
151
+ backgroundColor: palette.formCard.main,
152
+ // Target the Virtual Scroller directly
153
+ '& .MuiDataGrid-virtualScroller': {
154
+ transition: 'outline 0.2s ease-in-out, outline-offset 0.2s ease-in-out',
155
+ '&:focus-visible': {
156
+ outline: `2px solid ${palette.primary.main}`,
157
+ outlineOffset: '-2px',
158
+ zIndex: 1,
159
+ },
160
+ '&:focus': {
161
+ outline: 'none',
162
+ },
163
+ },
164
+ },
165
+ columnHeader: {
166
+ backgroundColor: palette.tableColumnHeader.main,
167
+ '& .MuiDataGrid-columnHeaderTitle': {
168
+ overflow: 'visible',
169
+ lineHeight: '1.43rem',
170
+ whiteSpace: 'normal',
171
+ },
172
+ },
173
+ row: {
174
+ '&.Mui-editing': {
175
+ maxHeight: 'none !important',
176
+ },
177
+ '&.MuiDataGrid-row--editing': {
178
+ backgroundColor: 'rgba(57, 73, 171, 0.08)',
179
+ zIndex: 1,
180
+ '& .MuiDataGrid-cell': {
181
+ boxShadow: `inset 0 2px 0 0 ${palette.primary.main}, inset 0 -2px 0 0 ${palette.primary.main}`,
182
+ '&.MuiDataGrid-cell--editing': {
183
+ backgroundColor: 'transparent',
184
+ // '&:focus-within': { outline: 'none' },
185
+ },
186
+ '&.cell--error': {
187
+ border: '0 1px solid red',
188
+ boxShadow: `inset 0 2px 0 0 ${palette.error.main}, inset 0 -2px 0 0 ${palette.error.main}`,
189
+ height: 'auto !important',
190
+ minHeight: 'var(--DataGrid-rowHeight)',
191
+ display: 'flex',
192
+ flexDirection: 'column',
193
+ justifyContent: 'center',
194
+ alignItems: 'stretch !important',
195
+ backgroundColor: (0, styles_1.alpha)(palette.error.main, 0.1),
196
+ '& .MuiFormHelperText-root': {
197
+ margin: 0,
198
+ borderTop: '1px solid red',
199
+ padding: '2px 4px',
200
+ fontSize: '0.75rem',
201
+ whiteSpace: 'normal',
202
+ lineHeight: 1.2,
203
+ backgroundColor: 'transparent',
204
+ },
205
+ },
206
+ },
207
+ },
208
+ },
209
+ },
210
+ },
211
+ MuiTabs: {
212
+ styleOverrides: {
213
+ root: {
214
+ backgroundColor: palette.formCard.main,
215
+ marginTop: 20,
216
+ },
217
+ },
218
+ },
219
+ MuiCircularProgress: {
220
+ defaultProps: {
221
+ 'aria-label': 'Carregando...',
222
+ },
223
+ },
224
+ },
225
+ }, locale_1.ptBR, locales_1.ptBR, locales_2.ptBR);
226
+ exports.default = defaultTheme;
@@ -0,0 +1,2 @@
1
+ export * from './utils';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./utils"), exports);
@@ -0,0 +1,107 @@
1
+ import * as Yup from 'yup';
2
+ import { GridFilterModel } from '@mui/x-data-grid';
3
+ import * as geojson from 'geojson';
4
+ import { ChoiceItem, ChoiceValue, ConditionalVisible, CustomFormField, ExtraValidators, Field, FormFieldLayout, GenericValue, GeometryFieldType, GridEnrichedBySchemaColDef, Item, SchemaType, TField } from '../@types';
5
+ export declare const emptyByType: GenericValue;
6
+ export declare const getChoiceByValue: (value: ChoiceValue, choices: ChoiceItem[] | undefined) => string | null | undefined;
7
+ export declare const toChoiceItem: (rawValue: GenericValue, choices: ChoiceItem[] | undefined) => any;
8
+ export declare function enrichChoices<T extends TField = void>(rawData: Item, schema: SchemaType<T>): Item<T>;
9
+ export declare function populateValues({ data, schema }: {
10
+ data: Item;
11
+ schema: SchemaType;
12
+ }): Record<string, any>;
13
+ export declare function buildGenericYupValidationSchema({ data, schema, many, skipFields, extraValidators, uiFields, }: {
14
+ data: Item;
15
+ schema: SchemaType;
16
+ many?: boolean;
17
+ skipFields?: string[];
18
+ extraValidators?: ExtraValidators;
19
+ uiFields?: string[];
20
+ }): Yup.ObjectSchema<{
21
+ [x: string]: any;
22
+ }, Yup.AnyObject, {
23
+ [x: string]: any;
24
+ }, ""> | Yup.ArraySchema<{
25
+ [x: string]: any;
26
+ }[] | undefined, Yup.AnyObject, "", "">;
27
+ export declare function loadSinglePageDataHelper({ data, schema, columns, fieldsLayout, defaults, extraValidators, }: {
28
+ data: Item;
29
+ schema: SchemaType;
30
+ columns?: GridEnrichedBySchemaColDef[];
31
+ fieldsLayout: FormFieldLayout[] | undefined;
32
+ defaults?: Item;
33
+ extraValidators?: ExtraValidators;
34
+ }): {
35
+ values: Record<string, any>;
36
+ finalSchema: {
37
+ [x: string]: Field;
38
+ };
39
+ validationSchema: Yup.ObjectSchema<Record<string, any>, Yup.AnyObject, any, ""> | null;
40
+ };
41
+ export declare const errorProps: ({ errors, fieldKey, fieldKeyProp, index, }: {
42
+ errors: Item;
43
+ fieldKey: string;
44
+ fieldKeyProp: string;
45
+ index?: number;
46
+ }) => {
47
+ error: any;
48
+ helperText: any;
49
+ };
50
+ /**
51
+ * Normalizes a DRF (Django REST Framework) validation error payload into a
52
+ * react-hook-form `setError`-compatible map: `{ fieldKey: { type, message } }`.
53
+ *
54
+ * DRF returns per-field errors both as `{ field: "message" }` and
55
+ * `{ field: ["message 1", "message 2"] }`, plus `{ non_field_errors: [...] }`.
56
+ * Only fields present in the given `schema` are mapped, so backend-only keys
57
+ * (or `non_field_errors`) are skipped and remain surfaced through the generic
58
+ * error message instead. This is what allows a `validate()` raised
59
+ * `ValidationError({"field": "..."})` to be rendered under the offending field,
60
+ * exactly like a yup validation error.
61
+ */
62
+ export declare function getFieldErrorsFromResponse<T extends TField = void>(response: unknown, schema?: SchemaType<T>): Record<string, {
63
+ type: string;
64
+ message: string;
65
+ }>;
66
+ export declare const getTmpId: () => string;
67
+ export declare const isTmpId: (id: string | number | undefined | null) => boolean;
68
+ export declare function reducer<T>(state: T | null, newState: Partial<T> | null): T | null;
69
+ export declare const getPatternFormat: (type: string) => string;
70
+ export declare function buildDateFormatBySchema(dateViews: string[] | null | undefined): "DD/MM/YYYY" | "MM/YYYY" | "YYYY" | "MM" | "DD";
71
+ export declare const slugToCamelCase: (str: string, includeFirst?: boolean) => string;
72
+ export declare const slugify: (text: string | null) => string;
73
+ export declare function mergeFilterItems(defaultFilter: GridFilterModel | undefined, filter: GridFilterModel | undefined): GridFilterModel | undefined;
74
+ export declare function initViewColumns({ schema, columns, customColumnOperations, }: {
75
+ schema: SchemaType;
76
+ columns: GridEnrichedBySchemaColDef[];
77
+ customColumnOperations?: (p: GridEnrichedBySchemaColDef) => GridEnrichedBySchemaColDef | Promise<GridEnrichedBySchemaColDef>;
78
+ }): Promise<(Omit<import("@mui/x-data-grid").GridColDef<Record<string, any>>, "field"> & {
79
+ field: string;
80
+ isIndexField?: boolean;
81
+ creatable?: boolean;
82
+ disabled?: boolean;
83
+ orderable?: boolean;
84
+ patternFormat?: string;
85
+ uiRequired?: boolean;
86
+ })[]>;
87
+ export declare function deepEqual(a: unknown, b: unknown, maxIterations?: number): boolean;
88
+ export declare function shouldMemoUpdate<T extends object>(prevProps: Readonly<T>, nextProps: Readonly<T>): boolean;
89
+ export declare const convertToFormData: (data: Item) => FormData;
90
+ export declare function formatFileSize(bytes: number): string;
91
+ export declare function getFieldsFromFieldsLayout(fieldsLayout: FormFieldLayout[]): string[];
92
+ export declare function isFieldRequired(fieldSchema?: Field, isInForm?: boolean): boolean;
93
+ export declare function extractFieldValue(genericValue: GenericValue): any;
94
+ export declare function buildConditionalVisibleBySchema<T extends TField = void>(schema?: SchemaType<T> | null): ConditionalVisible[];
95
+ export declare function showConditionalVisibleField(field: string | CustomFormField, conditionalVisible?: ConditionalVisible[], values?: GenericValue[]): boolean;
96
+ export declare function showConditionalVisibleFieldObj<T extends TField = void>(field: string | CustomFormField, conditionalVisible?: ConditionalVisible[], values?: Item<T>): boolean;
97
+ /**
98
+ * Detect whether the consuming app has installed leaflet + leaflet-draw.
99
+ * Uses CJS require so that the bundler does not fail to build when they are
100
+ * absent; returns null so callers can fall back to text inputs.
101
+ */
102
+ export declare function getMapLibraries(): any;
103
+ /** Normalize a GeoJSON value (object, JSON string or null) to a string. */
104
+ export declare function geometryValueToString(value: GenericValue): string;
105
+ /** Parse a GeoJSON value (object or JSON string) into an object, or null. */
106
+ export declare function parseGeoJSON(geoType: GeometryFieldType, rawValue: GenericValue): geojson.GeoJsonObject | geojson.GeoJsonObject[] | null;
107
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,OAAO,EACL,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,KAAK,EAEL,eAAe,EACf,YAAY,EAEZ,iBAAiB,EACjB,0BAA0B,EAC1B,IAAI,EACJ,UAAU,EACV,MAAM,EACP,MAAM,WAAW,CAAC;AAEnB,eAAO,MAAM,WAAW,EAAE,YA4BzB,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,OAAO,WAAW,EAAE,SAAS,UAAU,EAAE,GAAG,SAAS,8BASrF,CAAC;AAIF,eAAO,MAAM,YAAY,GAAI,UAAU,YAAY,EAAE,SAAS,UAAU,EAAE,GAAG,SAAS,QAM/E,CAAC;AAMR,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,GAAG,IAAI,EACnD,OAAO,EAAE,IAAI,EACb,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,GACpB,IAAI,CAAC,CAAC,CA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