@comet/admin 9.0.0-beta.3 → 9.0.0-beta.5

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 (105) hide show
  1. package/lib/common/DeleteDialog.d.ts +1 -0
  2. package/lib/common/DeleteDialog.d.ts.map +1 -1
  3. package/lib/common/DeleteDialog.js +8 -1
  4. package/lib/common/__stories__/Tooltip.stories.js +404 -0
  5. package/lib/common/buttons/__stories__/Button.stories.js +445 -0
  6. package/lib/common/buttons/clearinput/ClearInputButton.js +1 -1
  7. package/lib/common/buttons/delete/__stories__/DeleteButton.stories.js +1 -1
  8. package/lib/common/toolbar/__stories__/DataGridToolbar.stories.js +76 -0
  9. package/lib/common/toolbar/__stories__/Toolbar.stories.js +82 -0
  10. package/lib/dataGrid/__stories__/ClickableRows.stories.js +109 -0
  11. package/lib/dataGrid/__stories__/CrudMoreActionsMenu.stories.js +50 -0
  12. package/lib/dataGrid/__stories__/DataGrid.stories.js +94 -0
  13. package/lib/dataGrid/__stories__/DataGridSingleSelectFilter.stories.js +492 -0
  14. package/lib/error/errorHandler/ErrorHandlerProvider.d.ts +8 -0
  15. package/lib/error/errorHandler/ErrorHandlerProvider.d.ts.map +1 -0
  16. package/lib/error/errorHandler/ErrorHandlerProvider.js +16 -0
  17. package/lib/error/errorboundary/ErrorBoundary.d.ts.map +1 -1
  18. package/lib/error/errorboundary/ErrorBoundary.js +26 -18
  19. package/lib/form/FinalFormInput.d.ts.map +1 -1
  20. package/lib/form/FinalFormInput.js +3 -2
  21. package/lib/form/__stories__/AsyncAutocompleteField.stories.js +660 -0
  22. package/lib/form/__stories__/AsyncSelectField.stories.js +513 -0
  23. package/lib/form/__stories__/Autocomplete.stories.js +188 -0
  24. package/lib/form/__stories__/AutocompleteField.stories.js +48 -0
  25. package/lib/form/__stories__/Checkbox.stories.js +70 -0
  26. package/lib/form/__stories__/CheckboxField.stories.js +87 -0
  27. package/lib/form/__stories__/CheckboxListField.stories.js +172 -0
  28. package/lib/form/__stories__/CustomButtons.stories.js +78 -0
  29. package/lib/form/__stories__/DependentAsyncSelects.stories.js +91 -0
  30. package/lib/form/__stories__/DisableAutoNavigation.stories.js +132 -0
  31. package/lib/form/__stories__/DisabledSubmitIfNotDirty.stories.js +54 -0
  32. package/lib/form/__stories__/FieldContainer.stories.js +87 -0
  33. package/lib/form/__stories__/FinalFormFileSelect.stories.js +155 -0
  34. package/lib/form/__stories__/FormInStack.stories.js +133 -0
  35. package/lib/form/__stories__/FormLayouts.stories.js +174 -0
  36. package/lib/form/__stories__/FormValidation.stories.js +82 -0
  37. package/lib/form/__stories__/Input.stories.js +37 -0
  38. package/lib/form/__stories__/NumberField.stories.js +38 -0
  39. package/lib/form/__stories__/Radio.stories.js +101 -0
  40. package/lib/form/__stories__/RadioGroupField.stories.js +172 -0
  41. package/lib/form/__stories__/RangeInput.stories.js +239 -0
  42. package/lib/form/__stories__/RouterTabs.stories.js +96 -0
  43. package/lib/form/__stories__/RouterTabsInForm.stories.js +73 -0
  44. package/lib/form/__stories__/RouterTabsInFormWithSubroutes.stories.js +96 -0
  45. package/lib/form/__stories__/ScrollToErrorField.stories.js +82 -0
  46. package/lib/form/__stories__/SearchField.stories.js +38 -0
  47. package/lib/form/__stories__/Select.stories.js +187 -0
  48. package/lib/form/__stories__/SelectField.stories.js +100 -0
  49. package/lib/form/__stories__/ShowErrorStrategies.stories.js +107 -0
  50. package/lib/form/__stories__/SingleTextField.stories.js +108 -0
  51. package/lib/form/__stories__/StackInForm.stories.js +53 -0
  52. package/lib/form/__stories__/SubmitErrors.stories.js +90 -0
  53. package/lib/form/__stories__/Switch.stories.js +49 -0
  54. package/lib/form/__stories__/SwitchField.stories.js +87 -0
  55. package/lib/form/__stories__/Tabs.stories.js +78 -0
  56. package/lib/form/__stories__/TextAreaField.stories.js +38 -0
  57. package/lib/form/__stories__/TextField.stories.js +67 -0
  58. package/lib/form/__stories__/ToggleButtonGroupField.stories.js +312 -0
  59. package/lib/form/__stories__/TwoLevelValidation.stories.js +168 -0
  60. package/lib/form/__stories__/Typography.stories.js +71 -0
  61. package/lib/form/file/__stories__/FileDropzone.stories.js +81 -0
  62. package/lib/form/file/__stories__/FileSelect.stories.js +139 -0
  63. package/lib/form/file/__stories__/FileSelectListItem.stories.js +108 -0
  64. package/lib/form/file/__stories__/FileSelectMultipleExamples.stories.js +187 -0
  65. package/lib/helpers/useTopOffset.js +1 -1
  66. package/lib/index.d.ts +1 -0
  67. package/lib/index.d.ts.map +1 -1
  68. package/lib/index.js +1 -0
  69. package/lib/section/__stories__/SectionHeadline.stories.js +71 -0
  70. package/lib/stack/Stack.d.ts.map +1 -1
  71. package/lib/stack/Stack.js +3 -0
  72. package/lib/stack/__stories__/RouterTabsNestedStack.stories.js +51 -0
  73. package/lib/stack/__stories__/Stack.stories.js +14 -0
  74. package/lib/stack/__stories__/StackBackButton.stories.js +50 -0
  75. package/lib/stack/__stories__/StackBreadcrumbs.stories.js +139 -0
  76. package/lib/stack/__stories__/StackBreadcrumbsTabs.stories.js +47 -0
  77. package/lib/stack/__stories__/StackCustomSeparator.stories.js +47 -0
  78. package/lib/stack/__stories__/StackLink.stories.js +41 -0
  79. package/lib/stack/__stories__/StackNested.stories.js +58 -0
  80. package/lib/stack/__stories__/StackNestedOnInitialPage.stories.js +78 -0
  81. package/lib/stack/__stories__/StackNestedOneStack.stories.js +90 -0
  82. package/lib/stack/__stories__/StackPageTitle.stories.js +121 -0
  83. package/lib/stack/__stories__/StackReactNodeTitle.stories.js +54 -0
  84. package/lib/stack/__stories__/StackRefApi.stories.js +56 -0
  85. package/lib/stack/__stories__/StackTableFormQueryAtStack.stories.js +155 -0
  86. package/lib/stack/__stories__/StackTableFormQueryInTable.stories.js +160 -0
  87. package/lib/stack/__stories__/StackUrl.stories.js +66 -0
  88. package/lib/tabs/__stories__/DynamicTabs.stories.js +84 -0
  89. package/lib/tabs/__stories__/NestedStackSwitchWithRouterTabs.stories.js +84 -0
  90. package/lib/tabs/__stories__/OverflowIssues.stories.js +224 -0
  91. package/lib/tabs/__stories__/RouterTabs.stories.js +31 -0
  92. package/lib/tabs/__stories__/RouterTabsInStack.stories.js +74 -0
  93. package/lib/tabs/__stories__/RouterTabsInSubroute.stories.js +68 -0
  94. package/lib/tabs/__stories__/Tabs.stories.js +219 -0
  95. package/lib/theme/componentsTheme/MuiDataGrid.js +1 -1
  96. package/lib/translator/ContentTranslationServiceContext.d.ts +1 -0
  97. package/lib/translator/ContentTranslationServiceContext.d.ts.map +1 -1
  98. package/lib/translator/ContentTranslationServiceProvider.d.ts +1 -1
  99. package/lib/translator/ContentTranslationServiceProvider.d.ts.map +1 -1
  100. package/lib/translator/ContentTranslationServiceProvider.js +4 -2
  101. package/lib/translator/PlainTextTranslationDialog.d.ts +1 -0
  102. package/lib/translator/PlainTextTranslationDialog.d.ts.map +1 -1
  103. package/lib/translator/PlainTextTranslationDialog.js +8 -3
  104. package/lib/translator/__stories__/ContentTranslation.stories.js +104 -0
  105. package/package.json +23 -24
@@ -0,0 +1,492 @@
1
+ import { Check, Close, Education } from "@comet/admin-icons";
2
+ import { Box } from "@mui/material";
3
+ import { DataGrid } from "@mui/x-data-grid";
4
+ import { DataGridToolbar } from "../../common/toolbar/DataGridToolbar";
5
+ import { GridCellContent } from "../GridCellContent";
6
+ import { GridFilterButton } from "../GridFilterButton";
7
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
+ export default {
9
+ title: "components/dataGrid/DataGridSingleSelectFilter"
10
+ };
11
+
12
+ // Sample data
13
+ var rows = [{
14
+ id: 1,
15
+ name: "Product A",
16
+ category: "electronics",
17
+ status: "active",
18
+ priority: "high",
19
+ department: "sales"
20
+ }, {
21
+ id: 2,
22
+ name: "Product B",
23
+ category: "clothing",
24
+ status: "inactive",
25
+ priority: "medium",
26
+ department: "marketing"
27
+ }, {
28
+ id: 3,
29
+ name: "Product C",
30
+ category: "electronics",
31
+ status: "active",
32
+ priority: "low",
33
+ department: "sales"
34
+ }, {
35
+ id: 4,
36
+ name: "Product D",
37
+ category: "furniture",
38
+ status: "pending",
39
+ priority: "high",
40
+ department: "operations"
41
+ }, {
42
+ id: 5,
43
+ name: "Product E",
44
+ category: "clothing",
45
+ status: "active",
46
+ priority: "medium",
47
+ department: "sales"
48
+ }, {
49
+ id: 6,
50
+ name: "Product F",
51
+ category: "electronics",
52
+ status: "inactive",
53
+ priority: "low",
54
+ department: "marketing"
55
+ }, {
56
+ id: 7,
57
+ name: "Product G",
58
+ category: "furniture",
59
+ status: "active",
60
+ priority: "high",
61
+ department: "operations"
62
+ }, {
63
+ id: 8,
64
+ name: "Product H",
65
+ category: "clothing",
66
+ status: "pending",
67
+ priority: "medium",
68
+ department: "sales"
69
+ }];
70
+
71
+ // Story 1: Basic single select with simple string options
72
+ export var BasicSingleSelect = {
73
+ render: function render() {
74
+ var columns = [{
75
+ field: "name",
76
+ headerName: "Product Name",
77
+ flex: 1
78
+ }, {
79
+ field: "category",
80
+ headerName: "Category",
81
+ width: 150,
82
+ type: "singleSelect",
83
+ valueOptions: ["electronics", "clothing", "furniture"]
84
+ }, {
85
+ field: "status",
86
+ headerName: "Status",
87
+ width: 130,
88
+ type: "singleSelect",
89
+ valueOptions: ["active", "inactive", "pending"]
90
+ }];
91
+ return /*#__PURE__*/_jsxs(Box, {
92
+ children: [/*#__PURE__*/_jsx(Box, {
93
+ component: "h4",
94
+ sx: {
95
+ mb: 2
96
+ },
97
+ children: "Basic SingleSelect Filter"
98
+ }), /*#__PURE__*/_jsx(Box, {
99
+ height: 500,
100
+ children: /*#__PURE__*/_jsx(DataGrid, {
101
+ rows: rows,
102
+ columns: columns,
103
+ slots: {
104
+ toolbar: function toolbar() {
105
+ return /*#__PURE__*/_jsx(DataGridToolbar, {
106
+ children: /*#__PURE__*/_jsx(GridFilterButton, {})
107
+ });
108
+ }
109
+ },
110
+ initialState: {
111
+ filter: {
112
+ filterModel: {
113
+ items: []
114
+ }
115
+ }
116
+ },
117
+ showToolbar: true
118
+ })
119
+ })]
120
+ });
121
+ }
122
+ };
123
+
124
+ // Story 2: Single select with custom labels
125
+ export var WithCustomLabels = {
126
+ render: function render() {
127
+ var columns = [{
128
+ field: "name",
129
+ headerName: "Product Name",
130
+ flex: 1
131
+ }, {
132
+ field: "priority",
133
+ headerName: "Priority",
134
+ width: 150,
135
+ type: "singleSelect",
136
+ valueOptions: [{
137
+ value: "high",
138
+ label: "🔴 High Priority"
139
+ }, {
140
+ value: "medium",
141
+ label: "🟡 Medium Priority"
142
+ }, {
143
+ value: "low",
144
+ label: "🟢 Low Priority"
145
+ }]
146
+ }, {
147
+ field: "department",
148
+ headerName: "Department",
149
+ width: 150,
150
+ type: "singleSelect",
151
+ valueOptions: [{
152
+ value: "sales",
153
+ label: "💼 Sales Department"
154
+ }, {
155
+ value: "marketing",
156
+ label: "📢 Marketing Department"
157
+ }, {
158
+ value: "operations",
159
+ label: "⚙️ Operations Department"
160
+ }]
161
+ }];
162
+ return /*#__PURE__*/_jsxs(Box, {
163
+ children: [/*#__PURE__*/_jsx(Box, {
164
+ component: "h4",
165
+ sx: {
166
+ mb: 2
167
+ },
168
+ children: "SingleSelect with Custom Labels"
169
+ }), /*#__PURE__*/_jsx(Box, {
170
+ height: 500,
171
+ children: /*#__PURE__*/_jsx(DataGrid, {
172
+ rows: rows,
173
+ columns: columns,
174
+ slots: {
175
+ toolbar: function toolbar() {
176
+ return /*#__PURE__*/_jsx(DataGridToolbar, {
177
+ children: /*#__PURE__*/_jsx(GridFilterButton, {})
178
+ });
179
+ }
180
+ },
181
+ showToolbar: true
182
+ })
183
+ })]
184
+ });
185
+ }
186
+ };
187
+
188
+ // Story 3: Single select with long labels (showcases vertical expansion)
189
+ export var WithLongLabels = {
190
+ render: function render() {
191
+ var columns = [{
192
+ field: "name",
193
+ headerName: "Product Name",
194
+ flex: 1
195
+ }, {
196
+ field: "category",
197
+ headerName: "Category",
198
+ width: 200,
199
+ type: "singleSelect",
200
+ valueOptions: [{
201
+ value: "electronics",
202
+ label: "Electronics and Computer Equipment with Accessories"
203
+ }, {
204
+ value: "clothing",
205
+ label: "Clothing, Apparel, and Fashion Items for All Seasons"
206
+ }, {
207
+ value: "furniture",
208
+ label: "Furniture, Home Decor, and Interior Design Products"
209
+ }]
210
+ }];
211
+ return /*#__PURE__*/_jsxs(Box, {
212
+ children: [/*#__PURE__*/_jsx(Box, {
213
+ component: "h4",
214
+ sx: {
215
+ mb: 2
216
+ },
217
+ children: "SingleSelect with Long Labels"
218
+ }), /*#__PURE__*/_jsx(Box, {
219
+ height: 500,
220
+ children: /*#__PURE__*/_jsx(DataGrid, {
221
+ rows: rows,
222
+ columns: columns,
223
+ slots: {
224
+ toolbar: function toolbar() {
225
+ return /*#__PURE__*/_jsx(DataGridToolbar, {
226
+ children: /*#__PURE__*/_jsx(GridFilterButton, {})
227
+ });
228
+ }
229
+ },
230
+ showToolbar: true
231
+ })
232
+ })]
233
+ });
234
+ }
235
+ };
236
+
237
+ // Story 4: Single select with many options
238
+ export var WithManyOptions = {
239
+ render: function render() {
240
+ var columns = [{
241
+ field: "name",
242
+ headerName: "Product Name",
243
+ flex: 1
244
+ }, {
245
+ field: "category",
246
+ headerName: "Category (Many Options)",
247
+ width: 200,
248
+ type: "singleSelect",
249
+ valueOptions: ["electronics", "clothing", "furniture", "books", "toys", "sports", "automotive", "food", "health", "beauty", "tools", "garden", "pet supplies", "office supplies", "musical instruments"]
250
+ }];
251
+ return /*#__PURE__*/_jsxs(Box, {
252
+ children: [/*#__PURE__*/_jsx(Box, {
253
+ component: "h4",
254
+ sx: {
255
+ mb: 2
256
+ },
257
+ children: "SingleSelect with Many Options"
258
+ }), /*#__PURE__*/_jsx(Box, {
259
+ height: 500,
260
+ children: /*#__PURE__*/_jsx(DataGrid, {
261
+ rows: rows,
262
+ columns: columns,
263
+ slots: {
264
+ toolbar: function toolbar() {
265
+ return /*#__PURE__*/_jsx(DataGridToolbar, {
266
+ children: /*#__PURE__*/_jsx(GridFilterButton, {})
267
+ });
268
+ }
269
+ },
270
+ showToolbar: true
271
+ })
272
+ })]
273
+ });
274
+ }
275
+ };
276
+
277
+ // Story 5: Single select with custom cell content
278
+ export var WithCustomCellContent = {
279
+ render: function render() {
280
+ var columns = [{
281
+ field: "name",
282
+ headerName: "Product Name",
283
+ flex: 1
284
+ }, {
285
+ field: "status",
286
+ headerName: "Status with Icon",
287
+ width: 200,
288
+ type: "singleSelect",
289
+ valueOptions: [{
290
+ value: "active",
291
+ label: "Active Status",
292
+ cellContent: /*#__PURE__*/_jsx(GridCellContent, {
293
+ primaryText: "Active",
294
+ icon: /*#__PURE__*/_jsx(Check, {
295
+ color: "success"
296
+ })
297
+ })
298
+ }, {
299
+ value: "inactive",
300
+ label: "Inactive Status",
301
+ cellContent: /*#__PURE__*/_jsx(GridCellContent, {
302
+ primaryText: "Inactive",
303
+ icon: /*#__PURE__*/_jsx(Close, {
304
+ color: "error"
305
+ })
306
+ })
307
+ }, {
308
+ value: "pending",
309
+ label: "Pending Review",
310
+ cellContent: /*#__PURE__*/_jsx(GridCellContent, {
311
+ primaryText: "Pending",
312
+ icon: /*#__PURE__*/_jsx(Education, {
313
+ color: "warning"
314
+ })
315
+ })
316
+ }]
317
+ }];
318
+ return /*#__PURE__*/_jsxs(Box, {
319
+ children: [/*#__PURE__*/_jsx(Box, {
320
+ component: "h4",
321
+ sx: {
322
+ mb: 2
323
+ },
324
+ children: "SingleSelect with Custom Cell Content"
325
+ }), /*#__PURE__*/_jsx(Box, {
326
+ height: 500,
327
+ children: /*#__PURE__*/_jsx(DataGrid, {
328
+ rows: rows,
329
+ columns: columns,
330
+ slots: {
331
+ toolbar: function toolbar() {
332
+ return /*#__PURE__*/_jsx(DataGridToolbar, {
333
+ children: /*#__PURE__*/_jsx(GridFilterButton, {})
334
+ });
335
+ }
336
+ },
337
+ showToolbar: true
338
+ })
339
+ })]
340
+ });
341
+ }
342
+ };
343
+
344
+ // Story 6: Multiple single select columns
345
+ export var MultipleSingleSelectColumns = {
346
+ render: function render() {
347
+ var columns = [{
348
+ field: "name",
349
+ headerName: "Product Name",
350
+ flex: 1
351
+ }, {
352
+ field: "category",
353
+ headerName: "Category",
354
+ width: 140,
355
+ type: "singleSelect",
356
+ valueOptions: ["electronics", "clothing", "furniture"]
357
+ }, {
358
+ field: "status",
359
+ headerName: "Status",
360
+ width: 130,
361
+ type: "singleSelect",
362
+ valueOptions: ["active", "inactive", "pending"]
363
+ }, {
364
+ field: "priority",
365
+ headerName: "Priority",
366
+ width: 130,
367
+ type: "singleSelect",
368
+ valueOptions: [{
369
+ value: "high",
370
+ label: "High"
371
+ }, {
372
+ value: "medium",
373
+ label: "Medium"
374
+ }, {
375
+ value: "low",
376
+ label: "Low"
377
+ }]
378
+ }, {
379
+ field: "department",
380
+ headerName: "Department",
381
+ width: 150,
382
+ type: "singleSelect",
383
+ valueOptions: ["sales", "marketing", "operations"]
384
+ }];
385
+ return /*#__PURE__*/_jsxs(Box, {
386
+ children: [/*#__PURE__*/_jsx(Box, {
387
+ component: "h4",
388
+ sx: {
389
+ mb: 2
390
+ },
391
+ children: "Multiple SingleSelect Columns"
392
+ }), /*#__PURE__*/_jsx(Box, {
393
+ height: 500,
394
+ children: /*#__PURE__*/_jsx(DataGrid, {
395
+ rows: rows,
396
+ columns: columns,
397
+ slots: {
398
+ toolbar: function toolbar() {
399
+ return /*#__PURE__*/_jsx(DataGridToolbar, {
400
+ children: /*#__PURE__*/_jsx(GridFilterButton, {})
401
+ });
402
+ }
403
+ },
404
+ showToolbar: true
405
+ })
406
+ })]
407
+ });
408
+ }
409
+ };
410
+
411
+ // Story 7: Different density modes
412
+
413
+ export var DifferentDensityModes = {
414
+ args: {
415
+ density: "standard"
416
+ },
417
+ argTypes: {
418
+ density: {
419
+ name: "Density",
420
+ control: "select",
421
+ options: ["standard", "comfortable", "compact"]
422
+ }
423
+ },
424
+ render: function render(_ref) {
425
+ var density = _ref.density;
426
+ var columns = [{
427
+ field: "name",
428
+ headerName: "Product Name",
429
+ flex: 1
430
+ }, {
431
+ field: "category",
432
+ headerName: "Category",
433
+ width: 150,
434
+ type: "singleSelect",
435
+ valueOptions: ["electronics", "clothing", "furniture"]
436
+ }, {
437
+ field: "status",
438
+ headerName: "Status",
439
+ width: 130,
440
+ type: "singleSelect",
441
+ valueOptions: [{
442
+ value: "active",
443
+ label: "Active Status"
444
+ }, {
445
+ value: "inactive",
446
+ label: "Inactive Status"
447
+ }, {
448
+ value: "pending",
449
+ label: "Pending Review"
450
+ }]
451
+ }, {
452
+ field: "priority",
453
+ headerName: "Priority",
454
+ width: 130,
455
+ type: "singleSelect",
456
+ valueOptions: [{
457
+ value: "high",
458
+ label: "🔴 High Priority"
459
+ }, {
460
+ value: "medium",
461
+ label: "🟡 Medium Priority"
462
+ }, {
463
+ value: "low",
464
+ label: "🟢 Low Priority"
465
+ }]
466
+ }];
467
+ return /*#__PURE__*/_jsxs(Box, {
468
+ children: [/*#__PURE__*/_jsxs(Box, {
469
+ component: "h4",
470
+ sx: {
471
+ mb: 2
472
+ },
473
+ children: ["SingleSelect Filter - ", density, " Density"]
474
+ }), /*#__PURE__*/_jsx(Box, {
475
+ height: 500,
476
+ children: /*#__PURE__*/_jsx(DataGrid, {
477
+ density: density,
478
+ rows: rows,
479
+ columns: columns,
480
+ slots: {
481
+ toolbar: function toolbar() {
482
+ return /*#__PURE__*/_jsx(DataGridToolbar, {
483
+ children: /*#__PURE__*/_jsx(GridFilterButton, {})
484
+ });
485
+ }
486
+ },
487
+ showToolbar: true
488
+ })
489
+ })]
490
+ });
491
+ }
492
+ };
@@ -0,0 +1,8 @@
1
+ import { type ErrorInfo, type PropsWithChildren } from "react";
2
+ interface ErrorHandlerContextValue {
3
+ onError?: (error: Error, errorInfo: ErrorInfo) => void;
4
+ }
5
+ export declare function ErrorHandlerProvider({ children, onError }: PropsWithChildren<ErrorHandlerContextValue>): import("react/jsx-runtime").JSX.Element;
6
+ export declare const useErrorHandler: () => ErrorHandlerContextValue;
7
+ export {};
8
+ //# sourceMappingURL=ErrorHandlerProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorHandlerProvider.d.ts","sourceRoot":"","sources":["../../../src/error/errorHandler/ErrorHandlerProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAAc,MAAM,OAAO,CAAC;AAE1F,UAAU,wBAAwB;IAC9B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;CAC1D;AAID,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,iBAAiB,CAAC,wBAAwB,CAAC,2CAEtG;AAED,eAAO,MAAM,eAAe,gCAE3B,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { createContext, useContext } from "react";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ var ErrorHandlerContext = /*#__PURE__*/createContext({});
4
+ export function ErrorHandlerProvider(_ref) {
5
+ var children = _ref.children,
6
+ onError = _ref.onError;
7
+ return /*#__PURE__*/_jsx(ErrorHandlerContext.Provider, {
8
+ value: {
9
+ onError: onError
10
+ },
11
+ children: children
12
+ });
13
+ }
14
+ export var useErrorHandler = function useErrorHandler() {
15
+ return useContext(ErrorHandlerContext);
16
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/error/errorboundary/ErrorBoundary.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,KAAK,UAAU,EAAE,KAAK,mBAAmB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACzG,OAAO,EAAO,KAAK,KAAK,EAAiB,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAA6B,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAI1F,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,C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;CAC1C,CAAC,CAAC;AAiGP,eAAO,MAAM,aAAa,GAAI,SAAS,kBAAkB,4CAIxD,CAAC;AAwEF,OAAO,QAAQ,sBAAsB,CAAC;IAClC,UAAU,uBAAuB;QAC7B,uBAAuB,EAAE,qBAAqB,CAAC;KAClD;IAED,UAAU,mBAAmB;QACzB,uBAAuB,EAAE,kBAAkB,CAAC;KAC/C;IAED,UAAU,UAAU;QAChB,uBAAuB,CAAC,EAAE;YACtB,YAAY,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,yBAAyB,CAAC,CAAC,CAAC;YACvE,cAAc,CAAC,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC,yBAAyB,CAAC,CAAC;SAC1E,CAAC;KACL;CACJ"}
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["variant", "icon", "toggleDetailsOpenedIcon", "toggleDetailsClosedIcon", "children", "slotProps", "userErrorMessage", "key"];
2
+ var _excluded = ["variant", "icon", "toggleDetailsOpenedIcon", "toggleDetailsClosedIcon", "children", "slotProps", "userErrorMessage", "key", "onError"];
3
3
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
4
4
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
5
5
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
@@ -26,6 +26,7 @@ import { css, useThemeProps } from "@mui/material/styles";
26
26
  import { Component } from "react";
27
27
  import { FormattedMessage } from "react-intl";
28
28
  import { createComponentSlot } from "../../helpers/createComponentSlot";
29
+ import { useErrorHandler } from "../errorHandler/ErrorHandlerProvider";
29
30
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
30
31
  var Alert = createComponentSlot(MuiAlert)({
31
32
  componentName: "ErrorBoundary",
@@ -82,7 +83,11 @@ export var ErrorBoundary = function ErrorBoundary(inProps) {
82
83
  props: inProps,
83
84
  name: "CometAdminErrorBoundary"
84
85
  });
85
- return /*#__PURE__*/_jsx(CoreErrorBoundary, _objectSpread({}, props));
86
+ var _useErrorHandler = useErrorHandler(),
87
+ onError = _useErrorHandler.onError;
88
+ return /*#__PURE__*/_jsx(CoreErrorBoundary, _objectSpread(_objectSpread({}, props), {}, {
89
+ onError: onError
90
+ }));
86
91
  };
87
92
  var CoreErrorBoundary = /*#__PURE__*/function (_Component) {
88
93
  function CoreErrorBoundary(props) {
@@ -96,35 +101,38 @@ var CoreErrorBoundary = /*#__PURE__*/function (_Component) {
96
101
  return _createClass(CoreErrorBoundary, [{
97
102
  key: "componentDidCatch",
98
103
  value: function componentDidCatch(error, errorInfo) {
104
+ var _this$props$onError, _this$props;
99
105
  this.setState(function (prev) {
100
106
  return _objectSpread(_objectSpread({}, prev), {}, {
101
107
  error: error,
102
108
  errorInfo: errorInfo
103
109
  });
104
110
  });
111
+ (_this$props$onError = (_this$props = this.props).onError) === null || _this$props$onError === void 0 || _this$props$onError.call(_this$props, error, errorInfo);
105
112
  }
106
113
  }, {
107
114
  key: "render",
108
115
  value: function render() {
109
116
  var _this2 = this;
110
- var _this$props = this.props,
111
- _this$props$variant = _this$props.variant,
112
- variant = _this$props$variant === void 0 ? "filled" : _this$props$variant,
113
- _this$props$icon = _this$props.icon,
114
- icon = _this$props$icon === void 0 ? /*#__PURE__*/_jsx(Error, {}) : _this$props$icon,
115
- _this$props$toggleDet = _this$props.toggleDetailsOpenedIcon,
116
- toggleDetailsOpenedIcon = _this$props$toggleDet === void 0 ? /*#__PURE__*/_jsx(ChevronRight, {
117
+ var _this$props2 = this.props,
118
+ _this$props2$variant = _this$props2.variant,
119
+ variant = _this$props2$variant === void 0 ? "filled" : _this$props2$variant,
120
+ _this$props2$icon = _this$props2.icon,
121
+ icon = _this$props2$icon === void 0 ? /*#__PURE__*/_jsx(Error, {}) : _this$props2$icon,
122
+ _this$props2$toggleDe = _this$props2.toggleDetailsOpenedIcon,
123
+ toggleDetailsOpenedIcon = _this$props2$toggleDe === void 0 ? /*#__PURE__*/_jsx(ChevronRight, {
117
124
  fontSize: "small"
118
- }) : _this$props$toggleDet,
119
- _this$props$toggleDet2 = _this$props.toggleDetailsClosedIcon,
120
- toggleDetailsClosedIcon = _this$props$toggleDet2 === void 0 ? /*#__PURE__*/_jsx(ChevronDown, {
125
+ }) : _this$props2$toggleDe,
126
+ _this$props2$toggleDe2 = _this$props2.toggleDetailsClosedIcon,
127
+ toggleDetailsClosedIcon = _this$props2$toggleDe2 === void 0 ? /*#__PURE__*/_jsx(ChevronDown, {
121
128
  fontSize: "small"
122
- }) : _this$props$toggleDet2,
123
- children = _this$props.children,
124
- slotProps = _this$props.slotProps,
125
- userErrorMessage = _this$props.userErrorMessage,
126
- key = _this$props.key,
127
- restProps = _objectWithoutProperties(_this$props, _excluded);
129
+ }) : _this$props2$toggleDe2,
130
+ children = _this$props2.children,
131
+ slotProps = _this$props2.slotProps,
132
+ userErrorMessage = _this$props2.userErrorMessage,
133
+ key = _this$props2.key,
134
+ onError = _this$props2.onError,
135
+ restProps = _objectWithoutProperties(_this$props2, _excluded);
128
136
  var _this$state = this.state,
129
137
  error = _this$state.error,
130
138
  errorInfo = _this$state.errorInfo,
@@ -1 +1 @@
1
- {"version":3,"file":"FinalFormInput.d.ts","sourceRoot":"","sources":["../../src/form/FinalFormInput.tsx"],"names":[],"mappings":"AACA,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAQzD,MAAM,MAAM,mBAAmB,GAAG,cAAc,GAAG;IAC/C,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACvC,CAAC;AAEF,KAAK,2BAA2B,GAAG,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,mBAAmB,CAAC,CAAC;AAEpG,wBAAgB,cAAc,CAAC,EAC3B,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,yBAAyB,EACzB,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,GAAG,KAAK,EACX,EAAE,mBAAmB,GAAG,2BAA2B,2CAsDnD"}
1
+ {"version":3,"file":"FinalFormInput.d.ts","sourceRoot":"","sources":["../../src/form/FinalFormInput.tsx"],"names":[],"mappings":"AACA,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAQzD,MAAM,MAAM,mBAAmB,GAAG,cAAc,GAAG;IAC/C,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACvC,CAAC;AAEF,KAAK,2BAA2B,GAAG,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,mBAAmB,CAAC,CAAC;AAEpG,wBAAgB,cAAc,CAAC,EAC3B,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,yBAAyB,EACzB,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,GAAG,KAAK,EACX,EAAE,mBAAmB,GAAG,2BAA2B,2CAuDnD"}
@@ -42,7 +42,7 @@ export function FinalFormInput(_ref) {
42
42
  translationEnabled = _useContentTranslatio.enabled,
43
43
  showApplyTranslationDialog = _useContentTranslatio.showApplyTranslationDialog,
44
44
  translate = _useContentTranslatio.translate;
45
- var isTranslatable = translationEnabled && !disableContentTranslation && type === "text" && !props.disabled;
45
+ var isTranslatable = translationEnabled && !disableContentTranslation && (type === "text" || type === "textarea") && !props.disabled;
46
46
  var _useState = useState(false),
47
47
  _useState2 = _slicedToArray(_useState, 2),
48
48
  open = _useState2[0],
@@ -108,7 +108,8 @@ export function FinalFormInput(_ref) {
108
108
  },
109
109
  originalText: input.value,
110
110
  translatedText: pendingTranslation,
111
- onApplyTranslation: input.onChange
111
+ onApplyTranslation: input.onChange,
112
+ multiline: props.multiline
112
113
  })]
113
114
  });
114
115
  }