@comet/admin 9.0.0-beta.4 → 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 (64) 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/buttons/clearinput/ClearInputButton.js +1 -1
  5. package/lib/common/toolbar/__stories__/DataGridToolbar.stories.js +76 -0
  6. package/lib/common/toolbar/__stories__/Toolbar.stories.js +82 -0
  7. package/lib/dataGrid/__stories__/ClickableRows.stories.js +109 -0
  8. package/lib/dataGrid/__stories__/CrudMoreActionsMenu.stories.js +50 -0
  9. package/lib/dataGrid/__stories__/DataGrid.stories.js +94 -0
  10. package/lib/dataGrid/__stories__/DataGridSingleSelectFilter.stories.js +492 -0
  11. package/lib/form/__stories__/AsyncAutocompleteField.stories.js +660 -0
  12. package/lib/form/__stories__/AsyncSelectField.stories.js +513 -0
  13. package/lib/form/__stories__/Autocomplete.stories.js +188 -0
  14. package/lib/form/__stories__/AutocompleteField.stories.js +48 -0
  15. package/lib/form/__stories__/Checkbox.stories.js +70 -0
  16. package/lib/form/__stories__/CheckboxField.stories.js +87 -0
  17. package/lib/form/__stories__/CheckboxListField.stories.js +172 -0
  18. package/lib/form/__stories__/CustomButtons.stories.js +78 -0
  19. package/lib/form/__stories__/DependentAsyncSelects.stories.js +91 -0
  20. package/lib/form/__stories__/DisableAutoNavigation.stories.js +132 -0
  21. package/lib/form/__stories__/DisabledSubmitIfNotDirty.stories.js +54 -0
  22. package/lib/form/__stories__/FieldContainer.stories.js +87 -0
  23. package/lib/form/__stories__/FinalFormFileSelect.stories.js +155 -0
  24. package/lib/form/__stories__/FormInStack.stories.js +133 -0
  25. package/lib/form/__stories__/FormLayouts.stories.js +174 -0
  26. package/lib/form/__stories__/FormValidation.stories.js +82 -0
  27. package/lib/form/__stories__/Input.stories.js +37 -0
  28. package/lib/form/__stories__/NumberField.stories.js +38 -0
  29. package/lib/form/__stories__/Radio.stories.js +101 -0
  30. package/lib/form/__stories__/RadioGroupField.stories.js +172 -0
  31. package/lib/form/__stories__/RangeInput.stories.js +239 -0
  32. package/lib/form/__stories__/RouterTabs.stories.js +96 -0
  33. package/lib/form/__stories__/RouterTabsInForm.stories.js +73 -0
  34. package/lib/form/__stories__/RouterTabsInFormWithSubroutes.stories.js +96 -0
  35. package/lib/form/__stories__/ScrollToErrorField.stories.js +82 -0
  36. package/lib/form/__stories__/SearchField.stories.js +38 -0
  37. package/lib/form/__stories__/Select.stories.js +187 -0
  38. package/lib/form/__stories__/SelectField.stories.js +100 -0
  39. package/lib/form/__stories__/ShowErrorStrategies.stories.js +107 -0
  40. package/lib/form/__stories__/SingleTextField.stories.js +108 -0
  41. package/lib/form/__stories__/StackInForm.stories.js +53 -0
  42. package/lib/form/__stories__/SubmitErrors.stories.js +90 -0
  43. package/lib/form/__stories__/Switch.stories.js +49 -0
  44. package/lib/form/__stories__/SwitchField.stories.js +87 -0
  45. package/lib/form/__stories__/Tabs.stories.js +78 -0
  46. package/lib/form/__stories__/TextAreaField.stories.js +38 -0
  47. package/lib/form/__stories__/TextField.stories.js +67 -0
  48. package/lib/form/__stories__/ToggleButtonGroupField.stories.js +312 -0
  49. package/lib/form/__stories__/TwoLevelValidation.stories.js +168 -0
  50. package/lib/form/__stories__/Typography.stories.js +71 -0
  51. package/lib/form/file/__stories__/FileDropzone.stories.js +81 -0
  52. package/lib/form/file/__stories__/FileSelect.stories.js +139 -0
  53. package/lib/form/file/__stories__/FileSelectListItem.stories.js +108 -0
  54. package/lib/form/file/__stories__/FileSelectMultipleExamples.stories.js +187 -0
  55. package/lib/helpers/useTopOffset.js +1 -1
  56. package/lib/tabs/__stories__/DynamicTabs.stories.js +84 -0
  57. package/lib/tabs/__stories__/NestedStackSwitchWithRouterTabs.stories.js +84 -0
  58. package/lib/tabs/__stories__/OverflowIssues.stories.js +224 -0
  59. package/lib/tabs/__stories__/RouterTabs.stories.js +31 -0
  60. package/lib/tabs/__stories__/RouterTabsInStack.stories.js +74 -0
  61. package/lib/tabs/__stories__/RouterTabsInSubroute.stories.js +68 -0
  62. package/lib/tabs/__stories__/Tabs.stories.js +219 -0
  63. package/lib/theme/componentsTheme/MuiDataGrid.js +1 -1
  64. package/package.json +13 -13
@@ -0,0 +1,513 @@
1
+ var _templateObject;
2
+ function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
3
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
4
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
5
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
6
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
7
+ import { gql, useApolloClient } from "@apollo/client";
8
+ import { Info, WarningSolid } from "@comet/admin-icons";
9
+ import { Alert } from "../../alert/Alert";
10
+ import { FinalForm } from "../../FinalForm";
11
+ import { AsyncSelectField } from "../../form/fields/AsyncSelectField";
12
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
+ var config = {
14
+ component: AsyncSelectField,
15
+ title: "components/form/AsyncSelectField"
16
+ };
17
+ export default config;
18
+
19
+ /**
20
+ * This story demonstrates the usage of the AsyncSelectField component.
21
+ *
22
+ * Options are fake loaded with a delay and returned as an array of strings.
23
+ */
24
+ export var SimpleList = {
25
+ render: function render() {
26
+ return /*#__PURE__*/_jsx(FinalForm, {
27
+ initialValues: {
28
+ type: "value-1"
29
+ },
30
+ mode: "edit",
31
+ onSubmit: function onSubmit() {
32
+ // not handled
33
+ },
34
+ subscription: {
35
+ values: true
36
+ },
37
+ children: function children(_ref) {
38
+ var values = _ref.values;
39
+ return /*#__PURE__*/_jsxs(_Fragment, {
40
+ children: [/*#__PURE__*/_jsx(AsyncSelectField, {
41
+ loadOptions: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
42
+ return _regenerator().w(function (_context) {
43
+ while (1) switch (_context.n) {
44
+ case 0:
45
+ _context.n = 1;
46
+ return new Promise(function (resolve) {
47
+ return setTimeout(resolve, 200);
48
+ });
49
+ case 1:
50
+ return _context.a(2, ["value-1", "value-2", "value-3", "value-4"]);
51
+ }
52
+ }, _callee);
53
+ })),
54
+ getOptionLabel: function getOptionLabel(option) {
55
+ return option;
56
+ },
57
+ name: "type",
58
+ label: "AsyncSelectField",
59
+ fullWidth: true,
60
+ variant: "horizontal"
61
+ }), /*#__PURE__*/_jsx(Alert, {
62
+ title: "FormState",
63
+ children: /*#__PURE__*/_jsx("pre", {
64
+ children: JSON.stringify(values, null, 2)
65
+ })
66
+ })]
67
+ });
68
+ }
69
+ });
70
+ }
71
+ };
72
+
73
+ /**
74
+ * This story demonstrates the usage of the AsyncSelectField component where the options are loaded as objects.
75
+ *
76
+ * The options are loaded as objects, the visual representation must be extracted inside the getOptionLabel function.
77
+ */
78
+ export var WithObjectOptions = {
79
+ render: function render() {
80
+ return /*#__PURE__*/_jsx(FinalForm, {
81
+ initialValues: {
82
+ type: {
83
+ id: "1",
84
+ name: "Name 1"
85
+ }
86
+ },
87
+ mode: "edit",
88
+ onSubmit: function onSubmit() {
89
+ // not handled
90
+ },
91
+ subscription: {
92
+ values: true
93
+ },
94
+ children: function children(_ref3) {
95
+ var values = _ref3.values;
96
+ return /*#__PURE__*/_jsxs(_Fragment, {
97
+ children: [/*#__PURE__*/_jsx(AsyncSelectField, {
98
+ loadOptions: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
99
+ return _regenerator().w(function (_context2) {
100
+ while (1) switch (_context2.n) {
101
+ case 0:
102
+ _context2.n = 1;
103
+ return new Promise(function (resolve) {
104
+ return setTimeout(resolve, 200);
105
+ });
106
+ case 1:
107
+ return _context2.a(2, [{
108
+ id: "1",
109
+ name: "Name 1"
110
+ }, {
111
+ id: "2",
112
+ name: "Name 2"
113
+ }, {
114
+ id: "3",
115
+ name: "Name 3"
116
+ }, {
117
+ id: "4",
118
+ name: "Name 4"
119
+ }, {
120
+ id: "5",
121
+ name: "Name 5"
122
+ }]);
123
+ }
124
+ }, _callee2);
125
+ })),
126
+ getOptionLabel: function getOptionLabel(option) {
127
+ return option.name;
128
+ },
129
+ name: "type",
130
+ label: "AsyncSelectField",
131
+ fullWidth: true,
132
+ variant: "horizontal"
133
+ }), /*#__PURE__*/_jsx(Alert, {
134
+ title: "FormState",
135
+ children: /*#__PURE__*/_jsx("pre", {
136
+ children: JSON.stringify(values, null, 2)
137
+ })
138
+ })]
139
+ });
140
+ }
141
+ });
142
+ }
143
+ };
144
+
145
+ /**
146
+ * This story demonstrates the usage of the AsyncSelectField where the loading time got extended to visualize the loading state.
147
+ */
148
+ export var LongLoading = {
149
+ render: function render() {
150
+ return /*#__PURE__*/_jsx(FinalForm, {
151
+ initialValues: {
152
+ type: "value-1"
153
+ },
154
+ mode: "edit",
155
+ onSubmit: function onSubmit() {
156
+ // not handled
157
+ },
158
+ subscription: {
159
+ values: true
160
+ },
161
+ children: function children(_ref5) {
162
+ var values = _ref5.values;
163
+ return /*#__PURE__*/_jsxs(_Fragment, {
164
+ children: [/*#__PURE__*/_jsx(AsyncSelectField, {
165
+ loadOptions: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
166
+ return _regenerator().w(function (_context3) {
167
+ while (1) switch (_context3.n) {
168
+ case 0:
169
+ _context3.n = 1;
170
+ return new Promise(function (resolve) {
171
+ return setTimeout(resolve, 4000);
172
+ });
173
+ case 1:
174
+ return _context3.a(2, ["value-1", "value-2", "value-3", "value-4"]);
175
+ }
176
+ }, _callee3);
177
+ })),
178
+ getOptionLabel: function getOptionLabel(option) {
179
+ return option;
180
+ },
181
+ name: "type",
182
+ label: "AsyncSelectField",
183
+ fullWidth: true,
184
+ variant: "horizontal"
185
+ }), /*#__PURE__*/_jsx(Alert, {
186
+ title: "FormState",
187
+ children: /*#__PURE__*/_jsx("pre", {
188
+ children: JSON.stringify(values, null, 2)
189
+ })
190
+ })]
191
+ });
192
+ }
193
+ });
194
+ }
195
+ };
196
+
197
+ /**
198
+ * This story demonstrates the usage of the AsyncSelectField component where no options are returned.
199
+ */
200
+ export var NoOptions = {
201
+ render: function render() {
202
+ return /*#__PURE__*/_jsx(FinalForm, {
203
+ initialValues: {},
204
+ mode: "edit",
205
+ onSubmit: function onSubmit() {
206
+ // not handled
207
+ },
208
+ subscription: {
209
+ values: true
210
+ },
211
+ children: function children(_ref7) {
212
+ var values = _ref7.values;
213
+ return /*#__PURE__*/_jsxs(_Fragment, {
214
+ children: [/*#__PURE__*/_jsx(AsyncSelectField, {
215
+ loadOptions: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
216
+ return _regenerator().w(function (_context4) {
217
+ while (1) switch (_context4.n) {
218
+ case 0:
219
+ _context4.n = 1;
220
+ return new Promise(function (resolve) {
221
+ return setTimeout(resolve, 200);
222
+ });
223
+ case 1:
224
+ return _context4.a(2, []);
225
+ }
226
+ }, _callee4);
227
+ })),
228
+ getOptionLabel: function getOptionLabel(option) {
229
+ return option;
230
+ },
231
+ name: "type",
232
+ label: "AsyncSelectField",
233
+ fullWidth: true,
234
+ variant: "horizontal"
235
+ }), /*#__PURE__*/_jsx(Alert, {
236
+ title: "FormState",
237
+ children: /*#__PURE__*/_jsx("pre", {
238
+ children: JSON.stringify(values, null, 2)
239
+ })
240
+ })]
241
+ });
242
+ }
243
+ });
244
+ }
245
+ };
246
+
247
+ /**
248
+ * If no options are available, the noOptionsText function can be used to customize the label.
249
+ */
250
+ export var NoOptionsWithCustomNoOptionsText = {
251
+ render: function render() {
252
+ return /*#__PURE__*/_jsx(FinalForm, {
253
+ initialValues: {},
254
+ mode: "edit",
255
+ onSubmit: function onSubmit() {
256
+ // not handled
257
+ },
258
+ subscription: {
259
+ values: true
260
+ },
261
+ children: function children(_ref9) {
262
+ var values = _ref9.values;
263
+ return /*#__PURE__*/_jsxs(_Fragment, {
264
+ children: [/*#__PURE__*/_jsx(AsyncSelectField, {
265
+ loadOptions: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {
266
+ return _regenerator().w(function (_context5) {
267
+ while (1) switch (_context5.n) {
268
+ case 0:
269
+ _context5.n = 1;
270
+ return new Promise(function (resolve) {
271
+ return setTimeout(resolve, 200);
272
+ });
273
+ case 1:
274
+ return _context5.a(2, []);
275
+ }
276
+ }, _callee5);
277
+ })),
278
+ getOptionLabel: function getOptionLabel(option) {
279
+ return option;
280
+ },
281
+ noOptionsText: /*#__PURE__*/_jsxs("div", {
282
+ style: {
283
+ display: "flex",
284
+ alignItems: "center",
285
+ gap: "8px"
286
+ },
287
+ children: [/*#__PURE__*/_jsx(Info, {
288
+ color: "info"
289
+ }), "No options available at this point in time"]
290
+ }),
291
+ name: "type",
292
+ label: "AsyncSelectField",
293
+ fullWidth: true,
294
+ variant: "horizontal"
295
+ }), /*#__PURE__*/_jsx(Alert, {
296
+ title: "FormState",
297
+ children: /*#__PURE__*/_jsx("pre", {
298
+ children: JSON.stringify(values, null, 2)
299
+ })
300
+ })]
301
+ });
302
+ }
303
+ });
304
+ }
305
+ };
306
+
307
+ /**
308
+ * This story demonstrates the usage of the AsyncSelectField component where an error occurs while loading the options.
309
+ */
310
+ export var ErrorLoadingOptions = {
311
+ render: function render() {
312
+ return /*#__PURE__*/_jsx(FinalForm, {
313
+ initialValues: {},
314
+ mode: "edit",
315
+ onSubmit: function onSubmit() {
316
+ // not handled
317
+ },
318
+ subscription: {
319
+ values: true
320
+ },
321
+ children: function children(_ref1) {
322
+ var values = _ref1.values;
323
+ return /*#__PURE__*/_jsxs(_Fragment, {
324
+ children: [/*#__PURE__*/_jsx(AsyncSelectField, {
325
+ loadOptions: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
326
+ return _regenerator().w(function (_context6) {
327
+ while (1) switch (_context6.n) {
328
+ case 0:
329
+ _context6.n = 1;
330
+ return new Promise(function (resolve) {
331
+ return setTimeout(resolve, 500);
332
+ });
333
+ case 1:
334
+ throw Error("Error loading options");
335
+ }
336
+ }, _callee6);
337
+ })),
338
+ getOptionLabel: function getOptionLabel(option) {
339
+ return option;
340
+ },
341
+ name: "type",
342
+ label: "AsyncSelectField",
343
+ fullWidth: true,
344
+ variant: "horizontal"
345
+ }), /*#__PURE__*/_jsx(Alert, {
346
+ title: "FormState",
347
+ children: /*#__PURE__*/_jsx("pre", {
348
+ children: JSON.stringify(values, null, 2)
349
+ })
350
+ })]
351
+ });
352
+ }
353
+ });
354
+ }
355
+ };
356
+ export var ErrorLoadingOptionsWithCustomErrorText = {
357
+ render: function render() {
358
+ return /*#__PURE__*/_jsx(FinalForm, {
359
+ initialValues: {},
360
+ mode: "edit",
361
+ onSubmit: function onSubmit() {
362
+ // not handled
363
+ },
364
+ subscription: {
365
+ values: true
366
+ },
367
+ children: function children(_ref11) {
368
+ var values = _ref11.values;
369
+ return /*#__PURE__*/_jsxs(_Fragment, {
370
+ children: [/*#__PURE__*/_jsx(AsyncSelectField, {
371
+ loadOptions: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7() {
372
+ return _regenerator().w(function (_context7) {
373
+ while (1) switch (_context7.n) {
374
+ case 0:
375
+ _context7.n = 1;
376
+ return new Promise(function (resolve) {
377
+ return setTimeout(resolve, 500);
378
+ });
379
+ case 1:
380
+ throw Error("Error loading options");
381
+ }
382
+ }, _callee7);
383
+ })),
384
+ getOptionLabel: function getOptionLabel(option) {
385
+ return option;
386
+ },
387
+ errorText: /*#__PURE__*/_jsxs("div", {
388
+ style: {
389
+ display: "flex",
390
+ alignItems: "center",
391
+ gap: "8px"
392
+ },
393
+ children: [/*#__PURE__*/_jsx(WarningSolid, {
394
+ color: "error"
395
+ }), "Error loading options"]
396
+ }),
397
+ name: "type",
398
+ label: "AsyncSelectField",
399
+ fullWidth: true,
400
+ variant: "horizontal"
401
+ }), /*#__PURE__*/_jsx(Alert, {
402
+ title: "FormState",
403
+ children: /*#__PURE__*/_jsx("pre", {
404
+ children: JSON.stringify(values, null, 2)
405
+ })
406
+ })]
407
+ });
408
+ }
409
+ });
410
+ }
411
+ };
412
+
413
+ /**
414
+ * This story demonstrates the usage of the AsyncSelectField component where the options are loaded from an API
415
+ *
416
+ * This can be used when ALL options can be loaded at once.
417
+ */
418
+ export var AsyncLoadingDataFromApi = {
419
+ render: function render() {
420
+ var client = useApolloClient();
421
+ return /*#__PURE__*/_jsx(FinalForm, {
422
+ initialValues: {},
423
+ mode: "edit",
424
+ onSubmit: function onSubmit() {
425
+ // not handled
426
+ },
427
+ subscription: {
428
+ values: true
429
+ },
430
+ children: function children(_ref13) {
431
+ var values = _ref13.values;
432
+ return /*#__PURE__*/_jsxs(_Fragment, {
433
+ children: [/*#__PURE__*/_jsx(AsyncSelectField, {
434
+ loadOptions: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {
435
+ var _yield$client$query, data;
436
+ return _regenerator().w(function (_context8) {
437
+ while (1) switch (_context8.n) {
438
+ case 0:
439
+ _context8.n = 1;
440
+ return client.query({
441
+ query: gql(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n query Manufacturers {\n manufacturers {\n id\n name\n }\n }\n "])))
442
+ });
443
+ case 1:
444
+ _yield$client$query = _context8.v;
445
+ data = _yield$client$query.data;
446
+ return _context8.a(2, data.manufacturers);
447
+ }
448
+ }, _callee8);
449
+ })),
450
+ getOptionLabel: function getOptionLabel(option) {
451
+ return option.name;
452
+ },
453
+ name: "type",
454
+ label: "AsyncSelectField",
455
+ fullWidth: true,
456
+ variant: "horizontal"
457
+ }), /*#__PURE__*/_jsx(Alert, {
458
+ title: "FormState",
459
+ children: /*#__PURE__*/_jsx("pre", {
460
+ children: JSON.stringify(values, null, 2)
461
+ })
462
+ })]
463
+ });
464
+ }
465
+ });
466
+ }
467
+ };
468
+ export var MultipleWithoutInitialValues = {
469
+ render: function render() {
470
+ return /*#__PURE__*/_jsx(FinalForm, {
471
+ mode: "edit",
472
+ onSubmit: function onSubmit() {
473
+ // not handled
474
+ },
475
+ subscription: {
476
+ values: true
477
+ },
478
+ children: function children(_ref15) {
479
+ var values = _ref15.values;
480
+ return /*#__PURE__*/_jsxs(_Fragment, {
481
+ children: [/*#__PURE__*/_jsx(AsyncSelectField, {
482
+ multiple: true,
483
+ loadOptions: /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9() {
484
+ return _regenerator().w(function (_context9) {
485
+ while (1) switch (_context9.n) {
486
+ case 0:
487
+ _context9.n = 1;
488
+ return new Promise(function (resolve) {
489
+ return setTimeout(resolve, 200);
490
+ });
491
+ case 1:
492
+ return _context9.a(2, ["value-1", "value-2", "value-3", "value-4"]);
493
+ }
494
+ }, _callee9);
495
+ })),
496
+ getOptionLabel: function getOptionLabel(option) {
497
+ return option;
498
+ },
499
+ name: "type",
500
+ label: "AsyncSelectField",
501
+ fullWidth: true,
502
+ variant: "horizontal"
503
+ }), /*#__PURE__*/_jsx(Alert, {
504
+ title: "FormState",
505
+ children: /*#__PURE__*/_jsx("pre", {
506
+ children: JSON.stringify(values, null, 2)
507
+ })
508
+ })]
509
+ });
510
+ }
511
+ });
512
+ }
513
+ };