@webiny/ui 5.27.0 → 5.29.0-beta.0
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/Accordion/Accordion.js +27 -13
- package/Accordion/Accordion.js.map +1 -1
- package/Accordion/Accordion.stories.js +34 -23
- package/Accordion/Accordion.stories.js.map +1 -1
- package/Accordion/AccordionItem.js +60 -36
- package/Accordion/AccordionItem.js.map +1 -1
- package/Accordion/index.js +31 -2
- package/Accordion/index.js.map +1 -1
- package/Alert/Alert.js +21 -10
- package/Alert/Alert.js.map +1 -1
- package/Alert/Alert.stories.js +22 -13
- package/Alert/Alert.stories.js.map +1 -1
- package/Alert/index.js +18 -1
- package/Alert/index.js.map +1 -1
- package/AutoComplete/AutoComplete.js +100 -77
- package/AutoComplete/AutoComplete.js.map +1 -1
- package/AutoComplete/AutoComplete.stories.js +27 -17
- package/AutoComplete/AutoComplete.stories.js.map +1 -1
- package/AutoComplete/MultiAutoComplete.js +164 -139
- package/AutoComplete/MultiAutoComplete.js.map +1 -1
- package/AutoComplete/MultiAutoComplete.stories.js +39 -28
- package/AutoComplete/MultiAutoComplete.stories.js.map +1 -1
- package/AutoComplete/index.js +31 -2
- package/AutoComplete/index.js.map +1 -1
- package/AutoComplete/styles.js +14 -4
- package/AutoComplete/styles.js.map +1 -1
- package/AutoComplete/types.js +5 -1
- package/AutoComplete/types.js.map +1 -1
- package/AutoComplete/utils.js +19 -4
- package/AutoComplete/utils.js.map +1 -1
- package/Avatar/Avatar.js +30 -15
- package/Avatar/Avatar.js.map +1 -1
- package/Avatar/Avatar.stories.js +19 -10
- package/Avatar/Avatar.stories.js.map +1 -1
- package/Avatar/index.js +18 -1
- package/Avatar/index.js.map +1 -1
- package/Button/Button.js +52 -23
- package/Button/Button.js.map +1 -1
- package/Button/Button.stories.js +42 -29
- package/Button/Button.stories.js.map +1 -1
- package/Button/CopyButton/CopyButton.js +24 -11
- package/Button/CopyButton/CopyButton.js.map +1 -1
- package/Button/CopyButton/CopyButton.stories.js +20 -10
- package/Button/CopyButton/CopyButton.stories.js.map +1 -1
- package/Button/IconButton/IconButton.js +14 -4
- package/Button/IconButton/IconButton.js.map +1 -1
- package/Button/IconButton/IconButton.stories.js +31 -19
- package/Button/IconButton/IconButton.stories.js.map +1 -1
- package/Button/index.js +44 -3
- package/Button/index.js.map +1 -1
- package/Carousel/Carousel.js +34 -21
- package/Carousel/Carousel.js.map +1 -1
- package/Carousel/Carouser.stories.js +27 -17
- package/Carousel/Carouser.stories.js.map +1 -1
- package/Carousel/index.js +15 -1
- package/Carousel/index.js.map +1 -1
- package/Checkbox/Checkbox.js +37 -22
- package/Checkbox/Checkbox.js.map +1 -1
- package/Checkbox/Checkbox.stories.js +27 -16
- package/Checkbox/Checkbox.stories.js.map +1 -1
- package/Checkbox/Checkbox.styles.js +11 -4
- package/Checkbox/Checkbox.styles.js.map +1 -1
- package/Checkbox/CheckboxGroup.js +36 -21
- package/Checkbox/CheckboxGroup.js.map +1 -1
- package/Checkbox/CheckboxGroup.stories.js +29 -18
- package/Checkbox/CheckboxGroup.stories.js.map +1 -1
- package/Checkbox/index.js +23 -2
- package/Checkbox/index.js.map +1 -1
- package/Chips/Chip.js +21 -7
- package/Chips/Chip.js.map +1 -1
- package/Chips/ChipIcon.js +21 -7
- package/Chips/ChipIcon.js.map +1 -1
- package/Chips/Chips.js +29 -12
- package/Chips/Chips.js.map +1 -1
- package/Chips/Chips.stories.js +27 -16
- package/Chips/Chips.stories.js.map +1 -1
- package/Chips/index.js +44 -3
- package/Chips/index.js.map +1 -1
- package/Chips/styles.js +14 -4
- package/Chips/styles.js.map +1 -1
- package/CodeEditor/CodeEditor.js +48 -29
- package/CodeEditor/CodeEditor.js.map +1 -1
- package/CodeEditor/CodeEditor.stories.js +30 -17
- package/CodeEditor/CodeEditor.stories.js.map +1 -1
- package/CodeEditor/index.js +18 -1
- package/CodeEditor/index.js.map +1 -1
- package/ColorPicker/ColorPicker.js +58 -44
- package/ColorPicker/ColorPicker.js.map +1 -1
- package/ColorPicker/ColorPicker.stories.js +26 -15
- package/ColorPicker/ColorPicker.stories.js.map +1 -1
- package/ColorPicker/index.js +18 -1
- package/ColorPicker/index.js.map +1 -1
- package/ConfirmationDialog/ConfirmationDialog.js +51 -42
- package/ConfirmationDialog/ConfirmationDialog.js.map +1 -1
- package/ConfirmationDialog/ConfirmationDialog.stories.js +22 -12
- package/ConfirmationDialog/ConfirmationDialog.stories.js.map +1 -1
- package/ConfirmationDialog/index.js +31 -2
- package/ConfirmationDialog/index.js.map +1 -1
- package/ConfirmationDialog/withConfirmation.js +19 -6
- package/ConfirmationDialog/withConfirmation.js.map +1 -1
- package/Dialog/Dialog.js +68 -37
- package/Dialog/Dialog.js.map +1 -1
- package/Dialog/Dialog.stories.js +26 -16
- package/Dialog/Dialog.stories.js.map +1 -1
- package/Dialog/index.js +18 -1
- package/Dialog/index.js.map +1 -1
- package/Drawer/Drawer.js +20 -6
- package/Drawer/Drawer.js.map +1 -1
- package/Drawer/Drawer.stories.js +26 -15
- package/Drawer/Drawer.stories.js.map +1 -1
- package/Drawer/index.js +18 -1
- package/Drawer/index.js.map +1 -1
- package/DynamicFieldset/Fieldset.js +56 -47
- package/DynamicFieldset/Fieldset.js.map +1 -1
- package/DynamicFieldset/index.js +15 -1
- package/DynamicFieldset/index.js.map +1 -1
- package/Elevation/Elevation.js +17 -6
- package/Elevation/Elevation.js.map +1 -1
- package/Elevation/Elevation.stories.js +27 -16
- package/Elevation/Elevation.stories.js.map +1 -1
- package/Elevation/index.js +18 -1
- package/Elevation/index.js.map +1 -1
- package/FormElementMessage/FormElementMessage.js +15 -5
- package/FormElementMessage/FormElementMessage.js.map +1 -1
- package/FormElementMessage/index.js +13 -1
- package/FormElementMessage/index.js.map +1 -1
- package/FullName/FullName.js +8 -1
- package/FullName/FullName.js.map +1 -1
- package/FullName/index.js +18 -1
- package/FullName/index.js.map +1 -1
- package/Grid/Grid.js +26 -9
- package/Grid/Grid.js.map +1 -1
- package/Grid/Grid.stories.js +21 -12
- package/Grid/Grid.stories.js.map +1 -1
- package/Grid/index.js +18 -1
- package/Grid/index.js.map +1 -1
- package/Helpers/ClassNames.js +16 -7
- package/Helpers/ClassNames.js.map +1 -1
- package/Helpers/index.js +13 -2
- package/Helpers/index.js.map +1 -1
- package/Icon/Icon.js +19 -7
- package/Icon/Icon.js.map +1 -1
- package/Icon/Icon.stories.js +33 -20
- package/Icon/Icon.stories.js.map +1 -1
- package/Icon/index.js +18 -1
- package/Icon/index.js.map +1 -1
- package/Image/Image.js +15 -7
- package/Image/Image.js.map +1 -1
- package/Image/Image.stories.js +21 -11
- package/Image/Image.stories.js.map +1 -1
- package/Image/index.js +18 -1
- package/Image/index.js.map +1 -1
- package/ImageEditor/ImageEditor.js +75 -65
- package/ImageEditor/ImageEditor.js.map +1 -1
- package/ImageEditor/index.js +18 -1
- package/ImageEditor/index.js.map +1 -1
- package/ImageEditor/toolbar/crop.js +30 -13
- package/ImageEditor/toolbar/crop.js.map +1 -1
- package/ImageEditor/toolbar/filter.js +61 -44
- package/ImageEditor/toolbar/filter.js.map +1 -1
- package/ImageEditor/toolbar/flip.js +32 -15
- package/ImageEditor/toolbar/flip.js.map +1 -1
- package/ImageEditor/toolbar/icons/index.js +69 -8
- package/ImageEditor/toolbar/icons/index.js.map +1 -1
- package/ImageEditor/toolbar/index.js +39 -4
- package/ImageEditor/toolbar/index.js.map +1 -1
- package/ImageEditor/toolbar/rotate.js +58 -35
- package/ImageEditor/toolbar/rotate.js.map +1 -1
- package/ImageEditor/toolbar/types.js +5 -1
- package/ImageEditor/toolbar/types.js.map +1 -1
- package/ImageUpload/Image.js +57 -35
- package/ImageUpload/Image.js.map +1 -1
- package/ImageUpload/ImageEditorDialog.js +48 -30
- package/ImageUpload/ImageEditorDialog.js.map +1 -1
- package/ImageUpload/MultiImageUpload.js +88 -70
- package/ImageUpload/MultiImageUpload.js.map +1 -1
- package/ImageUpload/MultiImageUpload.stories.js +26 -15
- package/ImageUpload/MultiImageUpload.stories.js.map +1 -1
- package/ImageUpload/SingleImageUpload.js +68 -45
- package/ImageUpload/SingleImageUpload.js.map +1 -1
- package/ImageUpload/SingleImageUpload.stories.js +27 -16
- package/ImageUpload/SingleImageUpload.stories.js.map +1 -1
- package/ImageUpload/index.js +39 -4
- package/ImageUpload/index.js.map +1 -1
- package/ImageUpload/styled.d.ts +2 -2
- package/ImageUpload/styled.js +29 -15
- package/ImageUpload/styled.js.map +1 -1
- package/Input/Input.js +52 -35
- package/Input/Input.js.map +1 -1
- package/Input/Input.stories.js +62 -46
- package/Input/Input.stories.js.map +1 -1
- package/Input/__tests__/Input.test.js +37 -26
- package/Input/__tests__/Input.test.js.map +1 -1
- package/Input/index.js +18 -1
- package/Input/index.js.map +1 -1
- package/List/CollapsibleList/CollapsibleList.stories.js +27 -16
- package/List/CollapsibleList/CollapsibleList.stories.js.map +1 -1
- package/List/CollapsibleList/index.js +21 -6
- package/List/CollapsibleList/index.js.map +1 -1
- package/List/DataList/DataList.js +89 -60
- package/List/DataList/DataList.js.map +1 -1
- package/List/DataList/DataList.stories.js +37 -25
- package/List/DataList/DataList.stories.js.map +1 -1
- package/List/DataList/DataListModalOverlay/DataListModalOverlay.js +29 -10
- package/List/DataList/DataListModalOverlay/DataListModalOverlay.js.map +1 -1
- package/List/DataList/DataListModalOverlay/DataListModalOverlayAction.js +27 -9
- package/List/DataList/DataListModalOverlay/DataListModalOverlayAction.js.map +1 -1
- package/List/DataList/DataListModalOverlay/DataListModalOverlayContext.js +24 -8
- package/List/DataList/DataListModalOverlay/DataListModalOverlayContext.js.map +1 -1
- package/List/DataList/DataListModalOverlay/index.js +35 -3
- package/List/DataList/DataListModalOverlay/index.js.map +1 -1
- package/List/DataList/Loader.js +25 -13
- package/List/DataList/Loader.js.map +1 -1
- package/List/DataList/NoData.js +19 -6
- package/List/DataList/NoData.js.map +1 -1
- package/List/DataList/icons/index.js +83 -38
- package/List/DataList/icons/index.js.map +1 -1
- package/List/DataList/index.js +48 -3
- package/List/DataList/index.js.map +1 -1
- package/List/DataList/types.js +5 -1
- package/List/DataList/types.js.map +1 -1
- package/List/List.js +92 -49
- package/List/List.js.map +1 -1
- package/List/List.stories.js +52 -37
- package/List/List.stories.js.map +1 -1
- package/List/icons/index.js +23 -3
- package/List/icons/index.js.map +1 -1
- package/List/index.js +60 -3
- package/List/index.js.map +1 -1
- package/Menu/Menu.js +58 -46
- package/Menu/Menu.js.map +1 -1
- package/Menu/Menu.stories.js +24 -14
- package/Menu/Menu.stories.js.map +1 -1
- package/Menu/index.js +18 -1
- package/Menu/index.js.map +1 -1
- package/Mosaic/Mosaic.js +16 -7
- package/Mosaic/Mosaic.js.map +1 -1
- package/Mosaic/Mosaic.stories.js +37 -28
- package/Mosaic/Mosaic.stories.js.map +1 -1
- package/Mosaic/index.js +18 -1
- package/Mosaic/index.js.map +1 -1
- package/Progress/CircularProgress.js +25 -11
- package/Progress/CircularProgress.js.map +1 -1
- package/Progress/index.js +15 -1
- package/Progress/index.js.map +1 -1
- package/Radio/Radio.js +37 -22
- package/Radio/Radio.js.map +1 -1
- package/Radio/Radio.styles.js +11 -4
- package/Radio/Radio.styles.js.map +1 -1
- package/Radio/RadioGroup.js +33 -19
- package/Radio/RadioGroup.js.map +1 -1
- package/Radio/RadioGroup.stories.js +29 -18
- package/Radio/RadioGroup.stories.js.map +1 -1
- package/Radio/index.js +23 -2
- package/Radio/index.js.map +1 -1
- package/RichTextEditor/RichTextEditor.js +56 -32
- package/RichTextEditor/RichTextEditor.js.map +1 -1
- package/RichTextEditor/RichTextEditor.stories.js +21 -10
- package/RichTextEditor/RichTextEditor.stories.js.map +1 -1
- package/RichTextEditor/createPropsFromConfig.js +15 -4
- package/RichTextEditor/createPropsFromConfig.js.map +1 -1
- package/RichTextEditor/index.js +30 -2
- package/RichTextEditor/index.js.map +1 -1
- package/Ripple/Ripple.js +16 -5
- package/Ripple/Ripple.js.map +1 -1
- package/Ripple/Ripple.stories.js +57 -42
- package/Ripple/Ripple.stories.js.map +1 -1
- package/Ripple/index.js +18 -1
- package/Ripple/index.js.map +1 -1
- package/Scrollbar/Scrollbar.js +14 -4
- package/Scrollbar/Scrollbar.js.map +1 -1
- package/Scrollbar/Scrollbar.stories.js +18 -9
- package/Scrollbar/Scrollbar.stories.js.map +1 -1
- package/Scrollbar/index.js +18 -1
- package/Scrollbar/index.js.map +1 -1
- package/Section/Section.stories.js +22 -12
- package/Section/Section.stories.js.map +1 -1
- package/Section/index.js +30 -15
- package/Section/index.js.map +1 -1
- package/Select/Select.js +37 -18
- package/Select/Select.js.map +1 -1
- package/Select/Select.stories.js +36 -25
- package/Select/Select.stories.js.map +1 -1
- package/Select/index.js +18 -1
- package/Select/index.js.map +1 -1
- package/Slider/Slider.js +43 -27
- package/Slider/Slider.js.map +1 -1
- package/Slider/Slider.stories.js +27 -16
- package/Slider/Slider.stories.js.map +1 -1
- package/Slider/index.js +15 -1
- package/Slider/index.js.map +1 -1
- package/Snackbar/Snackbar.js +38 -20
- package/Snackbar/Snackbar.js.map +1 -1
- package/Snackbar/Snackbar.stories.js +44 -30
- package/Snackbar/Snackbar.stories.js.map +1 -1
- package/Snackbar/index.js +19 -1
- package/Snackbar/index.js.map +1 -1
- package/Switch/Switch.js +43 -27
- package/Switch/Switch.js.map +1 -1
- package/Switch/Switch.stories.js +27 -16
- package/Switch/Switch.stories.js.map +1 -1
- package/Switch/index.js +18 -1
- package/Switch/index.js.map +1 -1
- package/Tabs/Tab.js +21 -7
- package/Tabs/Tab.js.map +1 -1
- package/Tabs/Tabs.js +49 -28
- package/Tabs/Tabs.js.map +1 -1
- package/Tabs/Tabs.stories.js +34 -22
- package/Tabs/Tabs.stories.js.map +1 -1
- package/Tabs/index.js +31 -2
- package/Tabs/index.js.map +1 -1
- package/Tags/Tags.js +64 -40
- package/Tags/Tags.js.map +1 -1
- package/Tags/Tags.stories.js +27 -16
- package/Tags/Tags.stories.js.map +1 -1
- package/Tags/index.js +18 -1
- package/Tags/index.js.map +1 -1
- package/Tooltip/Tooltip.js +38 -24
- package/Tooltip/Tooltip.js.map +1 -1
- package/Tooltip/Tooltip.stories.js +20 -11
- package/Tooltip/Tooltip.stories.js.map +1 -1
- package/Tooltip/index.js +18 -1
- package/Tooltip/index.js.map +1 -1
- package/TopAppBar/TopAppBar.js +18 -7
- package/TopAppBar/TopAppBar.js.map +1 -1
- package/TopAppBar/TopAppBar.stories.js +39 -25
- package/TopAppBar/TopAppBar.stories.js.map +1 -1
- package/TopAppBar/TopAppBarActionItem.js +14 -4
- package/TopAppBar/TopAppBarActionItem.js.map +1 -1
- package/TopAppBar/TopAppBarNavigationIcon.js +14 -4
- package/TopAppBar/TopAppBarNavigationIcon.js.map +1 -1
- package/TopAppBar/TopAppBarPrimary.js +18 -7
- package/TopAppBar/TopAppBarPrimary.js.map +1 -1
- package/TopAppBar/TopAppBarSecondary.js +18 -7
- package/TopAppBar/TopAppBarSecondary.js.map +1 -1
- package/TopAppBar/TopAppBarSection.js +18 -7
- package/TopAppBar/TopAppBarSection.js.map +1 -1
- package/TopAppBar/TopAppBarTitle.js +18 -7
- package/TopAppBar/TopAppBarTitle.js.map +1 -1
- package/TopAppBar/index.js +96 -7
- package/TopAppBar/index.js.map +1 -1
- package/TopProgressBar/TopProgressBar.js +20 -7
- package/TopProgressBar/TopProgressBar.js.map +1 -1
- package/TopProgressBar/TopProgressBar.stories.js +22 -12
- package/TopProgressBar/TopProgressBar.stories.js.map +1 -1
- package/TopProgressBar/hoc/index.js +15 -1
- package/TopProgressBar/hoc/index.js.map +1 -1
- package/TopProgressBar/hoc/withTopProgressBar.js +16 -5
- package/TopProgressBar/hoc/withTopProgressBar.js.map +1 -1
- package/TopProgressBar/index.js +18 -1
- package/TopProgressBar/index.js.map +1 -1
- package/Typography/Typography.js +14 -4
- package/Typography/Typography.js.map +1 -1
- package/Typography/Typography.stories.js +43 -34
- package/Typography/Typography.stories.js.map +1 -1
- package/Typography/index.js +18 -1
- package/Typography/index.js.map +1 -1
- package/package.json +9 -9
- package/types.js +5 -1
- package/types.js.map +1 -1
package/Dialog/Dialog.stories.js
CHANGED
|
@@ -1,30 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
var _react = _interopRequireDefault(require("react"));
|
|
6
|
+
|
|
7
|
+
var _react2 = require("@storybook/react");
|
|
8
|
+
|
|
9
|
+
var _Story = require("@webiny/storybook-utils/Story");
|
|
10
|
+
|
|
11
|
+
var _README = _interopRequireDefault(require("./../Dialog/README.md"));
|
|
12
|
+
|
|
13
|
+
var _addonKnobs = require("@storybook/addon-knobs");
|
|
14
|
+
|
|
15
|
+
var _ = require(".");
|
|
16
|
+
|
|
17
|
+
var story = (0, _react2.storiesOf)("Components/Dialog", module);
|
|
18
|
+
story.addDecorator(_addonKnobs.withKnobs);
|
|
9
19
|
story.add("usage", function () {
|
|
10
|
-
var open = boolean("Open", false);
|
|
11
|
-
return /*#__PURE__*/
|
|
20
|
+
var open = (0, _addonKnobs.boolean)("Open", false);
|
|
21
|
+
return /*#__PURE__*/_react.default.createElement(_Story.Story, null, /*#__PURE__*/_react.default.createElement(_Story.StoryReadme, null, _README.default), /*#__PURE__*/_react.default.createElement(_Story.StorySandbox, {
|
|
12
22
|
title: "dialog"
|
|
13
|
-
}, /*#__PURE__*/
|
|
23
|
+
}, /*#__PURE__*/_react.default.createElement(_Story.StorySandboxExample, {
|
|
14
24
|
title: "A list with all possible options"
|
|
15
|
-
}, "Toggle ", /*#__PURE__*/
|
|
25
|
+
}, "Toggle ", /*#__PURE__*/_react.default.createElement("code", null, "open"), " prop via the bottom knobs.", /*#__PURE__*/_react.default.createElement("br", null), /*#__PURE__*/_react.default.createElement("br", null), "Note that instead of using ", /*#__PURE__*/_react.default.createElement("code", null, "DialogFooter.Button"), " with", " ", /*#__PURE__*/_react.default.createElement("code", null, "accept"), " or ", /*#__PURE__*/_react.default.createElement("code", null, "cancel"), " prop, you can use a shorter", " ", /*#__PURE__*/_react.default.createElement("code", null, "DialogAccept"), " and ", /*#__PURE__*/_react.default.createElement("code", null, "DialogCancel"), " components respectively.", /*#__PURE__*/_react.default.createElement(_.Dialog, {
|
|
16
26
|
open: open
|
|
17
|
-
}, /*#__PURE__*/
|
|
27
|
+
}, /*#__PURE__*/_react.default.createElement(_.DialogTitle, null, "Delete confirmation"), /*#__PURE__*/_react.default.createElement(_.DialogContent, null, "Are you sure you want to delete?"), /*#__PURE__*/_react.default.createElement(_.DialogActions, null, /*#__PURE__*/_react.default.createElement(_.DialogCancel, {
|
|
18
28
|
onClick: function onClick() {
|
|
19
29
|
return console.log("Cancel");
|
|
20
30
|
}
|
|
21
|
-
}, "Cancel"), /*#__PURE__*/
|
|
31
|
+
}, "Cancel"), /*#__PURE__*/_react.default.createElement(_.DialogAccept, {
|
|
22
32
|
onClick: function onClick() {
|
|
23
33
|
return console.log("Accept");
|
|
24
34
|
}
|
|
25
|
-
}, "OK")))), /*#__PURE__*/
|
|
35
|
+
}, "OK")))), /*#__PURE__*/_react.default.createElement(_Story.StorySandboxCode, null, "\n <Dialog open={".concat(open, "}>\n <DialogTitle>\n Delete confirmation\n </DialogTitle>\n <DialogBody>Are you sure you want to delete?</DialogBody>\n <DialogFooter>\n <DialogCancel onClick={() => console.log(\"Cancel\")}>Cancel</DialogCancel>\n <DialogAccept onClick={() => console.log(\"Accept\")}>OK</DialogAccept>\n </DialogFooter>\n </Dialog>\n "))));
|
|
26
36
|
}, {
|
|
27
37
|
info: {
|
|
28
|
-
propTables: [Dialog, DialogButton, DialogAccept, DialogCancel, DialogActions, DialogTitle, DialogContent]
|
|
38
|
+
propTables: [_.Dialog, _.DialogButton, _.DialogAccept, _.DialogCancel, _.DialogActions, _.DialogTitle, _.DialogContent]
|
|
29
39
|
}
|
|
30
40
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["story","storiesOf","module","addDecorator","withKnobs","add","open","boolean","readme","console","log","info","propTables","Dialog","DialogButton","DialogAccept","DialogCancel","DialogActions","DialogTitle","DialogContent"],"sources":["Dialog.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport { storiesOf } from \"@storybook/react\";\nimport {\n Story,\n StoryReadme,\n StorySandboxCode,\n StorySandbox,\n StorySandboxExample\n} from \"@webiny/storybook-utils/Story\";\nimport readme from \"./../Dialog/README.md\";\nimport { withKnobs, boolean } from \"@storybook/addon-knobs\";\n\nimport {\n Dialog,\n DialogButton,\n DialogAccept,\n DialogCancel,\n DialogActions,\n DialogTitle,\n DialogContent\n} from \".\";\n\nconst story = storiesOf(\"Components/Dialog\", module);\nstory.addDecorator(withKnobs);\n\nstory.add(\n \"usage\",\n () => {\n const open = boolean(\"Open\", false);\n\n return (\n <Story>\n <StoryReadme>{readme}</StoryReadme>\n <StorySandbox title={\"dialog\"}>\n <StorySandboxExample title={\"A list with all possible options\"}>\n Toggle <code>open</code> prop via the bottom knobs.\n <br />\n <br />\n Note that instead of using <code>DialogFooter.Button</code> with{\" \"}\n <code>accept</code> or <code>cancel</code> prop, you can use a shorter{\" \"}\n <code>DialogAccept</code> and <code>DialogCancel</code> components\n respectively.\n <Dialog open={open}>\n <DialogTitle>Delete confirmation</DialogTitle>\n <DialogContent>Are you sure you want to delete?</DialogContent>\n <DialogActions>\n <DialogCancel onClick={() => console.log(\"Cancel\")}>\n Cancel\n </DialogCancel>\n <DialogAccept onClick={() => console.log(\"Accept\")}>\n OK\n </DialogAccept>\n </DialogActions>\n </Dialog>\n </StorySandboxExample>\n <StorySandboxCode>\n {`\n <Dialog open={${open}}>\n <DialogTitle>\n Delete confirmation\n </DialogTitle>\n <DialogBody>Are you sure you want to delete?</DialogBody>\n <DialogFooter>\n <DialogCancel onClick={() => console.log(\"Cancel\")}>Cancel</DialogCancel>\n <DialogAccept onClick={() => console.log(\"Accept\")}>OK</DialogAccept>\n </DialogFooter>\n </Dialog>\n `}\n </StorySandboxCode>\n </StorySandbox>\n </Story>\n );\n },\n {\n info: {\n propTables: [\n Dialog,\n DialogButton,\n DialogAccept,\n DialogCancel,\n DialogActions,\n DialogTitle,\n DialogContent\n ]\n }\n }\n);\n"],"mappings":";;;;AAAA;;AACA;;AACA;;AAOA;;AACA;;AAEA;;AAUA,IAAMA,KAAK,GAAG,IAAAC,iBAAA,EAAU,mBAAV,EAA+BC,MAA/B,CAAd;AACAF,KAAK,CAACG,YAAN,CAAmBC,qBAAnB;AAEAJ,KAAK,CAACK,GAAN,CACI,OADJ,EAEI,YAAM;EACF,IAAMC,IAAI,GAAG,IAAAC,mBAAA,EAAQ,MAAR,EAAgB,KAAhB,CAAb;EAEA,oBACI,6BAAC,YAAD,qBACI,6BAAC,kBAAD,QAAcC,eAAd,CADJ,eAEI,6BAAC,mBAAD;IAAc,KAAK,EAAE;EAArB,gBACI,6BAAC,0BAAD;IAAqB,KAAK,EAAE;EAA5B,2BACW,kDADX,8CAEI,wCAFJ,eAGI,wCAHJ,8CAI+B,iEAJ/B,WAIqE,GAJrE,eAKI,oDALJ,uBAK2B,oDAL3B,kCAK2E,GAL3E,eAMI,0DANJ,wBAMkC,0DANlC,4CAQI,6BAAC,QAAD;IAAQ,IAAI,EAAEF;EAAd,gBACI,6BAAC,aAAD,8BADJ,eAEI,6BAAC,eAAD,2CAFJ,eAGI,6BAAC,eAAD,qBACI,6BAAC,cAAD;IAAc,OAAO,EAAE;MAAA,OAAMG,OAAO,CAACC,GAAR,CAAY,QAAZ,CAAN;IAAA;EAAvB,YADJ,eAII,6BAAC,cAAD;IAAc,OAAO,EAAE;MAAA,OAAMD,OAAO,CAACC,GAAR,CAAY,QAAZ,CAAN;IAAA;EAAvB,QAJJ,CAHJ,CARJ,CADJ,eAsBI,6BAAC,uBAAD,sDAEgBJ,IAFhB,+iBAtBJ,CAFJ,CADJ;AA0CH,CA/CL,EAgDI;EACIK,IAAI,EAAE;IACFC,UAAU,EAAE,CACRC,QADQ,EAERC,cAFQ,EAGRC,cAHQ,EAIRC,cAJQ,EAKRC,eALQ,EAMRC,aANQ,EAORC,eAPQ;EADV;AADV,CAhDJ"}
|
package/Dialog/index.js
CHANGED
|
@@ -1 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _Dialog = require("./Dialog");
|
|
8
|
+
|
|
9
|
+
Object.keys(_Dialog).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (key in exports && exports[key] === _Dialog[key]) return;
|
|
12
|
+
Object.defineProperty(exports, key, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _Dialog[key];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
package/Dialog/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Dialog\";\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
package/Drawer/Drawer.js
CHANGED
|
@@ -1,25 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.DrawerHeader = exports.DrawerContent = exports.Drawer = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _drawer = require("@rmwc/drawer");
|
|
3
13
|
|
|
4
14
|
/**
|
|
5
15
|
* Shows header of the drawer.
|
|
6
16
|
*/
|
|
7
17
|
var DrawerHeader = function DrawerHeader(props) {
|
|
8
|
-
return /*#__PURE__*/
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement(_drawer.DrawerHeader, props);
|
|
9
19
|
};
|
|
10
20
|
|
|
21
|
+
exports.DrawerHeader = DrawerHeader;
|
|
22
|
+
|
|
11
23
|
/**
|
|
12
24
|
* Shows drawer content. It can be anything, but commonly a List component would suffice here.
|
|
13
25
|
*/
|
|
14
26
|
var DrawerContent = function DrawerContent(props) {
|
|
15
|
-
return /*#__PURE__*/
|
|
27
|
+
return /*#__PURE__*/_react.default.createElement(_drawer.DrawerContent, props);
|
|
16
28
|
};
|
|
17
29
|
|
|
30
|
+
exports.DrawerContent = DrawerContent;
|
|
31
|
+
|
|
18
32
|
/**
|
|
19
33
|
* Use Drawer component to display navigation for the whole app or just a small section of it.
|
|
20
34
|
*/
|
|
21
35
|
var Drawer = function Drawer(props) {
|
|
22
|
-
return /*#__PURE__*/
|
|
36
|
+
return /*#__PURE__*/_react.default.createElement(_drawer.Drawer, props);
|
|
23
37
|
};
|
|
24
38
|
|
|
25
|
-
|
|
39
|
+
exports.Drawer = Drawer;
|
package/Drawer/Drawer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["DrawerHeader","props","DrawerContent","Drawer"],"sources":["Drawer.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n Drawer as RmwcDrawer,\n DrawerContent as RmwcDrawerContent,\n DrawerHeader as RmwcDrawerHeader,\n DrawerProps as RmwcDrawerProps,\n DrawerHeaderProps as RmwcDrawerHeaderProps,\n DrawerContentProps as RmwcDrawerContentProps\n} from \"@rmwc/drawer\";\n\ntype DrawerHeaderProps = RmwcDrawerHeaderProps & {\n children: any;\n className?: string;\n};\n\n/**\n * Shows header of the drawer.\n */\nconst DrawerHeader = (props: DrawerHeaderProps) => <RmwcDrawerHeader {...props} />;\n\nexport type DrawerContentProps = RmwcDrawerContentProps & {\n /**\n * Drawer direction.\n */\n dir?: string;\n /**\n * Drawer content.\n */\n children: React.ReactNode;\n\n /**\n * CSS class name\n */\n className?: string;\n};\n\n/**\n * Shows drawer content. It can be anything, but commonly a List component would suffice here.\n */\nconst DrawerContent = (props: DrawerContentProps) => <RmwcDrawerContent {...props} />;\n\ntype DrawerProps = RmwcDrawerProps & {\n /**\n * Drawer direction.\n */\n dir?: string;\n /**\n * Drawer content.\n */\n children: React.ReactNode;\n\n /**\n * CSS class name\n */\n className?: string;\n};\n/**\n * Use Drawer component to display navigation for the whole app or just a small section of it.\n */\nconst Drawer = (props: DrawerProps) => {\n return <RmwcDrawer {...props} />;\n};\n\nexport { Drawer, DrawerHeader, DrawerContent };\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAcA;AACA;AACA;AACA,IAAMA,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD;EAAA,oBAA8B,6BAAC,oBAAD,EAAsBA,KAAtB,CAA9B;AAAA,CAArB;;;;AAkBA;AACA;AACA;AACA,IAAMC,aAAa,GAAG,SAAhBA,aAAgB,CAACD,KAAD;EAAA,oBAA+B,6BAAC,qBAAD,EAAuBA,KAAvB,CAA/B;AAAA,CAAtB;;;;AAiBA;AACA;AACA;AACA,IAAME,MAAM,GAAG,SAATA,MAAS,CAACF,KAAD,EAAwB;EACnC,oBAAO,6BAAC,cAAD,EAAgBA,KAAhB,CAAP;AACH,CAFD"}
|
package/Drawer/Drawer.stories.js
CHANGED
|
@@ -1,23 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
var _react = _interopRequireDefault(require("react"));
|
|
6
|
+
|
|
7
|
+
var _react2 = require("@storybook/react");
|
|
8
|
+
|
|
9
|
+
var _Story = require("@webiny/storybook-utils/Story");
|
|
10
|
+
|
|
11
|
+
var _List = require("./../List");
|
|
12
|
+
|
|
13
|
+
var _README = _interopRequireDefault(require("./../Drawer/README.md"));
|
|
14
|
+
|
|
15
|
+
var _addonKnobs = require("@storybook/addon-knobs");
|
|
16
|
+
|
|
17
|
+
var _Drawer = require("./Drawer");
|
|
18
|
+
|
|
19
|
+
var story = (0, _react2.storiesOf)("Components/Drawer", module);
|
|
20
|
+
story.addDecorator(_addonKnobs.withKnobs);
|
|
10
21
|
story.add("usage", function () {
|
|
11
|
-
var open = boolean("Open", true);
|
|
12
|
-
return /*#__PURE__*/
|
|
22
|
+
var open = (0, _addonKnobs.boolean)("Open", true);
|
|
23
|
+
return /*#__PURE__*/_react.default.createElement(_Story.Story, null, /*#__PURE__*/_react.default.createElement(_Story.StoryReadme, null, _README.default), /*#__PURE__*/_react.default.createElement(_Story.StorySandbox, {
|
|
13
24
|
title: "drawer"
|
|
14
|
-
}, /*#__PURE__*/
|
|
25
|
+
}, /*#__PURE__*/_react.default.createElement(_Story.StorySandboxExample, {
|
|
15
26
|
title: "A list with all possible options"
|
|
16
|
-
}, /*#__PURE__*/
|
|
27
|
+
}, /*#__PURE__*/_react.default.createElement(_Drawer.Drawer, {
|
|
17
28
|
open: open
|
|
18
|
-
}, /*#__PURE__*/
|
|
29
|
+
}, /*#__PURE__*/_react.default.createElement(_Drawer.DrawerHeader, null, "Main Menu"), /*#__PURE__*/_react.default.createElement(_Drawer.DrawerContent, null, /*#__PURE__*/_react.default.createElement(_List.List, null, /*#__PURE__*/_react.default.createElement(_List.ListItem, null, "Users"), /*#__PURE__*/_react.default.createElement(_List.ListItem, null, "Companies"), /*#__PURE__*/_react.default.createElement(_List.ListItem, null, "Brands"), /*#__PURE__*/_react.default.createElement(_List.ListItem, null, "ACL"), /*#__PURE__*/_react.default.createElement(_List.ListItem, null, "Settings"))))), /*#__PURE__*/_react.default.createElement(_Story.StorySandboxCode, null, "\n <Drawer>\n <DrawerHeader>Main Menu</DrawerHeader>\n <DrawerContent>\n <List>\n <ListItem>Users</ListItem>\n <ListItem>Companies</ListItem>\n <ListItem>Brands</ListItem>\n <ListItem>ACL</ListItem>\n <ListItem>Settings</ListItem>\n </List>\n </DrawerContent>\n </Drawer>\n ")));
|
|
19
30
|
}, {
|
|
20
31
|
info: {
|
|
21
|
-
propTables: [Drawer, DrawerHeader, DrawerContent]
|
|
32
|
+
propTables: [_Drawer.Drawer, _Drawer.DrawerHeader, _Drawer.DrawerContent]
|
|
22
33
|
}
|
|
23
34
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["story","storiesOf","module","addDecorator","withKnobs","add","open","boolean","readme","info","propTables","Drawer","DrawerHeader","DrawerContent"],"sources":["Drawer.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport { storiesOf } from \"@storybook/react\";\nimport {\n Story,\n StoryReadme,\n StorySandboxCode,\n StorySandbox,\n StorySandboxExample\n} from \"@webiny/storybook-utils/Story\";\nimport { List, ListItem } from \"./../List\";\n\nimport readme from \"./../Drawer/README.md\";\nimport { withKnobs, boolean } from \"@storybook/addon-knobs\";\nimport { Drawer, DrawerHeader, DrawerContent } from \"./Drawer\";\n\nconst story = storiesOf(\"Components/Drawer\", module);\nstory.addDecorator(withKnobs);\n\nstory.add(\n \"usage\",\n () => {\n const open = boolean(\"Open\", true);\n\n return (\n <Story>\n <StoryReadme>{readme}</StoryReadme>\n <StorySandbox title={\"drawer\"}>\n <StorySandboxExample title={\"A list with all possible options\"}>\n <Drawer open={open}>\n <DrawerHeader>Main Menu</DrawerHeader>\n <DrawerContent>\n <List>\n <ListItem>Users</ListItem>\n <ListItem>Companies</ListItem>\n <ListItem>Brands</ListItem>\n <ListItem>ACL</ListItem>\n <ListItem>Settings</ListItem>\n </List>\n </DrawerContent>\n </Drawer>\n </StorySandboxExample>\n <StorySandboxCode>\n {`\n <Drawer>\n <DrawerHeader>Main Menu</DrawerHeader>\n <DrawerContent>\n <List>\n <ListItem>Users</ListItem>\n <ListItem>Companies</ListItem>\n <ListItem>Brands</ListItem>\n <ListItem>ACL</ListItem>\n <ListItem>Settings</ListItem>\n </List>\n </DrawerContent>\n </Drawer>\n `}\n </StorySandboxCode>\n </StorySandbox>\n </Story>\n );\n },\n { info: { propTables: [Drawer, DrawerHeader, DrawerContent] } }\n);\n"],"mappings":";;;;AAAA;;AACA;;AACA;;AAOA;;AAEA;;AACA;;AACA;;AAEA,IAAMA,KAAK,GAAG,IAAAC,iBAAA,EAAU,mBAAV,EAA+BC,MAA/B,CAAd;AACAF,KAAK,CAACG,YAAN,CAAmBC,qBAAnB;AAEAJ,KAAK,CAACK,GAAN,CACI,OADJ,EAEI,YAAM;EACF,IAAMC,IAAI,GAAG,IAAAC,mBAAA,EAAQ,MAAR,EAAgB,IAAhB,CAAb;EAEA,oBACI,6BAAC,YAAD,qBACI,6BAAC,kBAAD,QAAcC,eAAd,CADJ,eAEI,6BAAC,mBAAD;IAAc,KAAK,EAAE;EAArB,gBACI,6BAAC,0BAAD;IAAqB,KAAK,EAAE;EAA5B,gBACI,6BAAC,cAAD;IAAQ,IAAI,EAAEF;EAAd,gBACI,6BAAC,oBAAD,oBADJ,eAEI,6BAAC,qBAAD,qBACI,6BAAC,UAAD,qBACI,6BAAC,cAAD,gBADJ,eAEI,6BAAC,cAAD,oBAFJ,eAGI,6BAAC,cAAD,iBAHJ,eAII,6BAAC,cAAD,cAJJ,eAKI,6BAAC,cAAD,mBALJ,CADJ,CAFJ,CADJ,CADJ,eAeI,6BAAC,uBAAD,4mBAfJ,CAFJ,CADJ;AAqCH,CA1CL,EA2CI;EAAEG,IAAI,EAAE;IAAEC,UAAU,EAAE,CAACC,cAAD,EAASC,oBAAT,EAAuBC,qBAAvB;EAAd;AAAR,CA3CJ"}
|
package/Drawer/index.js
CHANGED
|
@@ -1 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _Drawer = require("./Drawer");
|
|
8
|
+
|
|
9
|
+
Object.keys(_Drawer).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (key in exports && exports[key] === _Drawer[key]) return;
|
|
12
|
+
Object.defineProperty(exports, key, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _Drawer[key];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
package/Drawer/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Drawer\";\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1,15 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
+
|
|
12
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
+
|
|
14
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
+
|
|
16
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
17
|
+
|
|
18
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
|
+
|
|
20
|
+
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
21
|
+
|
|
22
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
|
+
|
|
24
|
+
var _react = _interopRequireDefault(require("react"));
|
|
25
|
+
|
|
26
|
+
var _dotPropImmutable = _interopRequireDefault(require("dot-prop-immutable"));
|
|
27
|
+
|
|
28
|
+
var _FormElementMessage = require("../FormElementMessage");
|
|
29
|
+
|
|
30
|
+
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
31
|
+
|
|
32
|
+
var DynamicFieldsetRow = /*#__PURE__*/(0, _styled.default)("div", {
|
|
13
33
|
target: "eqcnudi0",
|
|
14
34
|
label: "DynamicFieldsetRow"
|
|
15
35
|
})({
|
|
@@ -20,28 +40,24 @@ var DynamicFieldsetRow = /*#__PURE__*/styled("div", {
|
|
|
20
40
|
});
|
|
21
41
|
|
|
22
42
|
var Fieldset = /*#__PURE__*/function (_React$Component) {
|
|
23
|
-
|
|
43
|
+
(0, _inherits2.default)(Fieldset, _React$Component);
|
|
24
44
|
|
|
25
|
-
var _super =
|
|
45
|
+
var _super = (0, _createSuper2.default)(Fieldset);
|
|
26
46
|
|
|
27
47
|
function Fieldset() {
|
|
28
48
|
var _this;
|
|
29
49
|
|
|
30
|
-
|
|
50
|
+
(0, _classCallCheck2.default)(this, Fieldset);
|
|
31
51
|
|
|
32
52
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
33
53
|
args[_key] = arguments[_key];
|
|
34
54
|
}
|
|
35
55
|
|
|
36
56
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
_defineProperty(_assertThisInitialized(_this), "empty", null);
|
|
43
|
-
|
|
44
|
-
_defineProperty(_assertThisInitialized(_this), "actions", {
|
|
57
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "header", null);
|
|
58
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "rows", null);
|
|
59
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "empty", null);
|
|
60
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "actions", {
|
|
45
61
|
add: function add() {
|
|
46
62
|
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
|
|
47
63
|
return function () {
|
|
@@ -55,15 +71,13 @@ var Fieldset = /*#__PURE__*/function (_React$Component) {
|
|
|
55
71
|
};
|
|
56
72
|
}
|
|
57
73
|
});
|
|
58
|
-
|
|
59
|
-
_defineProperty(_assertThisInitialized(_this), "removeData", function (index) {
|
|
74
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "removeData", function (index) {
|
|
60
75
|
var _this$props = _this.props,
|
|
61
76
|
value = _this$props.value,
|
|
62
77
|
onChange = _this$props.onChange;
|
|
63
|
-
onChange(
|
|
78
|
+
onChange(_dotPropImmutable.default.delete(value, index));
|
|
64
79
|
});
|
|
65
|
-
|
|
66
|
-
_defineProperty(_assertThisInitialized(_this), "addData", function () {
|
|
80
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "addData", function () {
|
|
67
81
|
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
|
|
68
82
|
var onChange = _this.props.onChange;
|
|
69
83
|
var value = _this.props.value;
|
|
@@ -73,18 +87,16 @@ var Fieldset = /*#__PURE__*/function (_React$Component) {
|
|
|
73
87
|
}
|
|
74
88
|
|
|
75
89
|
if (index < 0) {
|
|
76
|
-
onChange([].concat(
|
|
90
|
+
onChange([].concat((0, _toConsumableArray2.default)(value), [{}]));
|
|
77
91
|
} else {
|
|
78
|
-
onChange([].concat(
|
|
92
|
+
onChange([].concat((0, _toConsumableArray2.default)(value.slice(0, index + 1)), [{}], (0, _toConsumableArray2.default)(value.slice(index + 1))));
|
|
79
93
|
}
|
|
80
94
|
});
|
|
81
|
-
|
|
82
|
-
_defineProperty(_assertThisInitialized(_this), "renderHeader", function (cb) {
|
|
95
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderHeader", function (cb) {
|
|
83
96
|
_this.header = cb();
|
|
84
97
|
return null;
|
|
85
98
|
});
|
|
86
|
-
|
|
87
|
-
_defineProperty(_assertThisInitialized(_this), "renderRow", function (cb) {
|
|
99
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderRow", function (cb) {
|
|
88
100
|
var value = _this.props.value;
|
|
89
101
|
|
|
90
102
|
if (!value) {
|
|
@@ -92,7 +104,7 @@ var Fieldset = /*#__PURE__*/function (_React$Component) {
|
|
|
92
104
|
}
|
|
93
105
|
|
|
94
106
|
_this.rows = value.map(function (record, index) {
|
|
95
|
-
return /*#__PURE__*/
|
|
107
|
+
return /*#__PURE__*/_react.default.createElement(DynamicFieldsetRow, {
|
|
96
108
|
key: index
|
|
97
109
|
}, cb({
|
|
98
110
|
data: record,
|
|
@@ -101,16 +113,14 @@ var Fieldset = /*#__PURE__*/function (_React$Component) {
|
|
|
101
113
|
});
|
|
102
114
|
return null;
|
|
103
115
|
});
|
|
104
|
-
|
|
105
|
-
_defineProperty(_assertThisInitialized(_this), "renderEmpty", function (cb) {
|
|
116
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderEmpty", function (cb) {
|
|
106
117
|
_this.empty = cb();
|
|
107
118
|
return null;
|
|
108
119
|
});
|
|
109
|
-
|
|
110
120
|
return _this;
|
|
111
121
|
}
|
|
112
122
|
|
|
113
|
-
|
|
123
|
+
(0, _createClass2.default)(Fieldset, [{
|
|
114
124
|
key: "renderComponent",
|
|
115
125
|
value: function renderComponent() {
|
|
116
126
|
var value = this.props.value;
|
|
@@ -126,7 +136,7 @@ var Fieldset = /*#__PURE__*/function (_React$Component) {
|
|
|
126
136
|
return this.empty;
|
|
127
137
|
}
|
|
128
138
|
|
|
129
|
-
return /*#__PURE__*/
|
|
139
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, this.header, this.rows);
|
|
130
140
|
}
|
|
131
141
|
}, {
|
|
132
142
|
key: "render",
|
|
@@ -137,17 +147,16 @@ var Fieldset = /*#__PURE__*/function (_React$Component) {
|
|
|
137
147
|
validation = _this$props2$validati === void 0 ? {
|
|
138
148
|
isValid: null
|
|
139
149
|
} : _this$props2$validati;
|
|
140
|
-
return /*#__PURE__*/
|
|
150
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, this.renderComponent(), validation.isValid === false && /*#__PURE__*/_react.default.createElement(_FormElementMessage.FormElementMessage, {
|
|
141
151
|
error: true
|
|
142
|
-
}, validation.message), validation.isValid !== false && description && /*#__PURE__*/
|
|
152
|
+
}, validation.message), validation.isValid !== false && description && /*#__PURE__*/_react.default.createElement(_FormElementMessage.FormElementMessage, null, description));
|
|
143
153
|
}
|
|
144
154
|
}]);
|
|
145
|
-
|
|
146
155
|
return Fieldset;
|
|
147
|
-
}(
|
|
156
|
+
}(_react.default.Component);
|
|
148
157
|
|
|
149
|
-
|
|
158
|
+
(0, _defineProperty2.default)(Fieldset, "defaultProps", {
|
|
150
159
|
value: []
|
|
151
160
|
});
|
|
152
|
-
|
|
153
|
-
|
|
161
|
+
var _default = Fieldset;
|
|
162
|
+
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["DynamicFieldsetRow","styled","paddingBottom","padding","Fieldset","add","index","addData","remove","removeData","props","value","onChange","dotProp","delete","slice","cb","header","rows","map","record","data","empty","children","actions","renderHeader","row","renderRow","renderEmpty","length","description","validation","isValid","renderComponent","message","React","Component"],"sources":["Fieldset.tsx"],"sourcesContent":["import React from \"react\";\nimport dotProp from \"dot-prop-immutable\";\nimport { FormElementMessage } from \"~/FormElementMessage\";\nimport styled from \"@emotion/styled\";\n\ninterface ChildrenRenderPropRowCallableParams {\n index: number;\n data: any;\n}\ninterface ChildrenRenderPropRowCallable {\n (params: ChildrenRenderPropRowCallableParams): React.ReactNode;\n}\n\ninterface ChildrenRenderPropHeaderCallable {\n (): React.ReactNode;\n}\ninterface ChildrenRenderPropEmptyCallable {\n (): React.ReactNode;\n}\ninterface ChildrenRenderProp {\n actions: {\n add: Function;\n remove: Function;\n };\n header: (cb: ChildrenRenderPropHeaderCallable) => React.ReactNode;\n row: (cb: ChildrenRenderPropRowCallable) => React.ReactNode;\n empty: (cb: ChildrenRenderPropEmptyCallable) => React.ReactNode;\n}\n\ninterface FieldsetProps {\n value?: any[];\n description?: string;\n validation?: { isValid: null | boolean; message?: string };\n onChange: Function;\n children: (props: ChildrenRenderProp) => React.ReactNode;\n}\n\nconst DynamicFieldsetRow = styled(\"div\")({\n paddingBottom: 10,\n \"> .mdc-layout-grid\": {\n padding: 0\n }\n});\n\nclass Fieldset extends React.Component<FieldsetProps> {\n static defaultProps: Partial<FieldsetProps> = {\n value: []\n };\n\n header: React.ReactNode = null;\n rows: React.ReactNode = null;\n empty: React.ReactNode = null;\n\n actions = {\n add:\n (index = -1) =>\n () =>\n this.addData(index),\n remove:\n (index = -1) =>\n () =>\n this.removeData(index)\n };\n\n removeData = (index: number) => {\n const { value, onChange } = this.props;\n onChange(dotProp.delete(value, index));\n };\n\n addData = (index = -1) => {\n const { onChange } = this.props;\n let value = this.props.value;\n if (!value) {\n value = [];\n }\n if (index < 0) {\n onChange([...value, {}]);\n } else {\n onChange([...value.slice(0, index + 1), {}, ...value.slice(index + 1)]);\n }\n };\n\n renderHeader = (cb: () => React.ReactNode): React.ReactNode => {\n this.header = cb();\n return null;\n };\n\n renderRow = (cb: ChildrenRenderPropRowCallable): React.ReactNode => {\n const { value } = this.props;\n if (!value) {\n return null;\n }\n this.rows = value.map((record, index) => {\n return (\n <DynamicFieldsetRow key={index}>{cb({ data: record, index })}</DynamicFieldsetRow>\n );\n });\n return null;\n };\n\n renderEmpty = (cb: () => React.ReactNode): React.ReactNode => {\n this.empty = cb();\n return null;\n };\n\n public renderComponent(): React.ReactNode {\n const { value } = this.props;\n const { children } = this.props;\n\n children({\n actions: this.actions,\n header: this.renderHeader,\n row: this.renderRow,\n empty: this.renderEmpty\n });\n\n if (!value || value.length === 0) {\n return this.empty;\n }\n\n return (\n <React.Fragment>\n {this.header}\n {this.rows}\n </React.Fragment>\n );\n }\n\n public override render() {\n const { description, validation = { isValid: null } } = this.props;\n\n return (\n <>\n {this.renderComponent()}\n {validation.isValid === false && (\n <FormElementMessage error>{validation.message}</FormElementMessage>\n )}\n\n {validation.isValid !== false && description && (\n <FormElementMessage>{description}</FormElementMessage>\n )}\n </>\n );\n }\n}\n\nexport default Fieldset;\n"],"mappings":"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"}
|
package/DynamicFieldset/index.js
CHANGED
|
@@ -1 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports, "DynamicFieldset", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _Fieldset.default;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
var _Fieldset = _interopRequireDefault(require("./Fieldset"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default as DynamicFieldset } from \"./Fieldset\";\n"],"mappings":";;;;;;;;;;;;;;AAAA"}
|
package/Elevation/Elevation.js
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.Elevation = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _elevation = require("@rmwc/elevation");
|
|
3
13
|
|
|
4
14
|
/**
|
|
5
15
|
* Elevation component visually raises any content by applying shadow.
|
|
6
16
|
*/
|
|
7
|
-
var Elevation = /*#__PURE__*/
|
|
8
|
-
return /*#__PURE__*/
|
|
17
|
+
var Elevation = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement(_elevation.Elevation, Object.assign({
|
|
9
19
|
ref: ref
|
|
10
20
|
}, props), props.children);
|
|
11
21
|
});
|
|
12
|
-
|
|
13
|
-
|
|
22
|
+
|
|
23
|
+
exports.Elevation = Elevation;
|
|
24
|
+
Elevation.displayName = "Elevation";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["Elevation","React","forwardRef","props","ref","children","displayName"],"sources":["Elevation.tsx"],"sourcesContent":["import React from \"react\";\nimport { Elevation as RmwcElevation } from \"@rmwc/elevation\";\n\nexport type ElevationProps = {\n // Any element that needs to be highlighted.\n children?: React.ReactNode;\n\n // Increasing this number (from 0 to 24) will increase the amount of shadow applied.\n z: number;\n\n // Adds smooth transitions when the z value changes.\n transition?: boolean;\n\n // CSS class name\n className?: string;\n\n // Style object\n style?: React.CSSProperties;\n};\n\n/**\n * Elevation component visually raises any content by applying shadow.\n */\nconst Elevation = React.forwardRef((props: ElevationProps, ref: React.Ref<any>) => {\n return (\n <RmwcElevation ref={ref} {...props}>\n {props.children}\n </RmwcElevation>\n );\n});\n\nElevation.displayName = \"Elevation\";\n\nexport { Elevation };\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAmBA;AACA;AACA;AACA,IAAMA,SAAS,gBAAGC,cAAA,CAAMC,UAAN,CAAiB,UAACC,KAAD,EAAwBC,GAAxB,EAAgD;EAC/E,oBACI,6BAAC,oBAAD;IAAe,GAAG,EAAEA;EAApB,GAA6BD,KAA7B,GACKA,KAAK,CAACE,QADX,CADJ;AAKH,CANiB,CAAlB;;;AAQAL,SAAS,CAACM,WAAV,GAAwB,WAAxB"}
|