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