tenjin-ui-kit 0.3.67 → 0.3.69
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/.dockerignore +6 -0
- package/.storybook/main.js +16 -0
- package/.storybook/preview.js +11 -0
- package/Dockerfile +17 -0
- package/Jenkinsfile +66 -0
- package/build/asset-manifest.json +16 -0
- package/build/favicon.ico +0 -0
- package/build/index.html +1 -0
- package/build/logo192.png +0 -0
- package/build/logo512.png +0 -0
- package/build/manifest.json +25 -0
- package/build/robots.txt +3 -0
- package/build/static/css/main.e7366529.css +2 -0
- package/build/static/css/main.e7366529.css.map +1 -0
- package/build/static/js/453.900c81c3.chunk.js +2 -0
- package/build/static/js/453.900c81c3.chunk.js.map +1 -0
- package/build/static/js/main.8abb72fa.js +3 -0
- package/build/static/js/main.8abb72fa.js.LICENSE.txt +61 -0
- package/build/static/js/main.8abb72fa.js.map +1 -0
- package/build/static/media/logo.6ce24c58023cc2f8fd88fe9d219db6c6.svg +1 -0
- package/build/tenjinLogo.png +0 -0
- package/dist/README.md +13 -0
- package/dist/common/hooks/apiHooks.js +155 -0
- package/dist/common/hooks/newApiHook.js +188 -0
- package/{common → dist/common}/utils/security/index.js +2 -2
- package/{common → dist/common}/utils/security/securityConfig.js +1 -2
- package/dist/components/Canvas.js +330 -0
- package/dist/components/DragBox/index.js +40 -0
- package/dist/components/InputWithChip/index.js +294 -0
- package/{components → dist/components}/RightContext/index.js +19 -28
- package/dist/components/WorkFlow.js +42 -0
- package/dist/components/WorkFlowBuilder.js +115 -0
- package/dist/components/alert/Style.js +20 -0
- package/dist/components/alert/index.js +67 -0
- package/{components → dist/components}/attachment/index.js +21 -28
- package/{components → dist/components}/authenticationProvider/AuthError.js +3 -4
- package/{components → dist/components}/authenticationProvider/AuthLoader.js +3 -4
- package/dist/components/authenticationProvider/index.js +110 -0
- package/{components → dist/components}/avatar/index.js +13 -14
- package/dist/components/avatar/styles.js +91 -0
- package/dist/components/breadCrumbs/index.js +169 -0
- package/{components → dist/components}/breadCrumbs/style.js +1 -4
- package/{components → dist/components}/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/index.js +5 -6
- package/{components → dist/components}/browsingTestCaseLayout/DetailsViewLayout/DetailsViewContent/style.js +5 -8
- package/{components → dist/components}/browsingTestCaseLayout/DetailsViewLayout/DetailsViewHeader/index.js +4 -5
- package/{components → dist/components}/browsingTestCaseLayout/TreeViewLayout/TreeViewContent/Index.js +4 -5
- package/{components → dist/components}/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/Index.js +5 -6
- package/dist/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/style.js +23 -0
- package/{components → dist/components}/browsingTestCaseLayout/index.js +25 -30
- package/dist/components/button/index.js +133 -0
- package/{components → dist/components}/chatBotModal/index.js +36 -45
- package/dist/components/checkBox/index.js +29 -0
- package/{components → dist/components}/combobox/index.js +51 -72
- package/dist/components/divider/index.js +37 -0
- package/{components → dist/components}/editableField/index.js +19 -28
- package/{components → dist/components}/error/index.js +6 -12
- package/dist/components/errorBoundary/index.js +140 -0
- package/dist/components/fileUploader/index.js +151 -0
- package/dist/components/fileUploader/style.js +57 -0
- package/dist/components/filter/ValueSelector.js +333 -0
- package/{components → dist/components}/filter/index.js +31 -36
- package/{components → dist/components}/iconButton/index.js +3 -4
- package/dist/components/input/index.js +167 -0
- package/dist/components/layout/index.js +94 -0
- package/dist/components/layout/main/index.js +24 -0
- package/dist/components/layout/main/style.js +19 -0
- package/{components → dist/components}/layout/pageContent/index.js +6 -7
- package/dist/components/layout/sidebar/FlatMenu.js +64 -0
- package/dist/components/layout/sidebar/GroupedIconMenu.js +233 -0
- package/dist/components/layout/sidebar/GroupedMenu.js +57 -0
- package/dist/components/layout/sidebar/ProjectMenu.js +223 -0
- package/dist/components/layout/sidebar/index.js +88 -0
- package/dist/components/layout/sidebar/style.js +149 -0
- package/{components → dist/components}/layout/topBar/ProjectTopbar.js +81 -98
- package/dist/components/layout/topBar/UserAvatar.js +138 -0
- package/dist/components/layout/topBar/index.js +121 -0
- package/{components → dist/components}/loader/index.js +9 -12
- package/dist/components/menu/index.js +71 -0
- package/{components → dist/components}/modal/Modal.js +5 -6
- package/dist/components/modal/index.js +88 -0
- package/dist/components/modal/style.js +65 -0
- package/dist/components/optionMenu/index.js +105 -0
- package/dist/components/pagination/index.js +114 -0
- package/dist/components/pagination/style.js +33 -0
- package/dist/components/paginationUpdated/index.js +73 -0
- package/dist/components/paper/index.js +43 -0
- package/dist/components/paper/style.js +31 -0
- package/dist/components/reactSelect/index.js +195 -0
- package/dist/components/reactSelect/style.js +130 -0
- package/dist/components/richTextEditor/index.js +64 -0
- package/dist/components/select/GroupedSelect.js +167 -0
- package/dist/components/select/SimpleSelect.js +184 -0
- package/{components → dist/components}/select/index.js +38 -54
- package/dist/components/simpleSelect/index.js +53 -0
- package/{components → dist/components}/sort/index.js +19 -22
- package/{components → dist/components}/switch/index.js +10 -11
- package/dist/components/switch/style.js +39 -0
- package/{components → dist/components}/switch/switch.js +17 -23
- package/dist/components/table/ReactTable.js +101 -0
- package/dist/components/table/SimpleTable.js +117 -0
- package/dist/components/table/index.js +381 -0
- package/dist/components/text/index.js +65 -0
- package/{components → dist/components}/timeStamp/index.js +4 -6
- package/dist/components/timeStamp/style.js +20 -0
- package/dist/components/topBar/index.js +169 -0
- package/{components → dist/components}/tree/index.js +29 -47
- package/dist/components/tree/style.js +29 -0
- package/dist/components/valuePicker/ValueSelector.js +205 -0
- package/{components → dist/components}/valuePicker/index.js +19 -26
- package/{components → dist/components}/wrapperLayout/layout/index.js +4 -5
- package/{components → dist/components}/wrapperLayout/main/index.js +4 -5
- package/{components → dist/components}/wrapperLayout/main/pageContainer/index.js +4 -5
- package/dist/components/wrapperLayout/main/sideBar/index.js +272 -0
- package/dist/components/wrapperLayout/main/sideBar/style.js +190 -0
- package/{components → dist/components}/wrapperLayout/topBar/UserAvatar.js +4 -5
- package/dist/components/wrapperLayout/topBar/avatar.js +55 -0
- package/dist/components/wrapperLayout/topBar/index.js +196 -0
- package/{components → dist/components}/wrapperLayout/topBar/menuIcon.js +4 -5
- package/dist/components/wrapperLayout/topBar/style.js +74 -0
- package/dist/http/index.js +133 -0
- package/{index.js → dist/index.js} +53 -55
- package/dist/package.json +127 -0
- package/{templates → dist/templates}/listPage/index.js +36 -57
- package/{themes → dist/themes}/default.js +5 -7
- package/{themes → dist/themes}/defaultSmall.js +2 -3
- package/{themes → dist/themes}/responsiveTheme.js +6 -8
- package/package.json +4 -1
- package/public/favicon.ico +0 -0
- package/public/index.html +43 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +25 -0
- package/public/robots.txt +3 -0
- package/public/tenjinLogo.png +0 -0
- package/common/hooks/apiHooks.js +0 -223
- package/common/hooks/newApiHook.js +0 -270
- package/components/Canvas.js +0 -254
- package/components/DragBox/index.js +0 -45
- package/components/InputWithChip/index.js +0 -187
- package/components/WorkFlow.js +0 -47
- package/components/WorkFlowBuilder.js +0 -130
- package/components/alert/Style.js +0 -23
- package/components/alert/index.js +0 -69
- package/components/authenticationProvider/index.js +0 -166
- package/components/avatar/styles.js +0 -94
- package/components/breadCrumbs/index.js +0 -180
- package/components/browsingTestCaseLayout/TreeViewLayout/TreeViewHeader/style.js +0 -26
- package/components/button/index.js +0 -135
- package/components/checkBox/index.js +0 -30
- package/components/divider/index.js +0 -41
- package/components/errorBoundary/index.js +0 -160
- package/components/fileUploader/index.js +0 -156
- package/components/fileUploader/style.js +0 -60
- package/components/filter/ValueSelector.js +0 -350
- package/components/input/index.js +0 -174
- package/components/layout/index.js +0 -98
- package/components/layout/main/index.js +0 -27
- package/components/layout/main/style.js +0 -22
- package/components/layout/sidebar/FlatMenu.js +0 -64
- package/components/layout/sidebar/GroupedIconMenu.js +0 -246
- package/components/layout/sidebar/GroupedMenu.js +0 -67
- package/components/layout/sidebar/ProjectMenu.js +0 -230
- package/components/layout/sidebar/index.js +0 -91
- package/components/layout/sidebar/style.js +0 -154
- package/components/layout/topBar/UserAvatar.js +0 -145
- package/components/layout/topBar/index.js +0 -132
- package/components/menu/index.js +0 -80
- package/components/modal/index.js +0 -91
- package/components/modal/style.js +0 -68
- package/components/optionMenu/index.js +0 -112
- package/components/pagination/index.js +0 -129
- package/components/pagination/style.js +0 -36
- package/components/paginationUpdated/index.js +0 -75
- package/components/paper/index.js +0 -44
- package/components/paper/style.js +0 -34
- package/components/reactSelect/index.js +0 -212
- package/components/reactSelect/style.js +0 -163
- package/components/richTextEditor/index.js +0 -83
- package/components/select/GroupedSelect.js +0 -183
- package/components/select/SimpleSelect.js +0 -212
- package/components/simpleSelect/index.js +0 -56
- package/components/switch/style.js +0 -42
- package/components/table/ReactTable.js +0 -118
- package/components/table/SimpleTable.js +0 -136
- package/components/table/index.js +0 -256
- package/components/text/index.js +0 -67
- package/components/timeStamp/style.js +0 -23
- package/components/topBar/index.js +0 -176
- package/components/tree/style.js +0 -32
- package/components/valuePicker/ValueSelector.js +0 -273
- package/components/wrapperLayout/main/sideBar/index.js +0 -262
- package/components/wrapperLayout/main/sideBar/style.js +0 -196
- package/components/wrapperLayout/topBar/avatar.js +0 -57
- package/components/wrapperLayout/topBar/index.js +0 -182
- package/components/wrapperLayout/topBar/style.js +0 -77
- package/http/index.js +0 -226
- /package/{assets → dist/assets}/images/MicrosoftTeams-image (1).png +0 -0
- /package/{assets → dist/assets}/images/tenjin-4.0-logo.png +0 -0
- /package/{components → dist/components}/RightContext/index.css +0 -0
- /package/{components → dist/components}/browsingTestCaseLayout/style.css +0 -0
- /package/{components → dist/components}/errorBoundary/Error.jpg +0 -0
- /package/{components → dist/components}/iconButton/style.js +0 -0
- /package/{components → dist/components}/richTextEditor/style.js +0 -0
- /package/{components → dist/components}/wrapperLayout/layout/style.js +0 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _material = require("@mui/material");
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _text = _interopRequireDefault(require("../text"));
|
|
10
|
+
const _excluded = ["options", "errorMessage", "error", "fullWidth", "isDisabled", "label", "isRequired", "helperText", "isSearch", "isClearOption", "loading", "isSort", "placeholder"];
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
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); }
|
|
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
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
15
|
+
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."); }
|
|
16
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
17
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
18
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
19
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
20
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
21
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
22
|
+
const SimpleSelect = _ref => {
|
|
23
|
+
let options = _ref.options,
|
|
24
|
+
errorMessage = _ref.errorMessage,
|
|
25
|
+
error = _ref.error,
|
|
26
|
+
fullWidth = _ref.fullWidth,
|
|
27
|
+
isDisabled = _ref.isDisabled,
|
|
28
|
+
label = _ref.label,
|
|
29
|
+
isRequired = _ref.isRequired,
|
|
30
|
+
helperText = _ref.helperText,
|
|
31
|
+
isSearch = _ref.isSearch,
|
|
32
|
+
isClearOption = _ref.isClearOption,
|
|
33
|
+
loading = _ref.loading,
|
|
34
|
+
isSort = _ref.isSort,
|
|
35
|
+
placeholder = _ref.placeholder,
|
|
36
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
37
|
+
isSort = isSort !== null && isSort !== void 0 ? isSort : true; //by default true
|
|
38
|
+
isSearch = isSearch !== null && isSearch !== void 0 ? isSearch : true; //by default true
|
|
39
|
+
isClearOption = isClearOption !== null && isClearOption !== void 0 ? isClearOption : true; //by default true
|
|
40
|
+
|
|
41
|
+
const _useState = (0, _react.useState)(""),
|
|
42
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
43
|
+
searchText = _useState2[0],
|
|
44
|
+
setSearchText = _useState2[1];
|
|
45
|
+
const _useState3 = (0, _react.useState)(false),
|
|
46
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
47
|
+
noDataAvailable = _useState4[0],
|
|
48
|
+
setNoDataAvailable = _useState4[1];
|
|
49
|
+
const validateChildren = (type, searchText) => {
|
|
50
|
+
if (typeof type !== "object") {
|
|
51
|
+
return typeof type === "string" && type.toLowerCase().indexOf(searchText.toLowerCase()) > -1;
|
|
52
|
+
}
|
|
53
|
+
if (typeof type.props === "object" && Array.isArray(type.props.children)) {
|
|
54
|
+
return type.props.children.some(data => validateChildren(data, searchText));
|
|
55
|
+
}
|
|
56
|
+
return false;
|
|
57
|
+
};
|
|
58
|
+
const containsText = (text, searchText) => {
|
|
59
|
+
if (typeof text === "string" && typeof searchText === "string") {
|
|
60
|
+
return text.toLowerCase().indexOf(searchText.toLowerCase()) > -1;
|
|
61
|
+
}
|
|
62
|
+
if (typeof text === "object" && text.props && Array.isArray(text.props.children)) {
|
|
63
|
+
return text.props.children.some(data => validateChildren(data, searchText));
|
|
64
|
+
}
|
|
65
|
+
return false;
|
|
66
|
+
};
|
|
67
|
+
const displayedOptions = (0, _react.useMemo)(() => {
|
|
68
|
+
const filteredOptions = options === null || options === void 0 ? void 0 : options.filter(option => containsText(option === null || option === void 0 ? void 0 : option.label, searchText));
|
|
69
|
+
if (isSearch) {
|
|
70
|
+
setNoDataAvailable((filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.length) === 0);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// const sortedOptions = filteredOptions?.sort((a, b) =>
|
|
74
|
+
// a?.label?.localeCompare(b.label)
|
|
75
|
+
// );
|
|
76
|
+
const sortedOptions = filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.slice().sort((a, b) => {
|
|
77
|
+
const labelA = typeof a.label === "string" ? a.label : findStringInChildren(a.label.props.children);
|
|
78
|
+
const labelB = typeof b.label === "string" ? b.label : findStringInChildren(b.label.props.children);
|
|
79
|
+
return labelA.localeCompare(labelB);
|
|
80
|
+
});
|
|
81
|
+
function findStringInChildren(children) {
|
|
82
|
+
for (const child of children) {
|
|
83
|
+
if (typeof child === "string") {
|
|
84
|
+
return child;
|
|
85
|
+
} else if (child.props && typeof child.props.children === "string") {
|
|
86
|
+
return child.props.children;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return "";
|
|
90
|
+
}
|
|
91
|
+
return (isSort ? sortedOptions : filteredOptions).map(option => ({
|
|
92
|
+
label: option === null || option === void 0 ? void 0 : option.label,
|
|
93
|
+
value: option === null || option === void 0 ? void 0 : option.value
|
|
94
|
+
}));
|
|
95
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
96
|
+
}, [options, searchText, isSearch]);
|
|
97
|
+
const recommendedOptions = isSearch ? displayedOptions : options;
|
|
98
|
+
let typingTimer;
|
|
99
|
+
const handleKeyDown = e => {
|
|
100
|
+
clearTimeout(typingTimer);
|
|
101
|
+
if (e.key !== "Escape") {
|
|
102
|
+
if (e.key !== "ArrowDown" && e.key !== "ArrowUp") {
|
|
103
|
+
e.stopPropagation();
|
|
104
|
+
}
|
|
105
|
+
typingTimer = setTimeout(() => {
|
|
106
|
+
clearTimeout(typingTimer);
|
|
107
|
+
}, 500);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_material.FormControl, {
|
|
111
|
+
sx: {
|
|
112
|
+
minWidth: 120
|
|
113
|
+
},
|
|
114
|
+
fullWidth: fullWidth,
|
|
115
|
+
disabled: isDisabled,
|
|
116
|
+
error: error,
|
|
117
|
+
style: {
|
|
118
|
+
margin: "0rem !important"
|
|
119
|
+
}
|
|
120
|
+
}, label && /*#__PURE__*/_react.default.createElement(_material.FormLabel, {
|
|
121
|
+
htmlFor: "my-input",
|
|
122
|
+
sx: {
|
|
123
|
+
fontSize: "0.8rem",
|
|
124
|
+
fontWeight: 500,
|
|
125
|
+
paddingBottom: "0.2rem"
|
|
126
|
+
}
|
|
127
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, null, label, isRequired ? /*#__PURE__*/_react.default.createElement("span", {
|
|
128
|
+
style: {
|
|
129
|
+
color: "red"
|
|
130
|
+
}
|
|
131
|
+
}, " * ") : "")), /*#__PURE__*/_react.default.createElement(_material.Select, _extends({}, rest, {
|
|
132
|
+
fullWidth: true,
|
|
133
|
+
onClose: () => setSearchText(""),
|
|
134
|
+
MenuProps: {
|
|
135
|
+
PaperProps: {
|
|
136
|
+
style: {
|
|
137
|
+
maxHeight: "12.5rem"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}), isSearch && /*#__PURE__*/_react.default.createElement("input", {
|
|
142
|
+
id: "search-box",
|
|
143
|
+
type: "text",
|
|
144
|
+
autoFocus: true,
|
|
145
|
+
style: {
|
|
146
|
+
paddingLeft: "2.5rem",
|
|
147
|
+
background: 'white url("https://static.thenounproject.com/png/101791-200.png") no-repeat left',
|
|
148
|
+
backgroundPosition: "0.875rem center",
|
|
149
|
+
backgroundSize: "1.125rem",
|
|
150
|
+
position: "sticky",
|
|
151
|
+
top: 0,
|
|
152
|
+
zIndex: 9999,
|
|
153
|
+
backgroundColor: "white !important",
|
|
154
|
+
height: "2.188rem",
|
|
155
|
+
margin: 0,
|
|
156
|
+
width: "100%",
|
|
157
|
+
border: "1px solid #949494",
|
|
158
|
+
borderRadius: "4px"
|
|
159
|
+
},
|
|
160
|
+
placeholder: "Type to search...",
|
|
161
|
+
onChange: e => setSearchText(e.target.value),
|
|
162
|
+
onKeyDown: handleKeyDown
|
|
163
|
+
}), isClearOption && !loading && /*#__PURE__*/_react.default.createElement(_material.MenuItem, {
|
|
164
|
+
value: ""
|
|
165
|
+
}, /*#__PURE__*/_react.default.createElement("em", {
|
|
166
|
+
style: {
|
|
167
|
+
color: "#888"
|
|
168
|
+
}
|
|
169
|
+
}, "Clear the option")), loading ? /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
170
|
+
variant: "span",
|
|
171
|
+
color: "secondary",
|
|
172
|
+
sx: {
|
|
173
|
+
fontStyle: "italic",
|
|
174
|
+
display: "flex",
|
|
175
|
+
padding: "0.5rem 0rem 0rem 1rem"
|
|
176
|
+
}
|
|
177
|
+
}, "Fetching Options...") : noDataAvailable ? /*#__PURE__*/_react.default.createElement(_material.MenuItem, {
|
|
178
|
+
disabled: true
|
|
179
|
+
}, "No Data Available") : recommendedOptions === null || recommendedOptions === void 0 ? void 0 : recommendedOptions.map(option => /*#__PURE__*/_react.default.createElement(_material.MenuItem, {
|
|
180
|
+
key: option.value,
|
|
181
|
+
value: option.value
|
|
182
|
+
}, option.label))), error && /*#__PURE__*/_react.default.createElement(_material.FormHelperText, null, errorMessage), helperText && /*#__PURE__*/_react.default.createElement(_material.FormHelperText, null, helperText)));
|
|
183
|
+
};
|
|
184
|
+
var _default = exports.default = SimpleSelect;
|
|
@@ -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,15 +11,14 @@ 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 _interopRequireDefault(
|
|
17
|
-
function
|
|
18
|
-
function
|
|
19
|
-
function
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var options = props.options,
|
|
14
|
+
const _excluded = ["options", "isMulti", "checkBox", "defaultValue", "value", "onChange", "placeholder", "label", "fullWidth", "error", "helperText", "blueTheme", "isRequired", "isDisabled"];
|
|
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
|
+
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); }
|
|
18
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
19
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
20
|
+
const ReactSelect = props => {
|
|
21
|
+
const options = props.options,
|
|
24
22
|
isMulti = props.isMulti,
|
|
25
23
|
checkBox = props.checkBox,
|
|
26
24
|
defaultValue = props.defaultValue,
|
|
@@ -35,10 +33,10 @@ var ReactSelect = function ReactSelect(props) {
|
|
|
35
33
|
isRequired = props.isRequired,
|
|
36
34
|
isDisabled = props.isDisabled,
|
|
37
35
|
rest = _objectWithoutProperties(props, _excluded);
|
|
38
|
-
|
|
36
|
+
const icon = /*#__PURE__*/_react.default.createElement(_CheckBoxOutlineBlank.default, {
|
|
39
37
|
fontSize: "small"
|
|
40
38
|
});
|
|
41
|
-
|
|
39
|
+
const checkedIcon = /*#__PURE__*/_react.default.createElement(_CheckBox.default, {
|
|
42
40
|
fontSize: "small"
|
|
43
41
|
});
|
|
44
42
|
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_material.FormControl, {
|
|
@@ -70,14 +68,12 @@ var ReactSelect = function ReactSelect(props) {
|
|
|
70
68
|
options: options
|
|
71
69
|
// disableCloseOnSelect
|
|
72
70
|
,
|
|
73
|
-
getOptionLabel:
|
|
74
|
-
return option === null || option === void 0 ? void 0 : option.label;
|
|
75
|
-
},
|
|
71
|
+
getOptionLabel: option => option === null || option === void 0 ? void 0 : option.label,
|
|
76
72
|
value: value,
|
|
77
73
|
onChange: onChange,
|
|
78
74
|
defaultValue: [options[1]],
|
|
79
|
-
renderOption:
|
|
80
|
-
|
|
75
|
+
renderOption: (props, option, _ref) => {
|
|
76
|
+
let selected = _ref.selected;
|
|
81
77
|
return /*#__PURE__*/_react.default.createElement("li", props, /*#__PURE__*/_react.default.createElement(_material.Checkbox, {
|
|
82
78
|
icon: icon,
|
|
83
79
|
checkedIcon: checkedIcon,
|
|
@@ -87,12 +83,10 @@ var ReactSelect = function ReactSelect(props) {
|
|
|
87
83
|
checked: selected
|
|
88
84
|
}), /*#__PURE__*/_react.default.createElement(_text.default, null, option === null || option === void 0 ? void 0 : option.label));
|
|
89
85
|
},
|
|
90
|
-
renderInput:
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}));
|
|
95
|
-
}
|
|
86
|
+
renderInput: params => /*#__PURE__*/_react.default.createElement(_material.TextField, _extends({}, params, {
|
|
87
|
+
placeholder: placeholder,
|
|
88
|
+
helperText: helperText
|
|
89
|
+
}))
|
|
96
90
|
})), !checkBox && !blueTheme && /*#__PURE__*/_react.default.createElement(_material.Autocomplete, _extends({}, rest, {
|
|
97
91
|
filterSelectedOptions: true,
|
|
98
92
|
disabled: isDisabled,
|
|
@@ -100,9 +94,7 @@ var ReactSelect = function ReactSelect(props) {
|
|
|
100
94
|
options: options
|
|
101
95
|
// disableCloseOnSelect
|
|
102
96
|
,
|
|
103
|
-
getOptionLabel:
|
|
104
|
-
return option.label ? option.label : "";
|
|
105
|
-
},
|
|
97
|
+
getOptionLabel: option => option.label ? option.label : "",
|
|
106
98
|
value: value,
|
|
107
99
|
defaultValue: [defaultValue],
|
|
108
100
|
onChange: onChange,
|
|
@@ -115,16 +107,14 @@ var ReactSelect = function ReactSelect(props) {
|
|
|
115
107
|
color: isDisabled && "#000000"
|
|
116
108
|
}
|
|
117
109
|
},
|
|
118
|
-
renderInput:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}));
|
|
127
|
-
}
|
|
110
|
+
renderInput: params => /*#__PURE__*/_react.default.createElement(_material.TextField, _extends({
|
|
111
|
+
error: error
|
|
112
|
+
}, params, {
|
|
113
|
+
variant: "outlined",
|
|
114
|
+
fullWidth: true,
|
|
115
|
+
placeholder: placeholder,
|
|
116
|
+
helperText: helperText
|
|
117
|
+
}))
|
|
128
118
|
})), blueTheme && /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
129
119
|
container: true,
|
|
130
120
|
sx: {
|
|
@@ -146,8 +136,8 @@ var ReactSelect = function ReactSelect(props) {
|
|
|
146
136
|
color: "#F4F7FC"
|
|
147
137
|
}
|
|
148
138
|
},
|
|
149
|
-
PaperComponent:
|
|
150
|
-
|
|
139
|
+
PaperComponent: _ref2 => {
|
|
140
|
+
let children = _ref2.children;
|
|
151
141
|
return /*#__PURE__*/_react.default.createElement(_material.Paper, {
|
|
152
142
|
style: {
|
|
153
143
|
background: "#6e6ba1",
|
|
@@ -164,26 +154,21 @@ var ReactSelect = function ReactSelect(props) {
|
|
|
164
154
|
filterSelectedOptions: true
|
|
165
155
|
// disableCloseOnSelect
|
|
166
156
|
,
|
|
167
|
-
getOptionLabel:
|
|
168
|
-
return option.label;
|
|
169
|
-
},
|
|
157
|
+
getOptionLabel: option => option.label,
|
|
170
158
|
value: value,
|
|
171
159
|
defaultValue: [defaultValue],
|
|
172
160
|
onChange: onChange,
|
|
173
|
-
renderInput:
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}));
|
|
182
|
-
}
|
|
161
|
+
renderInput: params => /*#__PURE__*/_react.default.createElement(_material.TextField, _extends({
|
|
162
|
+
error: error
|
|
163
|
+
}, params, {
|
|
164
|
+
variant: "outlined",
|
|
165
|
+
fullWidth: true,
|
|
166
|
+
placeholder: placeholder,
|
|
167
|
+
helperText: helperText
|
|
168
|
+
}))
|
|
183
169
|
// sx={{ }}
|
|
184
170
|
})))));
|
|
185
171
|
};
|
|
186
|
-
|
|
187
172
|
ReactSelect.propTypes = {
|
|
188
173
|
value: _propTypes.default.string,
|
|
189
174
|
className: _propTypes.default.string,
|
|
@@ -213,5 +198,4 @@ ReactSelect.defaultProps = {
|
|
|
213
198
|
isSearch: false,
|
|
214
199
|
loading: false
|
|
215
200
|
};
|
|
216
|
-
var _default = ReactSelect;
|
|
217
|
-
exports.default = _default;
|
|
201
|
+
var _default = exports.default = ReactSelect;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _material = require("@mui/material");
|
|
8
|
+
var _text = _interopRequireDefault(require("../text"));
|
|
9
|
+
const _excluded = ["options", "errorMessage", "error", "fullWidth", "isDisabled", "label", "isRequired"];
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
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); }
|
|
12
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
13
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
14
|
+
const SimpleSelect = _ref => {
|
|
15
|
+
let options = _ref.options,
|
|
16
|
+
errorMessage = _ref.errorMessage,
|
|
17
|
+
error = _ref.error,
|
|
18
|
+
fullWidth = _ref.fullWidth,
|
|
19
|
+
isDisabled = _ref.isDisabled,
|
|
20
|
+
label = _ref.label,
|
|
21
|
+
isRequired = _ref.isRequired,
|
|
22
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
23
|
+
console.log(errorMessage, error, "error");
|
|
24
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_material.FormControl, {
|
|
25
|
+
sx: {
|
|
26
|
+
m: 1,
|
|
27
|
+
minWidth: 120
|
|
28
|
+
},
|
|
29
|
+
fullWidth: fullWidth,
|
|
30
|
+
disabled: isDisabled,
|
|
31
|
+
error: error,
|
|
32
|
+
style: {
|
|
33
|
+
margin: "0rem !important"
|
|
34
|
+
}
|
|
35
|
+
}, label && /*#__PURE__*/React.createElement(_material.FormLabel, {
|
|
36
|
+
htmlFor: "my-input",
|
|
37
|
+
sx: {
|
|
38
|
+
fontSize: "0.8rem",
|
|
39
|
+
fontWeight: 500,
|
|
40
|
+
paddingBottom: "0.2rem"
|
|
41
|
+
}
|
|
42
|
+
}, /*#__PURE__*/React.createElement(_text.default, null, label, isRequired ? /*#__PURE__*/React.createElement("span", {
|
|
43
|
+
style: {
|
|
44
|
+
color: "red"
|
|
45
|
+
}
|
|
46
|
+
}, " * ") : "")), /*#__PURE__*/React.createElement(_material.Select, _extends({}, rest, {
|
|
47
|
+
fullWidth: true
|
|
48
|
+
}), options.map(option => /*#__PURE__*/React.createElement(_material.MenuItem, {
|
|
49
|
+
key: option.value,
|
|
50
|
+
value: option.value
|
|
51
|
+
}, option.label))), error && /*#__PURE__*/React.createElement(_material.FormHelperText, null, errorMessage)));
|
|
52
|
+
};
|
|
53
|
+
var _default = exports.default = SimpleSelect;
|
|
@@ -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,35 +15,34 @@ 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
|
-
function
|
|
22
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
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
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
23
21
|
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."); }
|
|
24
|
-
function _unsupportedIterableToArray(
|
|
25
|
-
function _arrayLikeToArray(
|
|
26
|
-
function _iterableToArrayLimit(
|
|
27
|
-
function _arrayWithHoles(
|
|
28
|
-
|
|
22
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
23
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
24
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
25
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } // import { Button, Divider, Text } from "tenjin-ui-kit";
|
|
26
|
+
const Sort = _ref => {
|
|
29
27
|
var _options$;
|
|
30
|
-
|
|
28
|
+
let onChange = _ref.onChange,
|
|
31
29
|
variant = _ref.variant,
|
|
32
30
|
columnName = _ref.columnName,
|
|
33
31
|
options = _ref.options,
|
|
34
32
|
defaultSelectedOptions = _ref.defaultSelectedOptions;
|
|
35
33
|
console.log({
|
|
36
|
-
defaultSelectedOptions
|
|
34
|
+
defaultSelectedOptions
|
|
37
35
|
});
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
const theme = (0, _material.useTheme)();
|
|
37
|
+
const _useState = (0, _react.useState)(null),
|
|
40
38
|
_useState2 = _slicedToArray(_useState, 2),
|
|
41
39
|
menuAnchor = _useState2[0],
|
|
42
40
|
setMenuAnchor = _useState2[1];
|
|
43
|
-
|
|
41
|
+
const _React$useState = _react.default.useState(defaultSelectedOptions ? defaultSelectedOptions : (_options$ = options[0]) === null || _options$ === void 0 ? void 0 : _options$.value),
|
|
44
42
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
45
43
|
value = _React$useState2[0],
|
|
46
44
|
setValue = _React$useState2[1];
|
|
47
|
-
(0, _react.useEffect)(
|
|
45
|
+
(0, _react.useEffect)(() => {
|
|
48
46
|
if (!defaultSelectedOptions) {
|
|
49
47
|
var _options$2;
|
|
50
48
|
setValue((_options$2 = options[0]) === null || _options$2 === void 0 ? void 0 : _options$2.value);
|
|
@@ -52,13 +50,13 @@ var Sort = function Sort(_ref) {
|
|
|
52
50
|
setValue(defaultSelectedOptions);
|
|
53
51
|
}
|
|
54
52
|
}, [defaultSelectedOptions]);
|
|
55
|
-
|
|
53
|
+
const handleMenuClose = () => {
|
|
56
54
|
setMenuAnchor(null);
|
|
57
55
|
};
|
|
58
|
-
|
|
56
|
+
const handleMenuOpen = e => {
|
|
59
57
|
setMenuAnchor(e.currentTarget);
|
|
60
58
|
};
|
|
61
|
-
|
|
59
|
+
const handleChange = event => {
|
|
62
60
|
setValue(event.target.value);
|
|
63
61
|
onChange(event.target.value);
|
|
64
62
|
};
|
|
@@ -129,7 +127,7 @@ var Sort = function Sort(_ref) {
|
|
|
129
127
|
name: "controlled-radio-buttons-group",
|
|
130
128
|
value: value,
|
|
131
129
|
onChange: handleChange
|
|
132
|
-
}, options === null || options === void 0 ? void 0 : options.map(
|
|
130
|
+
}, options === null || options === void 0 ? void 0 : options.map(a => {
|
|
133
131
|
return /*#__PURE__*/_react.default.createElement(_FormControlLabel.default, {
|
|
134
132
|
value: a.value,
|
|
135
133
|
control: /*#__PURE__*/_react.default.createElement(_Radio.default, null),
|
|
@@ -137,5 +135,4 @@ var Sort = function Sort(_ref) {
|
|
|
137
135
|
});
|
|
138
136
|
})))));
|
|
139
137
|
};
|
|
140
|
-
var _default = Sort;
|
|
141
|
-
exports.default = _default;
|
|
138
|
+
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 _interopRequireDefault(
|
|
14
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
15
|
-
function _objectWithoutProperties(
|
|
16
|
-
function _objectWithoutPropertiesLoose(
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
const _excluded = ["label"];
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
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); }
|
|
15
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
16
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
17
|
+
const Switch = props => {
|
|
18
|
+
const label = props.label,
|
|
19
19
|
rest = _objectWithoutProperties(props, _excluded);
|
|
20
|
-
|
|
20
|
+
const MuiSwitchStyledComp = (0, _styles.styled)(_material.Switch)(_ref => {
|
|
21
21
|
var _theme$palette;
|
|
22
|
-
|
|
22
|
+
let MuiSwitch = _ref.MuiSwitch;
|
|
23
23
|
return {
|
|
24
24
|
padding: 10,
|
|
25
25
|
marginTop: "-6px",
|
|
@@ -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;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _styles = require("@mui/styles");
|
|
8
|
+
var _default2 = _interopRequireDefault(require("../../themes/default"));
|
|
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: "".concat(500, " !important")
|
|
15
|
+
},
|
|
16
|
+
"@media (min-width:769px) and (max-width:1100px)": {
|
|
17
|
+
fontSize: "1.3rem !important",
|
|
18
|
+
fontWeight: "".concat(500, " !important")
|
|
19
|
+
},
|
|
20
|
+
"@media (min-width:600px) and (max-width:768px)": {
|
|
21
|
+
fontSize: "1rem",
|
|
22
|
+
fontWeight: "".concat(500, " !important")
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
labelSmall: {
|
|
26
|
+
"@media (min-width:1101px) and (max-width:1200px)": {
|
|
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
|
+
}));
|