tenjin-ui-kit 0.3.72-dev-1 → 0.3.73
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/common/hooks/apiHooks.js +91 -199
- package/common/hooks/newApiHook.js +127 -258
- package/common/utils/security/index.js +2 -2
- package/common/utils/security/securityConfig.js +1 -2
- package/components/Canvas.js +172 -101
- package/components/DragBox/index.js +21 -31
- package/components/InputWithChip/index.js +178 -83
- package/components/RightContext/index.js +17 -41
- package/components/WorkFlow.js +19 -29
- package/components/WorkFlowBuilder.js +32 -56
- package/components/alert/Style.js +11 -14
- package/components/alert/index.js +8 -14
- package/components/attachment/index.js +26 -31
- package/components/authenticationProvider/AuthError.js +3 -4
- package/components/authenticationProvider/AuthLoader.js +3 -4
- package/components/authenticationProvider/index.js +58 -130
- package/components/avatar/index.js +24 -23
- package/components/avatar/styles.js +76 -77
- package/components/breadCrumbs/index.js +64 -89
- package/components/breadCrumbs/style.js +1 -4
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/index.js +7 -6
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/style.js +5 -8
- package/components/browsingTestCaseLayout/DetailsViewLayout/DetailsViewHeader/index.js +7 -6
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewContent/Index.js +8 -7
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/Index.js +8 -7
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/style.js +16 -19
- package/components/browsingTestCaseLayout/index.js +30 -46
- package/components/button/index.js +47 -58
- package/components/chatBotModal/index.js +40 -61
- package/components/checkBox/index.js +8 -10
- package/components/combobox/index.js +66 -100
- package/components/divider/index.js +9 -18
- package/components/editableField/index.js +19 -46
- package/components/error/index.js +6 -12
- package/components/errorBoundary/index.js +74 -98
- package/components/fileUploader/index.js +46 -58
- package/components/fileUploader/style.js +46 -49
- package/components/filter/ValueSelector.js +149 -245
- package/components/filter/index.js +45 -71
- package/components/iconButton/index.js +3 -4
- package/components/input/index.js +60 -74
- package/components/layout/index.js +36 -49
- package/components/layout/main/index.js +13 -14
- package/components/layout/main/style.js +11 -14
- package/components/layout/pageContent/index.js +8 -7
- package/components/layout/sidebar/FlatMenu.js +51 -47
- package/components/layout/sidebar/GroupedIconMenu.js +169 -194
- package/components/layout/sidebar/GroupedMenu.js +45 -50
- package/components/layout/sidebar/ProjectMenu.js +165 -185
- package/components/layout/sidebar/index.js +27 -26
- package/components/layout/sidebar/style.js +138 -143
- package/components/layout/topBar/ProjectTopbar.js +91 -208
- package/components/layout/topBar/UserAvatar.js +53 -69
- package/components/layout/topBar/index.js +23 -41
- package/components/loader/index.js +9 -12
- package/components/menu/index.js +23 -42
- package/components/modal/Modal.js +5 -6
- package/components/modal/index.js +16 -20
- package/components/modal/style.js +53 -56
- package/components/optionMenu/index.js +32 -47
- package/components/pagination/index.js +23 -43
- package/components/pagination/style.js +25 -28
- package/components/paginationUpdated/index.js +22 -29
- package/components/paper/index.js +20 -22
- package/components/paper/style.js +24 -27
- package/components/reactSelect/index.js +64 -97
- package/components/reactSelect/style.js +131 -151
- package/components/richTextEditor/index.js +24 -48
- package/components/select/GroupedSelect.js +96 -99
- package/components/select/SimpleSelect.js +61 -103
- package/components/select/index.js +56 -69
- package/components/simpleSelect/index.js +18 -22
- package/components/sort/index.js +23 -36
- package/components/switch/index.js +14 -15
- package/components/switch/style.js +29 -32
- package/components/switch/switch.js +30 -47
- package/components/table/ReactTable.js +59 -83
- package/components/table/SimpleTable.js +67 -91
- package/components/table/index.js +300 -206
- package/components/text/index.js +22 -30
- package/components/timeStamp/index.js +4 -9
- package/components/timeStamp/style.js +12 -15
- package/components/topBar/index.js +86 -102
- package/components/tree/index.js +30 -58
- package/components/tree/style.js +20 -23
- package/components/valuePicker/ValueSelector.js +78 -160
- package/components/valuePicker/index.js +30 -50
- package/components/wrapperLayout/layout/index.js +8 -7
- package/components/wrapperLayout/main/index.js +8 -7
- package/components/wrapperLayout/main/pageContainer/index.js +6 -5
- package/components/wrapperLayout/main/sideBar/index.js +171 -175
- package/components/wrapperLayout/main/sideBar/style.js +177 -183
- package/components/wrapperLayout/topBar/UserAvatar.js +6 -5
- package/components/wrapperLayout/topBar/avatar.js +15 -18
- package/components/wrapperLayout/topBar/index.js +115 -107
- package/components/wrapperLayout/topBar/menuIcon.js +6 -5
- package/components/wrapperLayout/topBar/style.js +63 -64
- package/http/index.js +92 -188
- package/index.js +53 -55
- package/package.json +3 -3
- package/templates/listPage/index.js +168 -196
- package/themes/default.js +5 -7
- package/themes/defaultSmall.js +2 -3
- package/themes/responsiveTheme.js +6 -8
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -12,33 +11,31 @@ var _CheckBox = _interopRequireDefault(require("@mui/icons-material/CheckBox"));
|
|
|
12
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
12
|
var _responsiveTheme = _interopRequireDefault(require("../../themes/responsiveTheme"));
|
|
14
13
|
var _text = _interopRequireDefault(require("../text"));
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
rest = _objectWithoutProperties(props, _excluded);
|
|
38
|
-
var icon = /*#__PURE__*/_react.default.createElement(_CheckBoxOutlineBlank.default, {
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
17
|
+
const ReactSelect = props => {
|
|
18
|
+
const {
|
|
19
|
+
options,
|
|
20
|
+
isMulti,
|
|
21
|
+
checkBox,
|
|
22
|
+
defaultValue,
|
|
23
|
+
value,
|
|
24
|
+
onChange,
|
|
25
|
+
placeholder,
|
|
26
|
+
label,
|
|
27
|
+
fullWidth,
|
|
28
|
+
error,
|
|
29
|
+
helperText,
|
|
30
|
+
blueTheme,
|
|
31
|
+
isRequired,
|
|
32
|
+
isDisabled,
|
|
33
|
+
...rest
|
|
34
|
+
} = props;
|
|
35
|
+
const icon = /*#__PURE__*/_react.default.createElement(_CheckBoxOutlineBlank.default, {
|
|
39
36
|
fontSize: "small"
|
|
40
37
|
});
|
|
41
|
-
|
|
38
|
+
const checkedIcon = /*#__PURE__*/_react.default.createElement(_CheckBox.default, {
|
|
42
39
|
fontSize: "small"
|
|
43
40
|
});
|
|
44
41
|
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_material.FormControl, {
|
|
@@ -70,14 +67,14 @@ var ReactSelect = function ReactSelect(props) {
|
|
|
70
67
|
options: options
|
|
71
68
|
// disableCloseOnSelect
|
|
72
69
|
,
|
|
73
|
-
getOptionLabel:
|
|
74
|
-
return option === null || option === void 0 ? void 0 : option.label;
|
|
75
|
-
},
|
|
70
|
+
getOptionLabel: option => option?.label,
|
|
76
71
|
value: value,
|
|
77
72
|
onChange: onChange,
|
|
78
73
|
defaultValue: [options[1]],
|
|
79
|
-
renderOption:
|
|
80
|
-
|
|
74
|
+
renderOption: (props, option, _ref) => {
|
|
75
|
+
let {
|
|
76
|
+
selected
|
|
77
|
+
} = _ref;
|
|
81
78
|
return /*#__PURE__*/_react.default.createElement("li", props, /*#__PURE__*/_react.default.createElement(_material.Checkbox, {
|
|
82
79
|
icon: icon,
|
|
83
80
|
checkedIcon: checkedIcon,
|
|
@@ -85,14 +82,12 @@ var ReactSelect = function ReactSelect(props) {
|
|
|
85
82
|
marginRight: 8
|
|
86
83
|
},
|
|
87
84
|
checked: selected
|
|
88
|
-
}), /*#__PURE__*/_react.default.createElement(_text.default, null, option
|
|
85
|
+
}), /*#__PURE__*/_react.default.createElement(_text.default, null, option?.label));
|
|
89
86
|
},
|
|
90
|
-
renderInput:
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}));
|
|
95
|
-
}
|
|
87
|
+
renderInput: params => /*#__PURE__*/_react.default.createElement(_material.TextField, _extends({}, params, {
|
|
88
|
+
placeholder: placeholder,
|
|
89
|
+
helperText: helperText
|
|
90
|
+
}))
|
|
96
91
|
})), !checkBox && !blueTheme && /*#__PURE__*/_react.default.createElement(_material.Autocomplete, _extends({}, rest, {
|
|
97
92
|
filterSelectedOptions: true,
|
|
98
93
|
disabled: isDisabled,
|
|
@@ -100,9 +95,7 @@ var ReactSelect = function ReactSelect(props) {
|
|
|
100
95
|
options: options
|
|
101
96
|
// disableCloseOnSelect
|
|
102
97
|
,
|
|
103
|
-
getOptionLabel:
|
|
104
|
-
return option.label ? option.label : "";
|
|
105
|
-
},
|
|
98
|
+
getOptionLabel: option => option.label ? option.label : "",
|
|
106
99
|
value: value,
|
|
107
100
|
defaultValue: [defaultValue],
|
|
108
101
|
onChange: onChange,
|
|
@@ -115,16 +108,14 @@ var ReactSelect = function ReactSelect(props) {
|
|
|
115
108
|
color: isDisabled && "#000000"
|
|
116
109
|
}
|
|
117
110
|
},
|
|
118
|
-
renderInput:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}));
|
|
127
|
-
}
|
|
111
|
+
renderInput: params => /*#__PURE__*/_react.default.createElement(_material.TextField, _extends({
|
|
112
|
+
error: error
|
|
113
|
+
}, params, {
|
|
114
|
+
variant: "outlined",
|
|
115
|
+
fullWidth: true,
|
|
116
|
+
placeholder: placeholder,
|
|
117
|
+
helperText: helperText
|
|
118
|
+
}))
|
|
128
119
|
})), blueTheme && /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
129
120
|
container: true,
|
|
130
121
|
sx: {
|
|
@@ -146,8 +137,10 @@ var ReactSelect = function ReactSelect(props) {
|
|
|
146
137
|
color: "#F4F7FC"
|
|
147
138
|
}
|
|
148
139
|
},
|
|
149
|
-
PaperComponent:
|
|
150
|
-
|
|
140
|
+
PaperComponent: _ref2 => {
|
|
141
|
+
let {
|
|
142
|
+
children
|
|
143
|
+
} = _ref2;
|
|
151
144
|
return /*#__PURE__*/_react.default.createElement(_material.Paper, {
|
|
152
145
|
style: {
|
|
153
146
|
background: "#6e6ba1",
|
|
@@ -164,26 +157,21 @@ var ReactSelect = function ReactSelect(props) {
|
|
|
164
157
|
filterSelectedOptions: true
|
|
165
158
|
// disableCloseOnSelect
|
|
166
159
|
,
|
|
167
|
-
getOptionLabel:
|
|
168
|
-
return option.label;
|
|
169
|
-
},
|
|
160
|
+
getOptionLabel: option => option.label,
|
|
170
161
|
value: value,
|
|
171
162
|
defaultValue: [defaultValue],
|
|
172
163
|
onChange: onChange,
|
|
173
|
-
renderInput:
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}));
|
|
182
|
-
}
|
|
164
|
+
renderInput: params => /*#__PURE__*/_react.default.createElement(_material.TextField, _extends({
|
|
165
|
+
error: error
|
|
166
|
+
}, params, {
|
|
167
|
+
variant: "outlined",
|
|
168
|
+
fullWidth: true,
|
|
169
|
+
placeholder: placeholder,
|
|
170
|
+
helperText: helperText
|
|
171
|
+
}))
|
|
183
172
|
// sx={{ }}
|
|
184
173
|
})))));
|
|
185
174
|
};
|
|
186
|
-
|
|
187
175
|
ReactSelect.propTypes = {
|
|
188
176
|
value: _propTypes.default.string,
|
|
189
177
|
className: _propTypes.default.string,
|
|
@@ -213,5 +201,4 @@ ReactSelect.defaultProps = {
|
|
|
213
201
|
isSearch: false,
|
|
214
202
|
loading: false
|
|
215
203
|
};
|
|
216
|
-
var _default = ReactSelect;
|
|
217
|
-
exports.default = _default;
|
|
204
|
+
var _default = exports.default = ReactSelect;
|
|
@@ -6,20 +6,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _material = require("@mui/material");
|
|
8
8
|
var _text = _interopRequireDefault(require("../text"));
|
|
9
|
-
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
11
|
+
const SimpleSelect = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
options,
|
|
14
|
+
errorMessage,
|
|
15
|
+
error,
|
|
16
|
+
fullWidth,
|
|
17
|
+
isDisabled,
|
|
18
|
+
label,
|
|
19
|
+
isRequired,
|
|
20
|
+
...rest
|
|
21
|
+
} = _ref;
|
|
23
22
|
console.log(errorMessage, error, "error");
|
|
24
23
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_material.FormControl, {
|
|
25
24
|
sx: {
|
|
@@ -45,12 +44,9 @@ var SimpleSelect = function SimpleSelect(_ref) {
|
|
|
45
44
|
}
|
|
46
45
|
}, " * ") : "")), /*#__PURE__*/React.createElement(_material.Select, _extends({}, rest, {
|
|
47
46
|
fullWidth: true
|
|
48
|
-
}), options.map(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}, option.label);
|
|
53
|
-
})), error && /*#__PURE__*/React.createElement(_material.FormHelperText, null, errorMessage)));
|
|
47
|
+
}), options.map(option => /*#__PURE__*/React.createElement(_material.MenuItem, {
|
|
48
|
+
key: option.value,
|
|
49
|
+
value: option.value
|
|
50
|
+
}, option.label))), error && /*#__PURE__*/React.createElement(_material.FormHelperText, null, errorMessage)));
|
|
54
51
|
};
|
|
55
|
-
var _default = SimpleSelect;
|
|
56
|
-
exports.default = _default;
|
|
52
|
+
var _default = exports.default = SimpleSelect;
|
package/components/sort/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -16,49 +15,38 @@ var _bi = require("react-icons/bi");
|
|
|
16
15
|
var _text = _interopRequireDefault(require("../text"));
|
|
17
16
|
var _button = _interopRequireDefault(require("../button"));
|
|
18
17
|
var _divider = _interopRequireDefault(require("../divider"));
|
|
19
|
-
function _interopRequireDefault(
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
variant = _ref.variant,
|
|
32
|
-
columnName = _ref.columnName,
|
|
33
|
-
options = _ref.options,
|
|
34
|
-
defaultSelectedOptions = _ref.defaultSelectedOptions;
|
|
18
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
20
|
+
// import { Button, Divider, Text } from "tenjin-ui-kit";
|
|
21
|
+
|
|
22
|
+
const Sort = _ref => {
|
|
23
|
+
let {
|
|
24
|
+
onChange,
|
|
25
|
+
variant,
|
|
26
|
+
columnName,
|
|
27
|
+
options,
|
|
28
|
+
defaultSelectedOptions
|
|
29
|
+
} = _ref;
|
|
35
30
|
console.log({
|
|
36
|
-
defaultSelectedOptions
|
|
31
|
+
defaultSelectedOptions
|
|
37
32
|
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
setMenuAnchor = _useState2[1];
|
|
43
|
-
var _React$useState = _react.default.useState(defaultSelectedOptions ? defaultSelectedOptions : (_options$ = options[0]) === null || _options$ === void 0 ? void 0 : _options$.value),
|
|
44
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
45
|
-
value = _React$useState2[0],
|
|
46
|
-
setValue = _React$useState2[1];
|
|
47
|
-
(0, _react.useEffect)(function () {
|
|
33
|
+
const theme = (0, _material.useTheme)();
|
|
34
|
+
const [menuAnchor, setMenuAnchor] = (0, _react.useState)(null);
|
|
35
|
+
const [value, setValue] = _react.default.useState(defaultSelectedOptions ? defaultSelectedOptions : options[0]?.value);
|
|
36
|
+
(0, _react.useEffect)(() => {
|
|
48
37
|
if (!defaultSelectedOptions) {
|
|
49
|
-
|
|
50
|
-
setValue((_options$2 = options[0]) === null || _options$2 === void 0 ? void 0 : _options$2.value);
|
|
38
|
+
setValue(options[0]?.value);
|
|
51
39
|
} else {
|
|
52
40
|
setValue(defaultSelectedOptions);
|
|
53
41
|
}
|
|
54
42
|
}, [defaultSelectedOptions]);
|
|
55
|
-
|
|
43
|
+
const handleMenuClose = () => {
|
|
56
44
|
setMenuAnchor(null);
|
|
57
45
|
};
|
|
58
|
-
|
|
46
|
+
const handleMenuOpen = e => {
|
|
59
47
|
setMenuAnchor(e.currentTarget);
|
|
60
48
|
};
|
|
61
|
-
|
|
49
|
+
const handleChange = event => {
|
|
62
50
|
setValue(event.target.value);
|
|
63
51
|
onChange(event.target.value);
|
|
64
52
|
};
|
|
@@ -129,7 +117,7 @@ var Sort = function Sort(_ref) {
|
|
|
129
117
|
name: "controlled-radio-buttons-group",
|
|
130
118
|
value: value,
|
|
131
119
|
onChange: handleChange
|
|
132
|
-
}, options
|
|
120
|
+
}, options?.map(a => {
|
|
133
121
|
return /*#__PURE__*/_react.default.createElement(_FormControlLabel.default, {
|
|
134
122
|
value: a.value,
|
|
135
123
|
control: /*#__PURE__*/_react.default.createElement(_Radio.default, null),
|
|
@@ -137,5 +125,4 @@ var Sort = function Sort(_ref) {
|
|
|
137
125
|
});
|
|
138
126
|
})))));
|
|
139
127
|
};
|
|
140
|
-
var _default = Sort;
|
|
141
|
-
exports.default = _default;
|
|
128
|
+
var _default = exports.default = Sort;
|
|
@@ -9,17 +9,17 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _default2 = _interopRequireDefault(require("../../themes/default"));
|
|
10
10
|
var _styles = require("@mui/material/styles");
|
|
11
11
|
var _text = _interopRequireDefault(require("../text"));
|
|
12
|
-
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
14
|
+
const Switch = props => {
|
|
15
|
+
const {
|
|
16
|
+
label,
|
|
17
|
+
...rest
|
|
18
|
+
} = props;
|
|
19
|
+
const MuiSwitchStyledComp = (0, _styles.styled)(_material.Switch)(_ref => {
|
|
20
|
+
let {
|
|
21
|
+
MuiSwitch
|
|
22
|
+
} = _ref;
|
|
23
23
|
return {
|
|
24
24
|
padding: 10,
|
|
25
25
|
marginTop: "-6px",
|
|
@@ -27,7 +27,7 @@ var Switch = function Switch(props) {
|
|
|
27
27
|
borderRadius: 20 / 2
|
|
28
28
|
},
|
|
29
29
|
"& .Mui-checked": {
|
|
30
|
-
color:
|
|
30
|
+
color: `${_default2.default.palette.white.main} !important`
|
|
31
31
|
},
|
|
32
32
|
"& .MuiSwitch-thumb": {
|
|
33
33
|
margin: "5px 0px 0px 5px",
|
|
@@ -35,7 +35,7 @@ var Switch = function Switch(props) {
|
|
|
35
35
|
height: 10
|
|
36
36
|
},
|
|
37
37
|
"& .MuiSwitch-switchBase.Mui-checked+.MuiSwitch-track": {
|
|
38
|
-
backgroundColor:
|
|
38
|
+
backgroundColor: _default2.default.palette[`${props.color.toString().toLowerCase()}`]?.main,
|
|
39
39
|
opacity: 1
|
|
40
40
|
},
|
|
41
41
|
"& .MuiSwitch-switchBase.Mui-disabled+.MuiSwitch-track": {
|
|
@@ -68,5 +68,4 @@ Switch.defaultProps = {
|
|
|
68
68
|
defaultChecked: true,
|
|
69
69
|
labelPlacement: "right"
|
|
70
70
|
};
|
|
71
|
-
var _default = Switch;
|
|
72
|
-
exports.default = _default;
|
|
71
|
+
var _default = exports.default = Switch;
|
|
@@ -6,37 +6,34 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _styles = require("@mui/styles");
|
|
8
8
|
var _default2 = _interopRequireDefault(require("../../themes/default"));
|
|
9
|
-
function _interopRequireDefault(
|
|
10
|
-
var _default = (0, _styles.makeStyles)(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
fontWeight: "".concat(500, " !important")
|
|
16
|
-
},
|
|
17
|
-
"@media (min-width:769px) and (max-width:1100px)": {
|
|
18
|
-
fontSize: "1.3rem !important",
|
|
19
|
-
fontWeight: "".concat(500, " !important")
|
|
20
|
-
},
|
|
21
|
-
"@media (min-width:600px) and (max-width:768px)": {
|
|
22
|
-
fontSize: "1rem",
|
|
23
|
-
fontWeight: "".concat(500, " !important")
|
|
24
|
-
}
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
var _default = exports.default = (0, _styles.makeStyles)(() => ({
|
|
11
|
+
labelLarge: {
|
|
12
|
+
"@media (min-width:1101px) and (max-width:1200px)": {
|
|
13
|
+
fontSize: "1.5rem !important",
|
|
14
|
+
fontWeight: `${500} !important`
|
|
25
15
|
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
fontWeight: "".concat(500, " !important")
|
|
34
|
-
},
|
|
35
|
-
"@media (min-width:600px) and (max-width:768px)": {
|
|
36
|
-
fontSize: "0.75rem",
|
|
37
|
-
fontWeight: "".concat(500, " !important")
|
|
38
|
-
}
|
|
16
|
+
"@media (min-width:769px) and (max-width:1100px)": {
|
|
17
|
+
fontSize: "1.3rem !important",
|
|
18
|
+
fontWeight: `${500} !important`
|
|
19
|
+
},
|
|
20
|
+
"@media (min-width:600px) and (max-width:768px)": {
|
|
21
|
+
fontSize: "1rem",
|
|
22
|
+
fontWeight: `${500} !important`
|
|
39
23
|
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
24
|
+
},
|
|
25
|
+
labelSmall: {
|
|
26
|
+
"@media (min-width:1101px) and (max-width:1200px)": {
|
|
27
|
+
fontSize: "0.85rem !important",
|
|
28
|
+
fontWeight: `${500} !important`
|
|
29
|
+
},
|
|
30
|
+
"@media (min-width:769px) and (max-width:1100px)": {
|
|
31
|
+
fontSize: "0.75rem !important",
|
|
32
|
+
fontWeight: `${500} !important`
|
|
33
|
+
},
|
|
34
|
+
"@media (min-width:600px) and (max-width:768px)": {
|
|
35
|
+
fontSize: "0.75rem",
|
|
36
|
+
fontWeight: `${500} !important`
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}));
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -13,17 +12,12 @@ var _material = require("@mui/material");
|
|
|
13
12
|
var _style = _interopRequireDefault(require("./style"));
|
|
14
13
|
var _default = _interopRequireDefault(require("../../themes/default"));
|
|
15
14
|
var _text = _interopRequireDefault(require("../text"));
|
|
16
|
-
function _interopRequireDefault(
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
23
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
24
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
25
|
-
var MuiSwitchStyledComp = (0, _styles.styled)(_material.Switch)(function (_ref) {
|
|
26
|
-
var MuiSwitch = _ref.MuiSwitch;
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
17
|
+
const MuiSwitchStyledComp = (0, _styles.styled)(_material.Switch)(_ref => {
|
|
18
|
+
let {
|
|
19
|
+
MuiSwitch
|
|
20
|
+
} = _ref;
|
|
27
21
|
return {
|
|
28
22
|
padding: 10,
|
|
29
23
|
marginTop: "-6px",
|
|
@@ -31,7 +25,7 @@ var MuiSwitchStyledComp = (0, _styles.styled)(_material.Switch)(function (_ref)
|
|
|
31
25
|
borderRadius: 20 / 2
|
|
32
26
|
},
|
|
33
27
|
"& .Mui-checked": {
|
|
34
|
-
color:
|
|
28
|
+
color: `${_default.default.palette.white.main} !important`
|
|
35
29
|
},
|
|
36
30
|
"& .MuiSwitch-thumb": {
|
|
37
31
|
margin: "5px 0px 0px 5px",
|
|
@@ -55,18 +49,14 @@ var MuiSwitchStyledComp = (0, _styles.styled)(_material.Switch)(function (_ref)
|
|
|
55
49
|
};
|
|
56
50
|
});
|
|
57
51
|
function Switch(props) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
62
|
-
switchChecked = _React$useState2[0],
|
|
63
|
-
setSwitchChecked = _React$useState2[1];
|
|
64
|
-
var onChangeEvent = function onChangeEvent() {
|
|
52
|
+
const classes = (0, _style.default)();
|
|
53
|
+
const [switchChecked, setSwitchChecked] = React.useState(props.checked);
|
|
54
|
+
const onChangeEvent = () => {
|
|
65
55
|
setSwitchChecked(!switchChecked);
|
|
66
56
|
props.handleChange(!switchChecked);
|
|
67
57
|
};
|
|
68
|
-
|
|
69
|
-
|
|
58
|
+
const handleChange = keyId => {
|
|
59
|
+
const newData = props.objects.map(item => {
|
|
70
60
|
if (item.id === keyId) {
|
|
71
61
|
item.checked = item.checked === true ? false : true;
|
|
72
62
|
}
|
|
@@ -74,37 +64,30 @@ function Switch(props) {
|
|
|
74
64
|
});
|
|
75
65
|
props.setObjects(newData);
|
|
76
66
|
};
|
|
77
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, props.objects &&
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
sx: {
|
|
89
|
-
"&:hover": {
|
|
90
|
-
backgroundColor: "transparent",
|
|
91
|
-
cursor: "default"
|
|
92
|
-
}
|
|
67
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, props.objects && props.objects?.length > 0 ? props.objects?.map((object, index) => /*#__PURE__*/React.createElement("div", {
|
|
68
|
+
className: classes.root
|
|
69
|
+
}, /*#__PURE__*/React.createElement(_FormGroup.default, null, /*#__PURE__*/React.createElement(_FormControlLabel.default, {
|
|
70
|
+
label: /*#__PURE__*/React.createElement(_text.default, null, object.label && object.label?.length > 0 ? object.label : ""),
|
|
71
|
+
control: /*#__PURE__*/React.createElement(MuiSwitchStyledComp, {
|
|
72
|
+
checked: object.checked === true,
|
|
73
|
+
onChange: () => handleChange(object.id),
|
|
74
|
+
sx: {
|
|
75
|
+
"&:hover": {
|
|
76
|
+
backgroundColor: "transparent",
|
|
77
|
+
cursor: "default"
|
|
93
78
|
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}) : /*#__PURE__*/React.createElement("div", {
|
|
79
|
+
}
|
|
80
|
+
}),
|
|
81
|
+
value: index,
|
|
82
|
+
disabled: object.disabled && object.disabled
|
|
83
|
+
})))) : /*#__PURE__*/React.createElement("div", {
|
|
99
84
|
className: classes.root
|
|
100
85
|
}, /*#__PURE__*/React.createElement(_FormGroup.default, null, /*#__PURE__*/React.createElement(_FormControlLabel.default, {
|
|
101
86
|
control: /*#__PURE__*/React.createElement(MuiSwitchStyledComp, {
|
|
102
87
|
checked: switchChecked,
|
|
103
|
-
onChange:
|
|
104
|
-
return onChangeEvent();
|
|
105
|
-
}
|
|
88
|
+
onChange: () => onChangeEvent()
|
|
106
89
|
}),
|
|
107
|
-
label: /*#__PURE__*/React.createElement(_text.default, null, "`$", props.label &&
|
|
90
|
+
label: /*#__PURE__*/React.createElement(_text.default, null, "`$", props.label && props.label?.length > 0 ? props.label : "", "`"),
|
|
108
91
|
disabled: props.disabled && props.disabled
|
|
109
92
|
}))));
|
|
110
93
|
}
|