@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.
- 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/__stories__/Tooltip.stories.js +404 -0
- package/lib/common/buttons/__stories__/Button.stories.js +445 -0
- package/lib/common/buttons/clearinput/ClearInputButton.js +1 -1
- package/lib/common/buttons/delete/__stories__/DeleteButton.stories.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/error/errorHandler/ErrorHandlerProvider.d.ts +8 -0
- package/lib/error/errorHandler/ErrorHandlerProvider.d.ts.map +1 -0
- package/lib/error/errorHandler/ErrorHandlerProvider.js +16 -0
- package/lib/error/errorboundary/ErrorBoundary.d.ts.map +1 -1
- package/lib/error/errorboundary/ErrorBoundary.js +26 -18
- package/lib/form/FinalFormInput.d.ts.map +1 -1
- package/lib/form/FinalFormInput.js +3 -2
- 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/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/section/__stories__/SectionHeadline.stories.js +71 -0
- package/lib/stack/Stack.d.ts.map +1 -1
- package/lib/stack/Stack.js +3 -0
- package/lib/stack/__stories__/RouterTabsNestedStack.stories.js +51 -0
- package/lib/stack/__stories__/Stack.stories.js +14 -0
- package/lib/stack/__stories__/StackBackButton.stories.js +50 -0
- package/lib/stack/__stories__/StackBreadcrumbs.stories.js +139 -0
- package/lib/stack/__stories__/StackBreadcrumbsTabs.stories.js +47 -0
- package/lib/stack/__stories__/StackCustomSeparator.stories.js +47 -0
- package/lib/stack/__stories__/StackLink.stories.js +41 -0
- package/lib/stack/__stories__/StackNested.stories.js +58 -0
- package/lib/stack/__stories__/StackNestedOnInitialPage.stories.js +78 -0
- package/lib/stack/__stories__/StackNestedOneStack.stories.js +90 -0
- package/lib/stack/__stories__/StackPageTitle.stories.js +121 -0
- package/lib/stack/__stories__/StackReactNodeTitle.stories.js +54 -0
- package/lib/stack/__stories__/StackRefApi.stories.js +56 -0
- package/lib/stack/__stories__/StackTableFormQueryAtStack.stories.js +155 -0
- package/lib/stack/__stories__/StackTableFormQueryInTable.stories.js +160 -0
- package/lib/stack/__stories__/StackUrl.stories.js +66 -0
- 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/lib/translator/ContentTranslationServiceContext.d.ts +1 -0
- package/lib/translator/ContentTranslationServiceContext.d.ts.map +1 -1
- package/lib/translator/ContentTranslationServiceProvider.d.ts +1 -1
- package/lib/translator/ContentTranslationServiceProvider.d.ts.map +1 -1
- package/lib/translator/ContentTranslationServiceProvider.js +4 -2
- package/lib/translator/PlainTextTranslationDialog.d.ts +1 -0
- package/lib/translator/PlainTextTranslationDialog.d.ts.map +1 -1
- package/lib/translator/PlainTextTranslationDialog.js +8 -3
- package/lib/translator/__stories__/ContentTranslation.stories.js +104 -0
- package/package.json +23 -24
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
2
|
+
import { Box, Card, CardContent, SliderThumb, Typography } from "@mui/material";
|
|
3
|
+
import { styled } from "@mui/material/styles";
|
|
4
|
+
import { Form } from "react-final-form";
|
|
5
|
+
import { Button } from "../../common/buttons/Button";
|
|
6
|
+
import { ToolbarTitleItem } from "../../common/toolbar/titleitem/ToolbarTitleItem";
|
|
7
|
+
import { Toolbar } from "../../common/toolbar/Toolbar";
|
|
8
|
+
import { Field } from "../../form/Field";
|
|
9
|
+
import { FinalFormRangeInput } from "../../form/FinalFormRangeInput";
|
|
10
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
var Thumb = /*#__PURE__*/styled(SliderThumb, process.env.NODE_ENV === "production" ? {
|
|
12
|
+
target: "e7nmzrx0"
|
|
13
|
+
} : {
|
|
14
|
+
target: "e7nmzrx0",
|
|
15
|
+
label: "Thumb"
|
|
16
|
+
})(process.env.NODE_ENV === "production" ? {
|
|
17
|
+
name: "309e23",
|
|
18
|
+
styles: "&&{&:hover,&.Mui-focusVisible{box-shadow:none;}&:after{width:auto;height:auto;border-radius:0;border:solid white;border-width:0 2px 2px 0;transform:rotate(-45deg);display:inline-block;position:relative;padding:2px;content:\"\";left:-1px;top:0;}&[data-index=\"1\"]:after{transform:rotate(135deg);left:1px;}}"
|
|
19
|
+
} : {
|
|
20
|
+
name: "309e23",
|
|
21
|
+
styles: "&&{&:hover,&.Mui-focusVisible{box-shadow:none;}&:after{width:auto;height:auto;border-radius:0;border:solid white;border-width:0 2px 2px 0;transform:rotate(-45deg);display:inline-block;position:relative;padding:2px;content:\"\";left:-1px;top:0;}&[data-index=\"1\"]:after{transform:rotate(135deg);left:1px;}}/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9mb3JtL19fc3Rvcmllc19fL1JhbmdlSW5wdXQuc3Rvcmllcy50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBVWlDIiwiZmlsZSI6Ii4uLy4uLy4uL3NyYy9mb3JtL19fc3Rvcmllc19fL1JhbmdlSW5wdXQuc3Rvcmllcy50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBCb3gsIENhcmQsIENhcmRDb250ZW50LCBTbGlkZXJUaHVtYiwgVHlwb2dyYXBoeSB9IGZyb20gXCJAbXVpL21hdGVyaWFsXCI7XG5pbXBvcnQgeyBzdHlsZWQgfSBmcm9tIFwiQG11aS9tYXRlcmlhbC9zdHlsZXNcIjtcbmltcG9ydCB7IEZvcm0gfSBmcm9tIFwicmVhY3QtZmluYWwtZm9ybVwiO1xuXG5pbXBvcnQgeyBCdXR0b24gfSBmcm9tIFwiLi4vLi4vY29tbW9uL2J1dHRvbnMvQnV0dG9uXCI7XG5pbXBvcnQgeyBUb29sYmFyVGl0bGVJdGVtIH0gZnJvbSBcIi4uLy4uL2NvbW1vbi90b29sYmFyL3RpdGxlaXRlbS9Ub29sYmFyVGl0bGVJdGVtXCI7XG5pbXBvcnQgeyBUb29sYmFyIH0gZnJvbSBcIi4uLy4uL2NvbW1vbi90b29sYmFyL1Rvb2xiYXJcIjtcbmltcG9ydCB7IEZpZWxkIH0gZnJvbSBcIi4uLy4uL2Zvcm0vRmllbGRcIjtcbmltcG9ydCB7IEZpbmFsRm9ybVJhbmdlSW5wdXQgfSBmcm9tIFwiLi4vLi4vZm9ybS9GaW5hbEZvcm1SYW5nZUlucHV0XCI7XG5cbmNvbnN0IFRodW1iID0gc3R5bGVkKFNsaWRlclRodW1iKWBcbiAgICAmJiB7XG4gICAgICAgICY6aG92ZXIsXG4gICAgICAgICYuTXVpLWZvY3VzVmlzaWJsZSB7XG4gICAgICAgICAgICBib3gtc2hhZG93OiBub25lO1xuICAgICAgICB9XG5cbiAgICAgICAgJjphZnRlciB7XG4gICAgICAgICAgICB3aWR0aDogYXV0bztcbiAgICAgICAgICAgIGhlaWdodDogYXV0bztcbiAgICAgICAgICAgIGJvcmRlci1yYWRpdXM6IDA7XG4gICAgICAgICAgICBib3JkZXI6IHNvbGlkIHdoaXRlO1xuICAgICAgICAgICAgYm9yZGVyLXdpZHRoOiAwIDJweCAycHggMDtcbiAgICAgICAgICAgIHRyYW5zZm9ybTogcm90YXRlKC00NWRlZyk7XG4gICAgICAgICAgICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XG4gICAgICAgICAgICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gICAgICAgICAgICBwYWRkaW5nOiAycHg7XG4gICAgICAgICAgICBjb250ZW50OiBcIlwiO1xuICAgICAgICAgICAgbGVmdDogLTFweDtcbiAgICAgICAgICAgIHRvcDogMDtcbiAgICAgICAgfVxuXG4gICAgICAgICZbZGF0YS1pbmRleD1cIjFcIl06YWZ0ZXIge1xuICAgICAgICAgICAgdHJhbnNmb3JtOiByb3RhdGUoMTM1ZGVnKTtcbiAgICAgICAgICAgIGxlZnQ6IDFweDtcbiAgICAgICAgfVxuICAgIH1cbmA7XG5cbmV4cG9ydCBkZWZhdWx0IHtcbiAgICB0aXRsZTogXCJjb21wb25lbnRzL2Zvcm1cIixcbn07XG5cbmV4cG9ydCBjb25zdCBSYW5nZUlucHV0ID0gKCkgPT4ge1xuICAgIHJldHVybiAoXG4gICAgICAgIDw+XG4gICAgICAgICAgICA8Qm94IG1hcmdpbkJvdHRvbT17NH0+XG4gICAgICAgICAgICAgICAgPFRvb2xiYXI+XG4gICAgICAgICAgICAgICAgICAgIDxUb29sYmFyVGl0bGVJdGVtPkZpbmFsIEZvcm0gUmFuZ2UgSW5wdXQ8L1Rvb2xiYXJUaXRsZUl0ZW0+XG4gICAgICAgICAgICAgICAgPC9Ub29sYmFyPlxuICAgICAgICAgICAgPC9Cb3g+XG4gICAgICAgICAgICA8ZGl2IHN0eWxlPXt7IHdpZHRoOiA0MDAgfX0+XG4gICAgICAgICAgICAgICAgPEJveCBtYXJnaW5Cb3R0b209ezR9PlxuICAgICAgICAgICAgICAgICAgICA8Q2FyZCB2YXJpYW50PVwib3V0bGluZWRcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxDYXJkQ29udGVudD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8VHlwb2dyYXBoeSB2YXJpYW50PVwiaDNcIiBndXR0ZXJCb3R0b20+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGggaW5pdGlhbFZhbHVlc1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvVHlwb2dyYXBoeT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8Rm9ybVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvblN1Ym1pdD17KHZhbHVlcykgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdmFsdWVzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH19XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaXRpYWxWYWx1ZXM9e3sgcHJpY2U6IHsgbWluOiAwLCBtYXg6IDEwMCB9IH19XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbmRlcj17KHsgaGFuZGxlU3VibWl0LCB2YWx1ZXMsIGZvcm0sIGluaXRpYWxWYWx1ZXMgfSkgPT4gKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8RmllbGRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tcG9uZW50PXtGaW5hbEZvcm1SYW5nZUlucHV0fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lPVwicHJpY2VcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtaW49ezB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heD17MTAwfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmRBZG9ybm1lbnQ9ezxzcGFuPuKCrDwvc3Bhbj59XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNsaWRlclByb3BzPXt7IGNvbXBvbmVudHM6IHsgVGh1bWIgfSB9fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPEJ1dHRvblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrPXsoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JtLnJlc2V0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH19XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXNldFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvQnV0dG9uPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwcmU+e0pTT04uc3RyaW5naWZ5KHZhbHVlcywgdW5kZWZpbmVkLCAyKX08L3ByZT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgICAgICAgICA8L0NhcmRDb250ZW50PlxuICAgICAgICAgICAgICAgICAgICA8L0NhcmQ+XG4gICAgICAgICAgICAgICAgPC9Cb3g+XG5cbiAgICAgICAgICAgICAgICA8Qm94IG1hcmdpbkJvdHRvbT17NH0+XG4gICAgICAgICAgICAgICAgICAgIDxDYXJkIHZhcmlhbnQ9XCJvdXRsaW5lZFwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgPENhcmRDb250ZW50PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxUeXBvZ3JhcGh5IHZhcmlhbnQ9XCJoM1wiIGd1dHRlckJvdHRvbT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2l0aG91dCBpbml0aWFsVmFsdWVzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9UeXBvZ3JhcGh5PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxGb3JtXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uU3VibWl0PXsodmFsdWVzKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB2YWx1ZXNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVuZGVyPXsoeyB2YWx1ZXMsIGZvcm0gfSkgPT4gKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8RmllbGRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tcG9uZW50PXtGaW5hbEZvcm1SYW5nZUlucHV0fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lPVwicHJpY2VcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtaW49ezB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heD17MTUwfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmRBZG9ybm1lbnQ9ezxzcGFuPuKCrDwvc3Bhbj59XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNsaWRlclByb3BzPXt7IGNvbXBvbmVudHM6IHsgVGh1bWIgfSB9fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPEJ1dHRvblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrPXsoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JtLnJlc2V0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH19XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXNldFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvQnV0dG9uPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwcmU+e0pTT04uc3RyaW5naWZ5KHZhbHVlcywgdW5kZWZpbmVkLCAyKX08L3ByZT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgICAgICAgICA8L0NhcmRDb250ZW50PlxuICAgICAgICAgICAgICAgICAgICA8L0NhcmQ+XG4gICAgICAgICAgICAgICAgPC9Cb3g+XG4gICAgICAgICAgICAgICAgPEJveCBtYXJnaW5Cb3R0b209ezR9PlxuICAgICAgICAgICAgICAgICAgICA8Q2FyZCB2YXJpYW50PVwib3V0bGluZWRcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxDYXJkQ29udGVudD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8VHlwb2dyYXBoeSB2YXJpYW50PVwiaDNcIiBndXR0ZXJCb3R0b20+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGggaW5pdGlhbFZhbHVlcyBhbmQgZGlmZmVyZW50IE1pbk1heCBWYWx1ZXNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L1R5cG9ncmFwaHk+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPEZvcm1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25TdWJtaXQ9eyh2YWx1ZXMpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHZhbHVlc1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbml0aWFsVmFsdWVzPXt7IHByaWNlOiB7IG1pbjogNTAsIG1heDogODAgfSB9fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW5kZXI9eyh7IHZhbHVlcywgZm9ybSwgaW5pdGlhbFZhbHVlcyB9KSA9PiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxGaWVsZFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21wb25lbnQ9e0ZpbmFsRm9ybVJhbmdlSW5wdXR9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU9XCJwcmljZVwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1pbj17MjB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heD17MTUwfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmRBZG9ybm1lbnQ9ezxzcGFuPuKCrDwvc3Bhbj59XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNsaWRlclByb3BzPXt7IGNvbXBvbmVudHM6IHsgVGh1bWIgfSB9fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPEJ1dHRvblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrPXsoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JtLnJlc2V0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH19XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXNldFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvQnV0dG9uPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwcmU+e0pTT04uc3RyaW5naWZ5KHZhbHVlcywgdW5kZWZpbmVkLCAyKX08L3ByZT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgICAgICAgICA8L0NhcmRDb250ZW50PlxuICAgICAgICAgICAgICAgICAgICA8L0NhcmQ+XG4gICAgICAgICAgICAgICAgPC9Cb3g+XG4gICAgICAgICAgICAgICAgPEJveCBtYXJnaW5Cb3R0b209ezR9PlxuICAgICAgICAgICAgICAgICAgICA8Q2FyZCB2YXJpYW50PVwib3V0bGluZWRcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxDYXJkQ29udGVudD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8VHlwb2dyYXBoeSB2YXJpYW50PVwiaDNcIiBndXR0ZXJCb3R0b20+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpc2FibGVkXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9UeXBvZ3JhcGh5PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxGb3JtXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uU3VibWl0PXsodmFsdWVzKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB2YWx1ZXNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5pdGlhbFZhbHVlcz17eyBwcmljZTogeyBtaW46IDUwLCBtYXg6IDgwIH0gfX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVuZGVyPXsoeyB2YWx1ZXMsIGZvcm0sIGluaXRpYWxWYWx1ZXMgfSkgPT4gKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8RmllbGRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tcG9uZW50PXtGaW5hbEZvcm1SYW5nZUlucHV0fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lPVwicHJpY2VcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtaW49ezB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heD17MTAwfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmRBZG9ybm1lbnQ9ezxzcGFuPuKCrDwvc3Bhbj59XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNsaWRlclByb3BzPXt7IGNvbXBvbmVudHM6IHsgVGh1bWIgfSB9fVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNhYmxlZFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWFkT25seVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPEJ1dHRvblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrPXsoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JtLnJlc2V0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH19XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXNldFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvQnV0dG9uPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwcmU+e0pTT04uc3RyaW5naWZ5KHZhbHVlcywgdW5kZWZpbmVkLCAyKX08L3ByZT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgICAgICAgICA8L0NhcmRDb250ZW50PlxuICAgICAgICAgICAgICAgICAgICA8L0NhcmQ+XG4gICAgICAgICAgICAgICAgPC9Cb3g+XG4gICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgPC8+XG4gICAgKTtcbn07XG4iXX0= */",
|
|
22
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
23
|
+
});
|
|
24
|
+
export default {
|
|
25
|
+
title: "components/form"
|
|
26
|
+
};
|
|
27
|
+
export var RangeInput = function RangeInput() {
|
|
28
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
29
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
30
|
+
marginBottom: 4,
|
|
31
|
+
children: /*#__PURE__*/_jsx(Toolbar, {
|
|
32
|
+
children: /*#__PURE__*/_jsx(ToolbarTitleItem, {
|
|
33
|
+
children: "Final Form Range Input"
|
|
34
|
+
})
|
|
35
|
+
})
|
|
36
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
37
|
+
style: {
|
|
38
|
+
width: 400
|
|
39
|
+
},
|
|
40
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
41
|
+
marginBottom: 4,
|
|
42
|
+
children: /*#__PURE__*/_jsx(Card, {
|
|
43
|
+
variant: "outlined",
|
|
44
|
+
children: /*#__PURE__*/_jsxs(CardContent, {
|
|
45
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
46
|
+
variant: "h3",
|
|
47
|
+
gutterBottom: true,
|
|
48
|
+
children: "with initialValues"
|
|
49
|
+
}), /*#__PURE__*/_jsx(Form, {
|
|
50
|
+
onSubmit: function onSubmit(values) {
|
|
51
|
+
// values
|
|
52
|
+
},
|
|
53
|
+
initialValues: {
|
|
54
|
+
price: {
|
|
55
|
+
min: 0,
|
|
56
|
+
max: 100
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
render: function render(_ref) {
|
|
60
|
+
var handleSubmit = _ref.handleSubmit,
|
|
61
|
+
values = _ref.values,
|
|
62
|
+
form = _ref.form,
|
|
63
|
+
initialValues = _ref.initialValues;
|
|
64
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
65
|
+
children: [/*#__PURE__*/_jsx(Field, {
|
|
66
|
+
component: FinalFormRangeInput,
|
|
67
|
+
name: "price",
|
|
68
|
+
min: 0,
|
|
69
|
+
max: 100,
|
|
70
|
+
endAdornment: /*#__PURE__*/_jsx("span", {
|
|
71
|
+
children: "\u20AC"
|
|
72
|
+
}),
|
|
73
|
+
sliderProps: {
|
|
74
|
+
components: {
|
|
75
|
+
Thumb: Thumb
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
79
|
+
onClick: function onClick() {
|
|
80
|
+
form.reset();
|
|
81
|
+
},
|
|
82
|
+
children: "Reset"
|
|
83
|
+
}), /*#__PURE__*/_jsx("pre", {
|
|
84
|
+
children: JSON.stringify(values, undefined, 2)
|
|
85
|
+
})]
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
})]
|
|
89
|
+
})
|
|
90
|
+
})
|
|
91
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
92
|
+
marginBottom: 4,
|
|
93
|
+
children: /*#__PURE__*/_jsx(Card, {
|
|
94
|
+
variant: "outlined",
|
|
95
|
+
children: /*#__PURE__*/_jsxs(CardContent, {
|
|
96
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
97
|
+
variant: "h3",
|
|
98
|
+
gutterBottom: true,
|
|
99
|
+
children: "without initialValues"
|
|
100
|
+
}), /*#__PURE__*/_jsx(Form, {
|
|
101
|
+
onSubmit: function onSubmit(values) {
|
|
102
|
+
// values
|
|
103
|
+
},
|
|
104
|
+
render: function render(_ref2) {
|
|
105
|
+
var values = _ref2.values,
|
|
106
|
+
form = _ref2.form;
|
|
107
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
108
|
+
children: [/*#__PURE__*/_jsx(Field, {
|
|
109
|
+
component: FinalFormRangeInput,
|
|
110
|
+
name: "price",
|
|
111
|
+
min: 0,
|
|
112
|
+
max: 150,
|
|
113
|
+
endAdornment: /*#__PURE__*/_jsx("span", {
|
|
114
|
+
children: "\u20AC"
|
|
115
|
+
}),
|
|
116
|
+
sliderProps: {
|
|
117
|
+
components: {
|
|
118
|
+
Thumb: Thumb
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
122
|
+
onClick: function onClick() {
|
|
123
|
+
form.reset();
|
|
124
|
+
},
|
|
125
|
+
children: "Reset"
|
|
126
|
+
}), /*#__PURE__*/_jsx("pre", {
|
|
127
|
+
children: JSON.stringify(values, undefined, 2)
|
|
128
|
+
})]
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
})]
|
|
132
|
+
})
|
|
133
|
+
})
|
|
134
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
135
|
+
marginBottom: 4,
|
|
136
|
+
children: /*#__PURE__*/_jsx(Card, {
|
|
137
|
+
variant: "outlined",
|
|
138
|
+
children: /*#__PURE__*/_jsxs(CardContent, {
|
|
139
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
140
|
+
variant: "h3",
|
|
141
|
+
gutterBottom: true,
|
|
142
|
+
children: "with initialValues and different MinMax Values"
|
|
143
|
+
}), /*#__PURE__*/_jsx(Form, {
|
|
144
|
+
onSubmit: function onSubmit(values) {
|
|
145
|
+
// values
|
|
146
|
+
},
|
|
147
|
+
initialValues: {
|
|
148
|
+
price: {
|
|
149
|
+
min: 50,
|
|
150
|
+
max: 80
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
render: function render(_ref3) {
|
|
154
|
+
var values = _ref3.values,
|
|
155
|
+
form = _ref3.form,
|
|
156
|
+
initialValues = _ref3.initialValues;
|
|
157
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
158
|
+
children: [/*#__PURE__*/_jsx(Field, {
|
|
159
|
+
component: FinalFormRangeInput,
|
|
160
|
+
name: "price",
|
|
161
|
+
min: 20,
|
|
162
|
+
max: 150,
|
|
163
|
+
endAdornment: /*#__PURE__*/_jsx("span", {
|
|
164
|
+
children: "\u20AC"
|
|
165
|
+
}),
|
|
166
|
+
sliderProps: {
|
|
167
|
+
components: {
|
|
168
|
+
Thumb: Thumb
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
172
|
+
onClick: function onClick() {
|
|
173
|
+
form.reset();
|
|
174
|
+
},
|
|
175
|
+
children: "Reset"
|
|
176
|
+
}), /*#__PURE__*/_jsx("pre", {
|
|
177
|
+
children: JSON.stringify(values, undefined, 2)
|
|
178
|
+
})]
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
})]
|
|
182
|
+
})
|
|
183
|
+
})
|
|
184
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
185
|
+
marginBottom: 4,
|
|
186
|
+
children: /*#__PURE__*/_jsx(Card, {
|
|
187
|
+
variant: "outlined",
|
|
188
|
+
children: /*#__PURE__*/_jsxs(CardContent, {
|
|
189
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
190
|
+
variant: "h3",
|
|
191
|
+
gutterBottom: true,
|
|
192
|
+
children: "disabled"
|
|
193
|
+
}), /*#__PURE__*/_jsx(Form, {
|
|
194
|
+
onSubmit: function onSubmit(values) {
|
|
195
|
+
// values
|
|
196
|
+
},
|
|
197
|
+
initialValues: {
|
|
198
|
+
price: {
|
|
199
|
+
min: 50,
|
|
200
|
+
max: 80
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
render: function render(_ref4) {
|
|
204
|
+
var values = _ref4.values,
|
|
205
|
+
form = _ref4.form,
|
|
206
|
+
initialValues = _ref4.initialValues;
|
|
207
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
208
|
+
children: [/*#__PURE__*/_jsx(Field, {
|
|
209
|
+
component: FinalFormRangeInput,
|
|
210
|
+
name: "price",
|
|
211
|
+
min: 0,
|
|
212
|
+
max: 100,
|
|
213
|
+
endAdornment: /*#__PURE__*/_jsx("span", {
|
|
214
|
+
children: "\u20AC"
|
|
215
|
+
}),
|
|
216
|
+
sliderProps: {
|
|
217
|
+
components: {
|
|
218
|
+
Thumb: Thumb
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
disabled: true,
|
|
222
|
+
readOnly: true
|
|
223
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
224
|
+
onClick: function onClick() {
|
|
225
|
+
form.reset();
|
|
226
|
+
},
|
|
227
|
+
children: "Reset"
|
|
228
|
+
}), /*#__PURE__*/_jsx("pre", {
|
|
229
|
+
children: JSON.stringify(values, undefined, 2)
|
|
230
|
+
})]
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
})]
|
|
234
|
+
})
|
|
235
|
+
})
|
|
236
|
+
})]
|
|
237
|
+
})]
|
|
238
|
+
});
|
|
239
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
var _excluded = ["pristine", "dirty", "hasValidationErrors", "submitting", "hasSubmitErrors", "handleSubmit"];
|
|
2
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
import { Card, CardContent } from "@mui/material";
|
|
5
|
+
import { FillSpace } from "../../common/FillSpace";
|
|
6
|
+
import { ToolbarActions } from "../../common/toolbar/actions/ToolbarActions";
|
|
7
|
+
import { ToolbarBackButton } from "../../common/toolbar/backbutton/ToolbarBackButton";
|
|
8
|
+
import { Toolbar } from "../../common/toolbar/Toolbar";
|
|
9
|
+
import { FinalForm } from "../../FinalForm";
|
|
10
|
+
import { FinalFormSaveButton } from "../../FinalFormSaveButton";
|
|
11
|
+
import { Field } from "../../form/Field";
|
|
12
|
+
import { FinalFormInput } from "../../form/FinalFormInput";
|
|
13
|
+
import { Stack } from "../../stack/Stack";
|
|
14
|
+
import { RouterTab, RouterTabs } from "../../tabs/RouterTabs";
|
|
15
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
16
|
+
export default {
|
|
17
|
+
title: "components/form"
|
|
18
|
+
};
|
|
19
|
+
export var FormWithRouterTabs = {
|
|
20
|
+
render: function render() {
|
|
21
|
+
return /*#__PURE__*/_jsx(Stack, {
|
|
22
|
+
topLevelTitle: "Root Stack",
|
|
23
|
+
children: /*#__PURE__*/_jsxs(RouterTabs, {
|
|
24
|
+
children: [/*#__PURE__*/_jsx(RouterTab, {
|
|
25
|
+
label: "Top 1",
|
|
26
|
+
path: "",
|
|
27
|
+
children: /*#__PURE__*/_jsxs(RouterTabs, {
|
|
28
|
+
children: [/*#__PURE__*/_jsx(RouterTab, {
|
|
29
|
+
label: "Form 1",
|
|
30
|
+
path: "",
|
|
31
|
+
forceRender: true,
|
|
32
|
+
children: /*#__PURE__*/_jsx(Card, {
|
|
33
|
+
variant: "outlined",
|
|
34
|
+
children: /*#__PURE__*/_jsx(CardContent, {
|
|
35
|
+
children: /*#__PURE__*/_jsx(FinalForm, {
|
|
36
|
+
mode: "edit",
|
|
37
|
+
onSubmit: function onSubmit(values) {
|
|
38
|
+
alert(JSON.stringify(values));
|
|
39
|
+
},
|
|
40
|
+
initialValues: {
|
|
41
|
+
foo: "foo",
|
|
42
|
+
bar: "bar"
|
|
43
|
+
},
|
|
44
|
+
children: function children(_ref) {
|
|
45
|
+
var pristine = _ref.pristine,
|
|
46
|
+
dirty = _ref.dirty,
|
|
47
|
+
hasValidationErrors = _ref.hasValidationErrors,
|
|
48
|
+
submitting = _ref.submitting,
|
|
49
|
+
hasSubmitErrors = _ref.hasSubmitErrors,
|
|
50
|
+
handleSubmit = _ref.handleSubmit,
|
|
51
|
+
formVars = _objectWithoutProperties(_ref, _excluded);
|
|
52
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
53
|
+
children: ["Pristine: ", String(pristine), " ", /*#__PURE__*/_jsx("br", {}), "Dirty: ", String(dirty), /*#__PURE__*/_jsxs(Toolbar, {
|
|
54
|
+
children: [/*#__PURE__*/_jsx(ToolbarBackButton, {}), /*#__PURE__*/_jsx(FillSpace, {}), /*#__PURE__*/_jsx(ToolbarActions, {
|
|
55
|
+
children: /*#__PURE__*/_jsx(FinalFormSaveButton, {})
|
|
56
|
+
})]
|
|
57
|
+
}), /*#__PURE__*/_jsx(Card, {
|
|
58
|
+
variant: "outlined",
|
|
59
|
+
children: /*#__PURE__*/_jsx(Field, {
|
|
60
|
+
label: "Foo",
|
|
61
|
+
name: "foo",
|
|
62
|
+
component: FinalFormInput
|
|
63
|
+
})
|
|
64
|
+
})]
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
})
|
|
69
|
+
})
|
|
70
|
+
}), /*#__PURE__*/_jsx(RouterTab, {
|
|
71
|
+
label: "Outside Form",
|
|
72
|
+
path: "/outside-form",
|
|
73
|
+
forceRender: true,
|
|
74
|
+
children: /*#__PURE__*/_jsx(Card, {
|
|
75
|
+
variant: "outlined",
|
|
76
|
+
children: /*#__PURE__*/_jsx(CardContent, {
|
|
77
|
+
children: "Outside Form"
|
|
78
|
+
})
|
|
79
|
+
})
|
|
80
|
+
})]
|
|
81
|
+
})
|
|
82
|
+
}), /*#__PURE__*/_jsx(RouterTab, {
|
|
83
|
+
label: "Top 2",
|
|
84
|
+
path: "/top2",
|
|
85
|
+
children: /*#__PURE__*/_jsx(Card, {
|
|
86
|
+
variant: "outlined",
|
|
87
|
+
children: /*#__PURE__*/_jsx(CardContent, {
|
|
88
|
+
children: "Top2"
|
|
89
|
+
})
|
|
90
|
+
})
|
|
91
|
+
})]
|
|
92
|
+
})
|
|
93
|
+
});
|
|
94
|
+
},
|
|
95
|
+
name: "Form with router tabs"
|
|
96
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
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 { useEffect, useState } from "react";
|
|
8
|
+
import { useLocation } from "react-router";
|
|
9
|
+
import { FinalForm } from "../../FinalForm";
|
|
10
|
+
import { Field } from "../../form/Field";
|
|
11
|
+
import { FinalFormInput } from "../../form/FinalFormInput";
|
|
12
|
+
import { RouterTab, RouterTabs } from "../../tabs/RouterTabs";
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
|
+
function Path() {
|
|
15
|
+
var location = useLocation();
|
|
16
|
+
var _useState = useState(0),
|
|
17
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
18
|
+
rerender = _useState2[1];
|
|
19
|
+
useEffect(function () {
|
|
20
|
+
var timer = setTimeout(function () {
|
|
21
|
+
rerender(new Date().getTime());
|
|
22
|
+
}, 1000);
|
|
23
|
+
return function () {
|
|
24
|
+
return clearTimeout(timer);
|
|
25
|
+
};
|
|
26
|
+
}, []);
|
|
27
|
+
return /*#__PURE__*/_jsx("div", {
|
|
28
|
+
children: location.pathname
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
export default {
|
|
32
|
+
title: "components/form"
|
|
33
|
+
};
|
|
34
|
+
export var RouterTabsInForm = {
|
|
35
|
+
render: function render() {
|
|
36
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
37
|
+
children: [/*#__PURE__*/_jsx(Path, {}), /*#__PURE__*/_jsx(FinalForm, {
|
|
38
|
+
mode: "edit",
|
|
39
|
+
onSubmit: function onSubmit(values) {
|
|
40
|
+
alert(JSON.stringify(values));
|
|
41
|
+
},
|
|
42
|
+
initialValues: {
|
|
43
|
+
foo: "foo",
|
|
44
|
+
bar: "bar"
|
|
45
|
+
},
|
|
46
|
+
children: function children() {
|
|
47
|
+
return /*#__PURE__*/_jsxs(RouterTabs, {
|
|
48
|
+
children: [/*#__PURE__*/_jsx(RouterTab, {
|
|
49
|
+
label: "Form 1",
|
|
50
|
+
path: "",
|
|
51
|
+
forceRender: true,
|
|
52
|
+
children: /*#__PURE__*/_jsx(Field, {
|
|
53
|
+
label: "Foo",
|
|
54
|
+
name: "foo",
|
|
55
|
+
component: FinalFormInput
|
|
56
|
+
})
|
|
57
|
+
}), /*#__PURE__*/_jsx(RouterTab, {
|
|
58
|
+
label: "Form 2",
|
|
59
|
+
path: "/form2",
|
|
60
|
+
forceRender: true,
|
|
61
|
+
children: /*#__PURE__*/_jsx(Field, {
|
|
62
|
+
label: "Bar",
|
|
63
|
+
name: "bar",
|
|
64
|
+
component: FinalFormInput
|
|
65
|
+
})
|
|
66
|
+
})]
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
})]
|
|
70
|
+
});
|
|
71
|
+
},
|
|
72
|
+
name: "RouterTabsInForm"
|
|
73
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
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 { useEffect, useState } from "react";
|
|
8
|
+
import { useLocation } from "react-router";
|
|
9
|
+
import { Button } from "../../common/buttons/Button";
|
|
10
|
+
import { FinalForm } from "../../FinalForm";
|
|
11
|
+
import { Field } from "../../form/Field";
|
|
12
|
+
import { FinalFormInput } from "../../form/FinalFormInput";
|
|
13
|
+
import { StackPage } from "../../stack/Page";
|
|
14
|
+
import { Stack } from "../../stack/Stack";
|
|
15
|
+
import { StackLink } from "../../stack/StackLink";
|
|
16
|
+
import { StackSwitch } from "../../stack/Switch";
|
|
17
|
+
import { RouterTab, RouterTabs } from "../../tabs/RouterTabs";
|
|
18
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
|
+
function Path() {
|
|
20
|
+
var location = useLocation();
|
|
21
|
+
var _useState = useState(0),
|
|
22
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
23
|
+
rerender = _useState2[1];
|
|
24
|
+
useEffect(function () {
|
|
25
|
+
var timer = setTimeout(function () {
|
|
26
|
+
rerender(new Date().getTime());
|
|
27
|
+
}, 1000);
|
|
28
|
+
return function () {
|
|
29
|
+
return clearTimeout(timer);
|
|
30
|
+
};
|
|
31
|
+
}, []);
|
|
32
|
+
return /*#__PURE__*/_jsx("div", {
|
|
33
|
+
children: location.pathname
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
export default {
|
|
37
|
+
title: "components/form"
|
|
38
|
+
};
|
|
39
|
+
export var RouterTabsInFormWithSubroutes = {
|
|
40
|
+
render: function render() {
|
|
41
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
42
|
+
children: [/*#__PURE__*/_jsx(Path, {}), /*#__PURE__*/_jsx(FinalForm, {
|
|
43
|
+
mode: "edit",
|
|
44
|
+
onSubmit: function onSubmit(values) {
|
|
45
|
+
alert(JSON.stringify(values));
|
|
46
|
+
},
|
|
47
|
+
initialValues: {
|
|
48
|
+
foo: "foo",
|
|
49
|
+
bar: "bar"
|
|
50
|
+
},
|
|
51
|
+
children: function children() {
|
|
52
|
+
return /*#__PURE__*/_jsxs(RouterTabs, {
|
|
53
|
+
children: [/*#__PURE__*/_jsx(RouterTab, {
|
|
54
|
+
label: "Form 1",
|
|
55
|
+
path: "",
|
|
56
|
+
forceRender: true,
|
|
57
|
+
children: /*#__PURE__*/_jsx(Field, {
|
|
58
|
+
label: "Foo",
|
|
59
|
+
name: "foo",
|
|
60
|
+
component: FinalFormInput
|
|
61
|
+
})
|
|
62
|
+
}), /*#__PURE__*/_jsxs(RouterTab, {
|
|
63
|
+
label: "Form 2",
|
|
64
|
+
path: "/form2",
|
|
65
|
+
forceRender: true,
|
|
66
|
+
children: [/*#__PURE__*/_jsx(Field, {
|
|
67
|
+
label: "Bar",
|
|
68
|
+
name: "bar",
|
|
69
|
+
component: FinalFormInput
|
|
70
|
+
}), /*#__PURE__*/_jsx(Stack, {
|
|
71
|
+
topLevelTitle: "",
|
|
72
|
+
children: /*#__PURE__*/_jsxs(StackSwitch, {
|
|
73
|
+
initialPage: "page1",
|
|
74
|
+
children: [/*#__PURE__*/_jsxs(StackPage, {
|
|
75
|
+
name: "page1",
|
|
76
|
+
children: ["Form 2 Subpage 1", /*#__PURE__*/_jsx(StackLink, {
|
|
77
|
+
pageName: "page2",
|
|
78
|
+
payload: "test",
|
|
79
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
80
|
+
children: "To subpage 2"
|
|
81
|
+
})
|
|
82
|
+
})]
|
|
83
|
+
}), /*#__PURE__*/_jsx(StackPage, {
|
|
84
|
+
name: "page2",
|
|
85
|
+
children: "Form 2 Subpage 2"
|
|
86
|
+
})]
|
|
87
|
+
})
|
|
88
|
+
})]
|
|
89
|
+
})]
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
})]
|
|
93
|
+
});
|
|
94
|
+
},
|
|
95
|
+
name: "RouterTabsInFormWithSubroutes"
|
|
96
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
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 { Typography } from "@mui/material";
|
|
8
|
+
import { useState } from "react";
|
|
9
|
+
import { Button } from "../../common/buttons/Button";
|
|
10
|
+
import { FinalForm } from "../../FinalForm";
|
|
11
|
+
import { Field } from "../../form/Field";
|
|
12
|
+
import { FinalFormInput } from "../../form/FinalFormInput";
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
|
+
function validate(_ref) {
|
|
15
|
+
var foo = _ref.foo,
|
|
16
|
+
bar = _ref.bar;
|
|
17
|
+
var errors = {};
|
|
18
|
+
if (foo !== "foo") {
|
|
19
|
+
errors.foo = "".concat(foo, " is not foo");
|
|
20
|
+
}
|
|
21
|
+
if (bar !== "bar") {
|
|
22
|
+
errors.bar = "".concat(bar, " is not bar");
|
|
23
|
+
}
|
|
24
|
+
return errors;
|
|
25
|
+
}
|
|
26
|
+
export default {
|
|
27
|
+
title: "components/form"
|
|
28
|
+
};
|
|
29
|
+
export var ScrollToErrorField = function ScrollToErrorField() {
|
|
30
|
+
var initialValues = {
|
|
31
|
+
foo: "foo",
|
|
32
|
+
bar: ""
|
|
33
|
+
};
|
|
34
|
+
var _useState = useState(false),
|
|
35
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
36
|
+
open = _useState2[0],
|
|
37
|
+
setOpen = _useState2[1];
|
|
38
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
39
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
40
|
+
onClick: function onClick() {
|
|
41
|
+
return setOpen(function (s) {
|
|
42
|
+
return !s;
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
children: "Click to Render Form"
|
|
46
|
+
}), /*#__PURE__*/_jsx(Typography, {
|
|
47
|
+
children: "The page then scrolls to the 2nd field which has an error."
|
|
48
|
+
}), open && /*#__PURE__*/_jsxs(FinalForm, {
|
|
49
|
+
mode: "edit",
|
|
50
|
+
onSubmit: function onSubmit() {
|
|
51
|
+
// noop
|
|
52
|
+
},
|
|
53
|
+
initialValues: initialValues,
|
|
54
|
+
validate: validate,
|
|
55
|
+
formContext: {
|
|
56
|
+
shouldScrollToField: function shouldScrollToField(_ref2) {
|
|
57
|
+
var touched = _ref2.touched;
|
|
58
|
+
return !touched;
|
|
59
|
+
},
|
|
60
|
+
shouldShowFieldError: function shouldShowFieldError() {
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
children: [/*#__PURE__*/_jsx(Field, {
|
|
65
|
+
label: "Foo",
|
|
66
|
+
name: "foo",
|
|
67
|
+
component: FinalFormInput,
|
|
68
|
+
fullWidth: true
|
|
69
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
70
|
+
style: {
|
|
71
|
+
height: "2000px",
|
|
72
|
+
borderLeft: "1px solid black"
|
|
73
|
+
}
|
|
74
|
+
}), /*#__PURE__*/_jsx(Field, {
|
|
75
|
+
label: "Bar",
|
|
76
|
+
name: "bar",
|
|
77
|
+
component: FinalFormInput,
|
|
78
|
+
fullWidth: true
|
|
79
|
+
})]
|
|
80
|
+
})]
|
|
81
|
+
});
|
|
82
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Alert } from "../../alert/Alert";
|
|
2
|
+
import { FinalForm } from "../../FinalForm";
|
|
3
|
+
import { SearchField } from "../../form/fields/SearchField";
|
|
4
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
var config = {
|
|
6
|
+
component: SearchField,
|
|
7
|
+
title: "components/form/SearchField"
|
|
8
|
+
};
|
|
9
|
+
export default config;
|
|
10
|
+
export var Default = {
|
|
11
|
+
render: function render() {
|
|
12
|
+
return /*#__PURE__*/_jsx(FinalForm, {
|
|
13
|
+
mode: "edit",
|
|
14
|
+
onSubmit: function onSubmit() {
|
|
15
|
+
// not handled
|
|
16
|
+
},
|
|
17
|
+
subscription: {
|
|
18
|
+
values: true
|
|
19
|
+
},
|
|
20
|
+
children: function children(_ref) {
|
|
21
|
+
var values = _ref.values;
|
|
22
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
23
|
+
children: [/*#__PURE__*/_jsx(SearchField, {
|
|
24
|
+
name: "value",
|
|
25
|
+
label: "Search Field",
|
|
26
|
+
fullWidth: true,
|
|
27
|
+
variant: "horizontal"
|
|
28
|
+
}), /*#__PURE__*/_jsx(Alert, {
|
|
29
|
+
title: "FormState",
|
|
30
|
+
children: /*#__PURE__*/_jsx("pre", {
|
|
31
|
+
children: JSON.stringify(values, null, 2)
|
|
32
|
+
})
|
|
33
|
+
})]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
};
|