@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.
- package/lib/common/DeleteDialog.d.ts +1 -0
- package/lib/common/DeleteDialog.d.ts.map +1 -1
- package/lib/common/DeleteDialog.js +8 -1
- package/lib/common/buttons/clearinput/ClearInputButton.js +1 -1
- package/lib/common/toolbar/__stories__/DataGridToolbar.stories.js +76 -0
- package/lib/common/toolbar/__stories__/Toolbar.stories.js +82 -0
- package/lib/dataGrid/__stories__/ClickableRows.stories.js +109 -0
- package/lib/dataGrid/__stories__/CrudMoreActionsMenu.stories.js +50 -0
- package/lib/dataGrid/__stories__/DataGrid.stories.js +94 -0
- package/lib/dataGrid/__stories__/DataGridSingleSelectFilter.stories.js +492 -0
- package/lib/form/__stories__/AsyncAutocompleteField.stories.js +660 -0
- package/lib/form/__stories__/AsyncSelectField.stories.js +513 -0
- package/lib/form/__stories__/Autocomplete.stories.js +188 -0
- package/lib/form/__stories__/AutocompleteField.stories.js +48 -0
- package/lib/form/__stories__/Checkbox.stories.js +70 -0
- package/lib/form/__stories__/CheckboxField.stories.js +87 -0
- package/lib/form/__stories__/CheckboxListField.stories.js +172 -0
- package/lib/form/__stories__/CustomButtons.stories.js +78 -0
- package/lib/form/__stories__/DependentAsyncSelects.stories.js +91 -0
- package/lib/form/__stories__/DisableAutoNavigation.stories.js +132 -0
- package/lib/form/__stories__/DisabledSubmitIfNotDirty.stories.js +54 -0
- package/lib/form/__stories__/FieldContainer.stories.js +87 -0
- package/lib/form/__stories__/FinalFormFileSelect.stories.js +155 -0
- package/lib/form/__stories__/FormInStack.stories.js +133 -0
- package/lib/form/__stories__/FormLayouts.stories.js +174 -0
- package/lib/form/__stories__/FormValidation.stories.js +82 -0
- package/lib/form/__stories__/Input.stories.js +37 -0
- package/lib/form/__stories__/NumberField.stories.js +38 -0
- package/lib/form/__stories__/Radio.stories.js +101 -0
- package/lib/form/__stories__/RadioGroupField.stories.js +172 -0
- package/lib/form/__stories__/RangeInput.stories.js +239 -0
- package/lib/form/__stories__/RouterTabs.stories.js +96 -0
- package/lib/form/__stories__/RouterTabsInForm.stories.js +73 -0
- package/lib/form/__stories__/RouterTabsInFormWithSubroutes.stories.js +96 -0
- package/lib/form/__stories__/ScrollToErrorField.stories.js +82 -0
- package/lib/form/__stories__/SearchField.stories.js +38 -0
- package/lib/form/__stories__/Select.stories.js +187 -0
- package/lib/form/__stories__/SelectField.stories.js +100 -0
- package/lib/form/__stories__/ShowErrorStrategies.stories.js +107 -0
- package/lib/form/__stories__/SingleTextField.stories.js +108 -0
- package/lib/form/__stories__/StackInForm.stories.js +53 -0
- package/lib/form/__stories__/SubmitErrors.stories.js +90 -0
- package/lib/form/__stories__/Switch.stories.js +49 -0
- package/lib/form/__stories__/SwitchField.stories.js +87 -0
- package/lib/form/__stories__/Tabs.stories.js +78 -0
- package/lib/form/__stories__/TextAreaField.stories.js +38 -0
- package/lib/form/__stories__/TextField.stories.js +67 -0
- package/lib/form/__stories__/ToggleButtonGroupField.stories.js +312 -0
- package/lib/form/__stories__/TwoLevelValidation.stories.js +168 -0
- package/lib/form/__stories__/Typography.stories.js +71 -0
- package/lib/form/file/__stories__/FileDropzone.stories.js +81 -0
- package/lib/form/file/__stories__/FileSelect.stories.js +139 -0
- package/lib/form/file/__stories__/FileSelectListItem.stories.js +108 -0
- package/lib/form/file/__stories__/FileSelectMultipleExamples.stories.js +187 -0
- package/lib/helpers/useTopOffset.js +1 -1
- package/lib/tabs/__stories__/DynamicTabs.stories.js +84 -0
- package/lib/tabs/__stories__/NestedStackSwitchWithRouterTabs.stories.js +84 -0
- package/lib/tabs/__stories__/OverflowIssues.stories.js +224 -0
- package/lib/tabs/__stories__/RouterTabs.stories.js +31 -0
- package/lib/tabs/__stories__/RouterTabsInStack.stories.js +74 -0
- package/lib/tabs/__stories__/RouterTabsInSubroute.stories.js +68 -0
- package/lib/tabs/__stories__/Tabs.stories.js +219 -0
- package/lib/theme/componentsTheme/MuiDataGrid.js +1 -1
- package/package.json +13 -13
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
+
import { RouterTab, RouterTabs, Stack, StackPage, StackSwitch } from "@comet/admin";
|
|
8
|
+
import { useEffect, useRef, useState } from "react";
|
|
9
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
var mountCount = {};
|
|
11
|
+
function RenderCount(props) {
|
|
12
|
+
useEffect(function () {
|
|
13
|
+
mountCount[props.name] = (mountCount[props.name] || 0) + 1;
|
|
14
|
+
}, [props.name]);
|
|
15
|
+
var renderCount = useRef(0);
|
|
16
|
+
renderCount.current++;
|
|
17
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
18
|
+
children: ["Render count ", props.name, ": ", renderCount.current]
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function PrintMountCount() {
|
|
22
|
+
var _useState = useState(0),
|
|
23
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
24
|
+
rerender = _useState2[1];
|
|
25
|
+
useEffect(function () {
|
|
26
|
+
var timer = setInterval(function () {
|
|
27
|
+
rerender(new Date().getTime());
|
|
28
|
+
}, 100);
|
|
29
|
+
return function () {
|
|
30
|
+
return clearInterval(timer);
|
|
31
|
+
};
|
|
32
|
+
}, []);
|
|
33
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
34
|
+
children: ["Mount count: ", JSON.stringify(mountCount)]
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
export default {
|
|
38
|
+
title: "components/tabs/RouterTabs in Stack"
|
|
39
|
+
};
|
|
40
|
+
export var RouterTabsInStack = {
|
|
41
|
+
render: function render() {
|
|
42
|
+
return /*#__PURE__*/_jsxs(Stack, {
|
|
43
|
+
topLevelTitle: "Nested Stack",
|
|
44
|
+
children: [/*#__PURE__*/_jsx(PrintMountCount, {}), /*#__PURE__*/_jsxs(StackSwitch, {
|
|
45
|
+
children: [/*#__PURE__*/_jsxs(StackPage, {
|
|
46
|
+
name: "xxx",
|
|
47
|
+
children: [/*#__PURE__*/_jsx(RenderCount, {
|
|
48
|
+
name: "StackPage"
|
|
49
|
+
}), /*#__PURE__*/_jsxs(RouterTabs, {
|
|
50
|
+
children: [/*#__PURE__*/_jsxs(RouterTab, {
|
|
51
|
+
label: "Foo",
|
|
52
|
+
path: "",
|
|
53
|
+
forceRender: true,
|
|
54
|
+
children: ["Foo", /*#__PURE__*/_jsx(RenderCount, {
|
|
55
|
+
name: "Foo"
|
|
56
|
+
})]
|
|
57
|
+
}), /*#__PURE__*/_jsxs(RouterTab, {
|
|
58
|
+
label: "Bar",
|
|
59
|
+
path: "/bar",
|
|
60
|
+
forceRender: true,
|
|
61
|
+
children: ["Bar", /*#__PURE__*/_jsx(RenderCount, {
|
|
62
|
+
name: "Bar"
|
|
63
|
+
})]
|
|
64
|
+
})]
|
|
65
|
+
})]
|
|
66
|
+
}), /*#__PURE__*/_jsx(StackPage, {
|
|
67
|
+
name: "yyy",
|
|
68
|
+
children: "yyy"
|
|
69
|
+
})]
|
|
70
|
+
})]
|
|
71
|
+
});
|
|
72
|
+
},
|
|
73
|
+
name: "RouterTabs in Stack"
|
|
74
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
+
import { RouterTab, RouterTabs, SubRoute } from "@comet/admin";
|
|
8
|
+
import { useEffect, useState } from "react";
|
|
9
|
+
import { Redirect, Route, Switch, useLocation, useRouteMatch } from "react-router";
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
|
+
function Story() {
|
|
12
|
+
var match = useRouteMatch();
|
|
13
|
+
return /*#__PURE__*/_jsx("div", {
|
|
14
|
+
children: /*#__PURE__*/_jsx(SubRoute, {
|
|
15
|
+
path: "".concat(match.url, "/cmp1"),
|
|
16
|
+
children: /*#__PURE__*/_jsxs(RouterTabs, {
|
|
17
|
+
children: [/*#__PURE__*/_jsx(RouterTab, {
|
|
18
|
+
label: "Tab 1",
|
|
19
|
+
path: "",
|
|
20
|
+
children: "Tab 1 Content"
|
|
21
|
+
}), /*#__PURE__*/_jsx(RouterTab, {
|
|
22
|
+
label: "Tab 2",
|
|
23
|
+
path: "/form2",
|
|
24
|
+
children: "Tab 2 Content"
|
|
25
|
+
})]
|
|
26
|
+
})
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function Path() {
|
|
31
|
+
var location = useLocation();
|
|
32
|
+
var _useState = useState(0),
|
|
33
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
34
|
+
rerender = _useState2[1];
|
|
35
|
+
useEffect(function () {
|
|
36
|
+
var timer = setTimeout(function () {
|
|
37
|
+
rerender(new Date().getTime());
|
|
38
|
+
}, 1000);
|
|
39
|
+
return function () {
|
|
40
|
+
return clearTimeout(timer);
|
|
41
|
+
};
|
|
42
|
+
}, []);
|
|
43
|
+
return /*#__PURE__*/_jsx("div", {
|
|
44
|
+
children: location.pathname
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
export default {
|
|
48
|
+
title: "components/tabs/RouterTabs in SubRoute"
|
|
49
|
+
};
|
|
50
|
+
export var RouterTabsInSubRoute = {
|
|
51
|
+
render: function render() {
|
|
52
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
53
|
+
children: [/*#__PURE__*/_jsx(Path, {}), /*#__PURE__*/_jsxs(Switch, {
|
|
54
|
+
children: [/*#__PURE__*/_jsx(Route, {
|
|
55
|
+
exact: true,
|
|
56
|
+
path: "/",
|
|
57
|
+
children: /*#__PURE__*/_jsx(Redirect, {
|
|
58
|
+
to: "/foo"
|
|
59
|
+
})
|
|
60
|
+
}), /*#__PURE__*/_jsx(Route, {
|
|
61
|
+
path: "/foo",
|
|
62
|
+
children: /*#__PURE__*/_jsx(Story, {})
|
|
63
|
+
})]
|
|
64
|
+
})]
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
name: "Router Tabs in SubRoute"
|
|
68
|
+
};
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
var _excluded = ["pristine", "dirty", "hasValidationErrors", "submitting", "hasSubmitErrors", "handleSubmit"],
|
|
2
|
+
_excluded2 = ["pristine", "dirty", "hasValidationErrors", "submitting", "hasSubmitErrors", "handleSubmit"];
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
import { Field, FillSpace, FinalForm, FinalFormInput, FinalFormSaveButton, Tab, Tabs, Toolbar, ToolbarActions, ToolbarBackButton } from "@comet/admin";
|
|
6
|
+
import { Card, CardContent } from "@mui/material";
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
8
|
+
export default {
|
|
9
|
+
title: "components/tabs/Tabs"
|
|
10
|
+
};
|
|
11
|
+
export var Basic = function Basic() {
|
|
12
|
+
return /*#__PURE__*/_jsxs(Tabs, {
|
|
13
|
+
children: [/*#__PURE__*/_jsx(Tab, {
|
|
14
|
+
label: "Label One",
|
|
15
|
+
children: "Content One"
|
|
16
|
+
}), /*#__PURE__*/_jsx(Tab, {
|
|
17
|
+
label: "Label Two",
|
|
18
|
+
children: "Content Two"
|
|
19
|
+
}), /*#__PURE__*/_jsx(Tab, {
|
|
20
|
+
label: "Label Three",
|
|
21
|
+
children: "Content Three"
|
|
22
|
+
})]
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
export var TabsInFormWithForceRender = {
|
|
26
|
+
render: function render() {
|
|
27
|
+
return /*#__PURE__*/_jsx("div", {
|
|
28
|
+
children: /*#__PURE__*/_jsx(FinalForm, {
|
|
29
|
+
mode: "edit",
|
|
30
|
+
onSubmit: function onSubmit(values) {
|
|
31
|
+
alert(JSON.stringify(values));
|
|
32
|
+
},
|
|
33
|
+
initialValues: {
|
|
34
|
+
foo: "foo",
|
|
35
|
+
bar: "bar"
|
|
36
|
+
},
|
|
37
|
+
children: function children(_ref) {
|
|
38
|
+
var pristine = _ref.pristine,
|
|
39
|
+
dirty = _ref.dirty,
|
|
40
|
+
hasValidationErrors = _ref.hasValidationErrors,
|
|
41
|
+
submitting = _ref.submitting,
|
|
42
|
+
hasSubmitErrors = _ref.hasSubmitErrors,
|
|
43
|
+
handleSubmit = _ref.handleSubmit,
|
|
44
|
+
formVars = _objectWithoutProperties(_ref, _excluded);
|
|
45
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
46
|
+
children: ["Pristine: ", String(pristine), " ", /*#__PURE__*/_jsx("br", {}), "Dirty: ", String(dirty), /*#__PURE__*/_jsxs(Toolbar, {
|
|
47
|
+
children: [/*#__PURE__*/_jsx(ToolbarBackButton, {}), /*#__PURE__*/_jsx(FillSpace, {}), /*#__PURE__*/_jsx(ToolbarActions, {
|
|
48
|
+
children: /*#__PURE__*/_jsx(FinalFormSaveButton, {})
|
|
49
|
+
})]
|
|
50
|
+
}), /*#__PURE__*/_jsxs(Tabs, {
|
|
51
|
+
children: [/*#__PURE__*/_jsx(Tab, {
|
|
52
|
+
label: "Tab 1",
|
|
53
|
+
forceRender: true,
|
|
54
|
+
children: /*#__PURE__*/_jsx(Card, {
|
|
55
|
+
variant: "outlined",
|
|
56
|
+
children: /*#__PURE__*/_jsx(CardContent, {
|
|
57
|
+
children: /*#__PURE__*/_jsx(Field, {
|
|
58
|
+
label: "Foo",
|
|
59
|
+
name: "foo",
|
|
60
|
+
component: FinalFormInput
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
})
|
|
64
|
+
}), /*#__PURE__*/_jsx(Tab, {
|
|
65
|
+
label: "Tab 2",
|
|
66
|
+
forceRender: true,
|
|
67
|
+
children: /*#__PURE__*/_jsx(Card, {
|
|
68
|
+
variant: "outlined",
|
|
69
|
+
children: /*#__PURE__*/_jsx(CardContent, {
|
|
70
|
+
children: /*#__PURE__*/_jsx(Field, {
|
|
71
|
+
label: "Bar",
|
|
72
|
+
name: "bar",
|
|
73
|
+
component: FinalFormInput
|
|
74
|
+
})
|
|
75
|
+
})
|
|
76
|
+
})
|
|
77
|
+
})]
|
|
78
|
+
})]
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
});
|
|
83
|
+
},
|
|
84
|
+
name: "Tabs in Form with forceRender"
|
|
85
|
+
};
|
|
86
|
+
export var TabsInFormWithoutForceRender = {
|
|
87
|
+
render: function render() {
|
|
88
|
+
// !!!!!!!! Note: This example is how NOT to do it !!!!!!!!
|
|
89
|
+
return /*#__PURE__*/_jsx("div", {
|
|
90
|
+
children: /*#__PURE__*/_jsx(FinalForm, {
|
|
91
|
+
mode: "edit",
|
|
92
|
+
onSubmit: function onSubmit(values) {
|
|
93
|
+
alert(JSON.stringify(values));
|
|
94
|
+
},
|
|
95
|
+
initialValues: {
|
|
96
|
+
foo: "foo",
|
|
97
|
+
bar: "bar"
|
|
98
|
+
},
|
|
99
|
+
children: function children(_ref2) {
|
|
100
|
+
var pristine = _ref2.pristine,
|
|
101
|
+
dirty = _ref2.dirty,
|
|
102
|
+
hasValidationErrors = _ref2.hasValidationErrors,
|
|
103
|
+
submitting = _ref2.submitting,
|
|
104
|
+
hasSubmitErrors = _ref2.hasSubmitErrors,
|
|
105
|
+
handleSubmit = _ref2.handleSubmit,
|
|
106
|
+
formVars = _objectWithoutProperties(_ref2, _excluded2);
|
|
107
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
108
|
+
children: ["Pristine: ", String(pristine), " ", /*#__PURE__*/_jsx("br", {}), "Dirty: ", String(dirty), /*#__PURE__*/_jsxs(Toolbar, {
|
|
109
|
+
children: [/*#__PURE__*/_jsx(ToolbarBackButton, {}), /*#__PURE__*/_jsx(FillSpace, {}), /*#__PURE__*/_jsx(ToolbarActions, {
|
|
110
|
+
children: /*#__PURE__*/_jsx(FinalFormSaveButton, {})
|
|
111
|
+
})]
|
|
112
|
+
}), /*#__PURE__*/_jsxs(Tabs, {
|
|
113
|
+
children: [/*#__PURE__*/_jsx(Tab, {
|
|
114
|
+
label: "Tab 1",
|
|
115
|
+
children: /*#__PURE__*/_jsx(Card, {
|
|
116
|
+
variant: "outlined",
|
|
117
|
+
children: /*#__PURE__*/_jsx(CardContent, {
|
|
118
|
+
children: /*#__PURE__*/_jsx(Field, {
|
|
119
|
+
label: "Foo",
|
|
120
|
+
name: "foo",
|
|
121
|
+
component: FinalFormInput
|
|
122
|
+
})
|
|
123
|
+
})
|
|
124
|
+
})
|
|
125
|
+
}), /*#__PURE__*/_jsx(Tab, {
|
|
126
|
+
label: "Tab 2",
|
|
127
|
+
children: /*#__PURE__*/_jsx(Card, {
|
|
128
|
+
variant: "outlined",
|
|
129
|
+
children: /*#__PURE__*/_jsx(CardContent, {
|
|
130
|
+
children: /*#__PURE__*/_jsx(Field, {
|
|
131
|
+
label: "Bar",
|
|
132
|
+
name: "bar",
|
|
133
|
+
component: FinalFormInput
|
|
134
|
+
})
|
|
135
|
+
})
|
|
136
|
+
})
|
|
137
|
+
})]
|
|
138
|
+
})]
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
})
|
|
142
|
+
});
|
|
143
|
+
},
|
|
144
|
+
name: "Tabs in Form without forceRender"
|
|
145
|
+
};
|
|
146
|
+
export var FormInTabsWithForceRender = {
|
|
147
|
+
render: function render() {
|
|
148
|
+
return /*#__PURE__*/_jsx("div", {
|
|
149
|
+
children: /*#__PURE__*/_jsxs(Tabs, {
|
|
150
|
+
children: [/*#__PURE__*/_jsx(Tab, {
|
|
151
|
+
label: "Form",
|
|
152
|
+
forceRender: true,
|
|
153
|
+
children: /*#__PURE__*/_jsx(Card, {
|
|
154
|
+
variant: "outlined",
|
|
155
|
+
children: /*#__PURE__*/_jsx(CardContent, {
|
|
156
|
+
children: /*#__PURE__*/_jsx(FinalForm, {
|
|
157
|
+
mode: "add",
|
|
158
|
+
onSubmit: function onSubmit(values) {
|
|
159
|
+
alert(JSON.stringify(values));
|
|
160
|
+
},
|
|
161
|
+
children: /*#__PURE__*/_jsx(Field, {
|
|
162
|
+
label: "Name",
|
|
163
|
+
name: "name",
|
|
164
|
+
component: FinalFormInput
|
|
165
|
+
})
|
|
166
|
+
})
|
|
167
|
+
})
|
|
168
|
+
})
|
|
169
|
+
}), /*#__PURE__*/_jsx(Tab, {
|
|
170
|
+
label: "Tab 2",
|
|
171
|
+
children: /*#__PURE__*/_jsx(Card, {
|
|
172
|
+
variant: "outlined",
|
|
173
|
+
children: /*#__PURE__*/_jsx(CardContent, {
|
|
174
|
+
children: "Tab 2"
|
|
175
|
+
})
|
|
176
|
+
})
|
|
177
|
+
})]
|
|
178
|
+
})
|
|
179
|
+
});
|
|
180
|
+
},
|
|
181
|
+
name: "Form in Tabs with forceRender"
|
|
182
|
+
};
|
|
183
|
+
export var FormInTabsWithoutForceRender = {
|
|
184
|
+
render: function render() {
|
|
185
|
+
// !!!!!!!! Note: This example is how NOT to do it !!!!!!!!
|
|
186
|
+
return /*#__PURE__*/_jsx("div", {
|
|
187
|
+
children: /*#__PURE__*/_jsxs(Tabs, {
|
|
188
|
+
children: [/*#__PURE__*/_jsx(Tab, {
|
|
189
|
+
label: "Form",
|
|
190
|
+
children: /*#__PURE__*/_jsx(Card, {
|
|
191
|
+
variant: "outlined",
|
|
192
|
+
children: /*#__PURE__*/_jsx(CardContent, {
|
|
193
|
+
children: /*#__PURE__*/_jsx(FinalForm, {
|
|
194
|
+
mode: "add",
|
|
195
|
+
onSubmit: function onSubmit(values) {
|
|
196
|
+
alert(JSON.stringify(values));
|
|
197
|
+
},
|
|
198
|
+
children: /*#__PURE__*/_jsx(Field, {
|
|
199
|
+
label: "Name",
|
|
200
|
+
name: "name",
|
|
201
|
+
component: FinalFormInput
|
|
202
|
+
})
|
|
203
|
+
})
|
|
204
|
+
})
|
|
205
|
+
})
|
|
206
|
+
}), /*#__PURE__*/_jsx(Tab, {
|
|
207
|
+
label: "Tab 2",
|
|
208
|
+
children: /*#__PURE__*/_jsx(Card, {
|
|
209
|
+
variant: "outlined",
|
|
210
|
+
children: /*#__PURE__*/_jsx(CardContent, {
|
|
211
|
+
children: "Tab 2"
|
|
212
|
+
})
|
|
213
|
+
})
|
|
214
|
+
})]
|
|
215
|
+
})
|
|
216
|
+
});
|
|
217
|
+
},
|
|
218
|
+
name: "Form in Tabs without forceRender"
|
|
219
|
+
};
|
|
@@ -227,7 +227,7 @@ export var getMuiDataGrid = function getMuiDataGrid(component, _ref) {
|
|
|
227
227
|
paddingBottom: spacing(2),
|
|
228
228
|
marginBottom: spacing(2),
|
|
229
229
|
borderBottomColor: palette.grey[50]
|
|
230
|
-
})), "&:first-
|
|
230
|
+
})), "&:first-of-type .".concat(gridClasses.filterFormLogicOperatorInput), {
|
|
231
231
|
// The first "Operator"-select is fully hidden by default when there is only one filter.
|
|
232
232
|
// Setting `display: block` makes sure it takes up it's space as if it were visible to prevent the alignment from breaking.
|
|
233
233
|
// Even though `display: block` is set now, it's still not visible, due to it's default styling of `visibility: hidden`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comet/admin",
|
|
3
|
-
"version": "9.0.0-beta.
|
|
3
|
+
"version": "9.0.0-beta.5",
|
|
4
4
|
"description": "Comet Admin package",
|
|
5
5
|
"repository": {
|
|
6
6
|
"directory": "packages/admin/admin",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@mui/utils": "^7.3.11",
|
|
24
|
-
"date-fns": "^4.1
|
|
24
|
+
"date-fns": "^4.2.1",
|
|
25
25
|
"exceljs": "^4.4.0",
|
|
26
26
|
"final-form-set-field-data": "^1.0.2",
|
|
27
27
|
"http-status-codes": "^2.3.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"react-dropzone": "^14.3.8",
|
|
33
33
|
"use-constant": "^2.0.0",
|
|
34
34
|
"uuid": "^11.1.1",
|
|
35
|
-
"@comet/admin-icons": "9.0.0-beta.
|
|
35
|
+
"@comet/admin-icons": "9.0.0-beta.5"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@apollo/client": "^3.14.1",
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"@emotion/styled": "^11.14.1",
|
|
43
43
|
"@mui/material": "^7.3.11",
|
|
44
44
|
"@mui/system": "^7.3.11",
|
|
45
|
-
"@mui/x-data-grid": "^8.28.
|
|
46
|
-
"@mui/x-data-grid-premium": "^8.28.
|
|
47
|
-
"@mui/x-data-grid-pro": "^8.28.
|
|
48
|
-
"@mui/x-date-pickers": "^8.28.
|
|
49
|
-
"@mui/x-date-pickers-pro": "^8.28.
|
|
45
|
+
"@mui/x-data-grid": "^8.28.7",
|
|
46
|
+
"@mui/x-data-grid-premium": "^8.28.7",
|
|
47
|
+
"@mui/x-data-grid-pro": "^8.28.7",
|
|
48
|
+
"@mui/x-date-pickers": "^8.28.7",
|
|
49
|
+
"@mui/x-date-pickers-pro": "^8.28.7",
|
|
50
50
|
"@storybook/addon-docs": "^10.3.5",
|
|
51
51
|
"@storybook/react-vite": "^10.3.5",
|
|
52
52
|
"@testing-library/dom": "^10.4.1",
|
|
@@ -58,14 +58,14 @@
|
|
|
58
58
|
"@types/lodash.debounce": "^4.0.9",
|
|
59
59
|
"@types/lodash.isequal": "^4.5.8",
|
|
60
60
|
"@types/node": "^24.12.4",
|
|
61
|
-
"@types/react": "^19.2.
|
|
61
|
+
"@types/react": "^19.2.15",
|
|
62
62
|
"@types/react-dom": "^19.2.3",
|
|
63
63
|
"@types/react-router": "^5.1.20",
|
|
64
64
|
"@types/react-router-dom": "^5.3.3",
|
|
65
65
|
"eslint": "^9.39.4",
|
|
66
66
|
"eslint-plugin-storybook": "^10.3.5",
|
|
67
67
|
"final-form": "^4.20.10",
|
|
68
|
-
"graphql": "^16.
|
|
68
|
+
"graphql": "^16.14.0",
|
|
69
69
|
"history": "^4.10.1",
|
|
70
70
|
"jsdom": "^28.1.0",
|
|
71
71
|
"msw": "^2.10.4",
|
|
@@ -84,9 +84,9 @@
|
|
|
84
84
|
"typescript": "^5.9.3",
|
|
85
85
|
"vite-tsconfig-paths": "^6.0.4",
|
|
86
86
|
"vitest": "^4.0.16",
|
|
87
|
-
"@comet/admin-babel-preset": "9.0.0-beta.
|
|
88
|
-
"@comet/eslint-config": "9.0.0-beta.
|
|
89
|
-
"@comet/eslint-plugin": "9.0.0-beta.
|
|
87
|
+
"@comet/admin-babel-preset": "9.0.0-beta.5",
|
|
88
|
+
"@comet/eslint-config": "9.0.0-beta.5",
|
|
89
|
+
"@comet/eslint-plugin": "9.0.0-beta.5"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
92
|
"@apollo/client": "^3.7.0",
|