@vendorflow/components 1.1.25 → 1.1.29
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/components/material-ui/Button/Button.d.ts +0 -1
- package/lib/components/material-ui/Button/Button.js +9 -13
- package/lib/components/material-ui/Button/Button.story.d.ts +0 -1
- package/lib/components/material-ui/ButtonMenu/ButtonMenu.story.d.ts +0 -1
- package/lib/components/material-ui/ChatInterface/ChatInterface.d.ts +0 -1
- package/lib/components/material-ui/ChatInterface/ChatInterface.story.d.ts +0 -1
- package/lib/components/material-ui/ChatInterface/MessageItem.d.ts +0 -1
- package/lib/components/material-ui/InputCheckboxGroup/InputCheckboxGroup.d.ts +2 -1
- package/lib/components/material-ui/InputCheckboxGroup/InputCheckboxGroup.js +2 -2
- package/lib/components/material-ui/InputCheckboxGroup/InputCheckboxGroup.story.d.ts +0 -1
- package/lib/components/material-ui/InputDate/InputDate.d.ts +0 -1
- package/lib/components/material-ui/InputDate/InputDate.story.d.ts +0 -1
- package/lib/components/material-ui/InputDateTime/InputDateTime.d.ts +0 -1
- package/lib/components/material-ui/InputDateTime/InputDateTime.story.d.ts +0 -1
- package/lib/components/material-ui/InputGroup/InputGroup.d.ts +0 -1
- package/lib/components/material-ui/InputGroup/InputGroup.story.d.ts +0 -1
- package/lib/components/material-ui/InputRadioGroup/InputRadioGroup.d.ts +2 -1
- package/lib/components/material-ui/InputRadioGroup/InputRadioGroup.js +24 -2
- package/lib/components/material-ui/InputRadioGroup/InputRadioGroup.story.d.ts +0 -1
- package/lib/components/material-ui/InputSearchDropdown/InputSearchDropdown.story.d.ts +0 -1
- package/lib/components/material-ui/InputTime/InputTime.d.ts +0 -1
- package/lib/components/material-ui/InputTime/InputTime.story.d.ts +0 -1
- package/lib/components/material-ui/Modal/Modal.js +16 -13
- package/lib/components/material-ui/Modal/Modal.story.d.ts +0 -1
- package/package.json +5 -5
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
2
6
|
var __assign = (this && this.__assign) || function () {
|
|
3
7
|
__assign = Object.assign || function(t) {
|
|
4
8
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -21,21 +25,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
25
|
}
|
|
22
26
|
return t;
|
|
23
27
|
};
|
|
24
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
-
};
|
|
27
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
|
|
29
|
+
/** @jsx jsx */
|
|
30
|
+
var react_1 = require("@emotion/react");
|
|
29
31
|
var core_1 = require("@material-ui/core");
|
|
30
|
-
var styles_1 = require("@material-ui/core/styles");
|
|
31
|
-
var useStyles = (0, styles_1.makeStyles)({
|
|
32
|
-
root: {
|
|
33
|
-
color: 'white',
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
32
|
function Button(props) {
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
return (react_1.default.createElement(core_1.Button, __assign({ disabled: disabled || loading, variant: variant }, restOfProps), loading ? react_1.default.createElement(core_1.CircularProgress, { size: "1.6rem", classes: progressClasses || classes }) : children));
|
|
33
|
+
var children = props.children, disabled = props.disabled, loading = props.loading, _a = props.variant, variant = _a === void 0 ? 'contained' : _a, restOfProps = __rest(props, ["children", "disabled", "loading", "variant"]);
|
|
34
|
+
return ((0, react_1.jsx)(core_1.Button, __assign({ disabled: disabled || loading, variant: variant }, restOfProps), loading ? ((0, react_1.jsx)(core_1.CircularProgress, { css: (0, react_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n && {\n color: white;\n }\n "], ["\n && {\n color: white;\n }\n "]))), size: "1.6rem" })) : (children)));
|
|
40
35
|
}
|
|
41
36
|
exports.default = Button;
|
|
37
|
+
var templateObject_1;
|
|
@@ -27,7 +27,7 @@ var immer_1 = __importDefault(require("immer"));
|
|
|
27
27
|
var lodash_1 = require("lodash");
|
|
28
28
|
var core_1 = require("@material-ui/core");
|
|
29
29
|
function InputCheckboxGroup(props) {
|
|
30
|
-
var _a = props.color, color = _a === void 0 ? 'primary' : _a, disabled = props.disabled, error = props.error, helperText = props.helperText, label = props.label, name = props.name, onChange = props.onChange, options = props.options, _b = props.multi, multi = _b === void 0 ? true : _b;
|
|
30
|
+
var className = props.className, style = props.style, _a = props.color, color = _a === void 0 ? 'primary' : _a, disabled = props.disabled, error = props.error, helperText = props.helperText, label = props.label, name = props.name, onChange = props.onChange, options = props.options, _b = props.multi, multi = _b === void 0 ? true : _b;
|
|
31
31
|
var _c = (0, react_1.useState)({}), values = _c[0], setValues = _c[1];
|
|
32
32
|
(0, react_1.useEffect)(function () {
|
|
33
33
|
var newValues = {};
|
|
@@ -75,7 +75,7 @@ function InputCheckboxGroup(props) {
|
|
|
75
75
|
return (react_1.default.createElement(core_1.FormControlLabel, { key: label, label: label, control: react_1.default.createElement(core_1.Checkbox, { color: color, disabled: disabled, onChange: handleOnChange, checked: values[value] || false, name: label }) }));
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
-
return (react_1.default.createElement(core_1.FormControl, { component: "fieldset", error: error },
|
|
78
|
+
return (react_1.default.createElement(core_1.FormControl, { className: className, style: style, component: "fieldset", error: error },
|
|
79
79
|
react_1.default.createElement(core_1.FormLabel, { component: "legend" }, label),
|
|
80
80
|
react_1.default.createElement(core_1.FormGroup, null, !(0, lodash_1.isEmpty)(options) ? renderOptions() : react_1.default.createElement("div", null)),
|
|
81
81
|
react_1.default.createElement(core_1.FormHelperText, null, helperText)));
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
14
|
if (k2 === undefined) k2 = k;
|
|
4
15
|
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
@@ -18,11 +29,22 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
18
29
|
__setModuleDefault(result, mod);
|
|
19
30
|
return result;
|
|
20
31
|
};
|
|
32
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
33
|
+
var t = {};
|
|
34
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
35
|
+
t[p] = s[p];
|
|
36
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
37
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
38
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
39
|
+
t[p[i]] = s[p[i]];
|
|
40
|
+
}
|
|
41
|
+
return t;
|
|
42
|
+
};
|
|
21
43
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
44
|
var react_1 = __importStar(require("react"));
|
|
23
45
|
var core_1 = require("@material-ui/core");
|
|
24
46
|
function InputRadioGroup(props) {
|
|
25
|
-
var _a = props.color, color = _a === void 0 ? 'primary' : _a, disabled = props.disabled, error = props.error, helperText = props.helperText, label = props.label, name = props.name, onChange = props.onChange, options = props.options, _b = props.row, row = _b === void 0 ? false : _b;
|
|
47
|
+
var _a = props.color, color = _a === void 0 ? 'primary' : _a, disabled = props.disabled, error = props.error, helperText = props.helperText, label = props.label, name = props.name, onChange = props.onChange, options = props.options, _b = props.row, row = _b === void 0 ? false : _b, restOfProps = __rest(props, ["color", "disabled", "error", "helperText", "label", "name", "onChange", "options", "row"]);
|
|
26
48
|
var _c = (0, react_1.useState)(null), value = _c[0], setValue = _c[1];
|
|
27
49
|
(0, react_1.useEffect)(function () {
|
|
28
50
|
if (props.value !== value) {
|
|
@@ -36,7 +58,7 @@ function InputRadioGroup(props) {
|
|
|
36
58
|
function renderOptions() {
|
|
37
59
|
return options.map(function (option) { return (react_1.default.createElement(core_1.FormControlLabel, { key: option.label, value: option.value, label: option.label, control: react_1.default.createElement(core_1.Radio, { color: color, disabled: disabled }) })); });
|
|
38
60
|
}
|
|
39
|
-
return (react_1.default.createElement(core_1.FormControl, { component: "fieldset", error: error },
|
|
61
|
+
return (react_1.default.createElement(core_1.FormControl, __assign({ component: "fieldset", error: error }, restOfProps),
|
|
40
62
|
react_1.default.createElement(core_1.FormLabel, { component: "legend" }, label),
|
|
41
63
|
react_1.default.createElement(core_1.RadioGroup, { name: name, value: value, onChange: handleOnChange, row: row }, renderOptions()),
|
|
42
64
|
react_1.default.createElement(core_1.FormHelperText, null, helperText)));
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
2
6
|
var __assign = (this && this.__assign) || function () {
|
|
3
7
|
__assign = Object.assign || function(t) {
|
|
4
8
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -25,22 +29,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
25
29
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
30
|
};
|
|
27
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
|
|
32
|
+
/** @jsx jsx */
|
|
33
|
+
var react_1 = require("@emotion/react");
|
|
29
34
|
var core_1 = require("@material-ui/core");
|
|
30
35
|
var Button_1 = __importDefault(require("../Button"));
|
|
31
|
-
var useSubmitBtnStyles = (0, core_1.makeStyles)({
|
|
32
|
-
root: {
|
|
33
|
-
color: '#3f51b5',
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
36
|
function Modal(props) {
|
|
37
37
|
var children = props.children, classes = props.classes, cancelButton = props.cancelButton, okayButton = props.okayButton, onClose = props.onClose, submitting = props.submitting, open = props.open, title = props.title, restOfProps = __rest(props, ["children", "classes", "cancelButton", "okayButton", "onClose", "submitting", "open", "title"]);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
react_1.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
return ((0, react_1.jsx)(core_1.Dialog, __assign({}, restOfProps, { classes: classes, open: open, onClose: onClose }),
|
|
39
|
+
(0, react_1.jsx)(core_1.DialogTitle, null, title),
|
|
40
|
+
(0, react_1.jsx)(core_1.DialogContent, null, typeof children === 'string' ? (0, react_1.jsx)(core_1.DialogContentText, null, children) : children),
|
|
41
|
+
(0, react_1.jsx)(core_1.DialogActions, null,
|
|
42
|
+
cancelButton && ((0, react_1.jsx)(Button_1.default, { color: "default", variant: "text", disabled: cancelButton.disabled || submitting, onClick: cancelButton.onClick }, cancelButton.text)),
|
|
43
|
+
okayButton && ((0, react_1.jsx)(Button_1.default, { css: function (theme) {
|
|
44
|
+
var _a, _b;
|
|
45
|
+
return (0, react_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &&.MuiButton-root .MuiCircularProgress-root {\n color: ", ";\n }\n "], ["\n &&.MuiButton-root .MuiCircularProgress-root {\n color: ", ";\n }\n "])), ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.primary) === null || _b === void 0 ? void 0 : _b.main) || 'hsl(321, 53%, 31%)');
|
|
46
|
+
}, color: "primary", variant: "text", disabled: okayButton.disabled, onClick: okayButton.onClick, loading: submitting }, okayButton.text)))));
|
|
45
47
|
}
|
|
46
48
|
exports.default = Modal;
|
|
49
|
+
var templateObject_1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vendorflow/components",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.29",
|
|
4
4
|
"description": "React components for vendorflow",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"@testing-library/user-event": "^7.1.2",
|
|
63
63
|
"@types/jest": "^24.0.0",
|
|
64
64
|
"@types/node": "^12.0.0",
|
|
65
|
-
"@types/react": "^
|
|
66
|
-
"@types/react-dom": "^
|
|
65
|
+
"@types/react": "^17.0.27",
|
|
66
|
+
"@types/react-dom": "^17.0.9",
|
|
67
67
|
"@typescript-eslint/eslint-plugin": "^4.32.0",
|
|
68
68
|
"@typescript-eslint/parser": "^4.32.0",
|
|
69
69
|
"babel-eslint": "10.1.0",
|
|
@@ -103,10 +103,10 @@
|
|
|
103
103
|
"postcss-normalize": "8.0.1",
|
|
104
104
|
"postcss-preset-env": "6.7.0",
|
|
105
105
|
"postcss-safe-parser": "4.0.1",
|
|
106
|
-
"react": "^
|
|
106
|
+
"react": "^17.0.2",
|
|
107
107
|
"react-app-polyfill": "^1.0.6",
|
|
108
108
|
"react-dev-utils": "^10.2.1",
|
|
109
|
-
"react-dom": "^
|
|
109
|
+
"react-dom": "^17.0.2",
|
|
110
110
|
"react-measure": "^2.5.2",
|
|
111
111
|
"react-scripts": "^3.4.1",
|
|
112
112
|
"react-text-mask": "^5.4.3",
|