tenjin-ui-kit 0.3.66 → 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 +51 -53
- 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 +6 -3
- 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,333 @@
|
|
|
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 _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var colors = _interopRequireWildcard(require("@mui/material/colors"));
|
|
11
|
+
var _button = _interopRequireDefault(require("../button"));
|
|
12
|
+
var _text = _interopRequireDefault(require("../text"));
|
|
13
|
+
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); }
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
16
|
+
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."); }
|
|
17
|
+
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; } }
|
|
18
|
+
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; }
|
|
19
|
+
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; } }
|
|
20
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
21
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
22
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
23
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
24
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
25
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
26
|
+
const determineSelectedOptions = (options, selectedIds, valueKey) => {
|
|
27
|
+
if (!options || options.length < 1) return [];
|
|
28
|
+
if (!selectedIds || selectedIds.length < 1) return options;
|
|
29
|
+
return options.map(o => _objectSpread(_objectSpread({}, o), {}, {
|
|
30
|
+
selected: selectedIds.includes(o[valueKey])
|
|
31
|
+
}));
|
|
32
|
+
};
|
|
33
|
+
const ValueSelector = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
34
|
+
let options = _ref.options,
|
|
35
|
+
valueKey = _ref.valueKey,
|
|
36
|
+
displayKey = _ref.displayKey,
|
|
37
|
+
avatarKey = _ref.avatarKey,
|
|
38
|
+
colorKey = _ref.colorKey,
|
|
39
|
+
onChange = _ref.onChange,
|
|
40
|
+
multiple = _ref.multiple,
|
|
41
|
+
defaultSelectedOptionIds = _ref.defaultSelectedOptionIds,
|
|
42
|
+
fetchData = _ref.fetchData,
|
|
43
|
+
showClearItems = _ref.showClearItems,
|
|
44
|
+
showAvatar = _ref.showAvatar,
|
|
45
|
+
setSearch = _ref.setSearch,
|
|
46
|
+
inputRef = _ref.inputRef,
|
|
47
|
+
searchText = _ref.searchText;
|
|
48
|
+
const theme = (0, _material.useTheme)();
|
|
49
|
+
const _useState = (0, _react.useState)(false),
|
|
50
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
51
|
+
loading = _useState2[0],
|
|
52
|
+
setLoading = _useState2[1];
|
|
53
|
+
const _useState3 = (0, _react.useState)([]),
|
|
54
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
55
|
+
localOptions = _useState4[0],
|
|
56
|
+
setLocalOptions = _useState4[1];
|
|
57
|
+
const _useState5 = (0, _react.useState)(""),
|
|
58
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
59
|
+
filter = _useState6[0],
|
|
60
|
+
setFilter = _useState6[1];
|
|
61
|
+
const _useState7 = (0, _react.useState)([]),
|
|
62
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
63
|
+
filteredLocalOptions = _useState8[0],
|
|
64
|
+
setFilteredLocalOptions = _useState8[1];
|
|
65
|
+
const _useState9 = (0, _react.useState)(-1),
|
|
66
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
67
|
+
activeIndex = _useState0[0],
|
|
68
|
+
setActiveIndex = _useState0[1];
|
|
69
|
+
const itemRefs = (0, _react.useRef)([]);
|
|
70
|
+
const clearBtnRef = (0, _react.useRef)(null);
|
|
71
|
+
const _useState1 = (0, _react.useState)(false),
|
|
72
|
+
_useState10 = _slicedToArray(_useState1, 2),
|
|
73
|
+
clearFocused = _useState10[0],
|
|
74
|
+
setClearFocused = _useState10[1];
|
|
75
|
+
(0, _react.useImperativeHandle)(ref, () => ({
|
|
76
|
+
handleKeyDown: e => {
|
|
77
|
+
if (e.key === "Tab") {
|
|
78
|
+
e.preventDefault();
|
|
79
|
+
e.stopPropagation();
|
|
80
|
+
if (clearFocused) {
|
|
81
|
+
setClearFocused(false);
|
|
82
|
+
requestAnimationFrame(() => {
|
|
83
|
+
var _inputRef$current;
|
|
84
|
+
inputRef === null || inputRef === void 0 || (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
|
|
85
|
+
});
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
setClearFocused(true);
|
|
89
|
+
setActiveIndex(-1);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (!["ArrowDown", "ArrowUp", "Enter"].includes(e.key)) return;
|
|
93
|
+
if (e.key === "ArrowDown") {
|
|
94
|
+
e.preventDefault();
|
|
95
|
+
if (clearFocused) {
|
|
96
|
+
setClearFocused(false);
|
|
97
|
+
setActiveIndex(0);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
setActiveIndex(prev => {
|
|
101
|
+
if (filteredLocalOptions.length === 0) return -1;
|
|
102
|
+
return prev < filteredLocalOptions.length - 1 ? prev + 1 : 0;
|
|
103
|
+
});
|
|
104
|
+
} else if (e.key === "ArrowUp") {
|
|
105
|
+
e.preventDefault();
|
|
106
|
+
if (clearFocused) {
|
|
107
|
+
setClearFocused(false);
|
|
108
|
+
setActiveIndex(0);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
setActiveIndex(prev => {
|
|
112
|
+
if (filteredLocalOptions.length === 0) return -1;
|
|
113
|
+
return prev > 0 ? prev - 1 : filteredLocalOptions.length - 1;
|
|
114
|
+
});
|
|
115
|
+
} else if (e.key === "Enter") {
|
|
116
|
+
e.preventDefault();
|
|
117
|
+
if (clearFocused) {
|
|
118
|
+
handleClearSelection();
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (activeIndex >= 0 && activeIndex < filteredLocalOptions.length) {
|
|
122
|
+
handleSelection(filteredLocalOptions[activeIndex]);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}));
|
|
127
|
+
(0, _react.useEffect)(() => {
|
|
128
|
+
if (activeIndex >= 0 && itemRefs.current[activeIndex]) {
|
|
129
|
+
itemRefs.current[activeIndex].scrollIntoView({
|
|
130
|
+
block: "nearest"
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}, [activeIndex]);
|
|
134
|
+
(0, _react.useEffect)(() => {
|
|
135
|
+
resolveOptions();
|
|
136
|
+
}, []);
|
|
137
|
+
const fetchAsyncData = async () => {
|
|
138
|
+
setLoading(true);
|
|
139
|
+
let response = null;
|
|
140
|
+
if (fetchData) {
|
|
141
|
+
response = await fetchData();
|
|
142
|
+
} else {
|
|
143
|
+
response = [];
|
|
144
|
+
}
|
|
145
|
+
setLoading(false);
|
|
146
|
+
return response;
|
|
147
|
+
};
|
|
148
|
+
const resolveOptions = async () => {
|
|
149
|
+
let tempOptions = [];
|
|
150
|
+
if (fetchData) {
|
|
151
|
+
tempOptions = await fetchAsyncData();
|
|
152
|
+
} else {
|
|
153
|
+
tempOptions = [...options];
|
|
154
|
+
}
|
|
155
|
+
setLocalOptions(determineSelectedOptions(tempOptions, defaultSelectedOptionIds, valueKey));
|
|
156
|
+
};
|
|
157
|
+
const filterOptions = () => {
|
|
158
|
+
if (filter) {
|
|
159
|
+
setFilteredLocalOptions(localOptions.filter(o => {
|
|
160
|
+
let searchTarget = o[displayKey].toLowerCase();
|
|
161
|
+
return searchTarget.includes(filter.toLowerCase());
|
|
162
|
+
}));
|
|
163
|
+
} else {
|
|
164
|
+
setFilteredLocalOptions([...localOptions]);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
(0, _react.useEffect)(() => {
|
|
168
|
+
filterOptions();
|
|
169
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
170
|
+
}, [localOptions, filter]);
|
|
171
|
+
const handleSelection = option => {
|
|
172
|
+
let newOptions = [];
|
|
173
|
+
if (multiple) {
|
|
174
|
+
newOptions = localOptions.map(o => o[valueKey] === option[valueKey] ? _objectSpread(_objectSpread({}, o), {}, {
|
|
175
|
+
selected: o.selected ? false : true
|
|
176
|
+
}) : o);
|
|
177
|
+
} else {
|
|
178
|
+
newOptions = localOptions.map(o => o[valueKey] === option[valueKey] ? _objectSpread(_objectSpread({}, o), {}, {
|
|
179
|
+
selected: true
|
|
180
|
+
}) : _objectSpread(_objectSpread({}, o), {}, {
|
|
181
|
+
selected: false
|
|
182
|
+
}));
|
|
183
|
+
}
|
|
184
|
+
onChange(newOptions.filter(o => o.selected));
|
|
185
|
+
setLocalOptions(newOptions);
|
|
186
|
+
};
|
|
187
|
+
const handleClearSelection = () => {
|
|
188
|
+
let newOptions = localOptions.map(l => _objectSpread(_objectSpread({}, l), {}, {
|
|
189
|
+
selected: false
|
|
190
|
+
}));
|
|
191
|
+
onChange([]);
|
|
192
|
+
setLocalOptions(newOptions);
|
|
193
|
+
setSearch("");
|
|
194
|
+
};
|
|
195
|
+
(0, _react.useEffect)(() => {
|
|
196
|
+
const clearFocus = () => {
|
|
197
|
+
setClearFocused(false);
|
|
198
|
+
};
|
|
199
|
+
window.addEventListener("mousedown", clearFocus);
|
|
200
|
+
return () => {
|
|
201
|
+
window.removeEventListener("mousedown", clearFocus);
|
|
202
|
+
};
|
|
203
|
+
}, []);
|
|
204
|
+
(0, _react.useEffect)(() => {
|
|
205
|
+
if (searchText) {
|
|
206
|
+
setFilteredLocalOptions(localOptions.filter(o => {
|
|
207
|
+
var _o$displayKey;
|
|
208
|
+
return (_o$displayKey = o[displayKey]) === null || _o$displayKey === void 0 ? void 0 : _o$displayKey.toLowerCase().includes(searchText.toLowerCase());
|
|
209
|
+
}));
|
|
210
|
+
} else {
|
|
211
|
+
setFilteredLocalOptions(localOptions);
|
|
212
|
+
}
|
|
213
|
+
}, [localOptions, searchText]);
|
|
214
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_material.List, {
|
|
215
|
+
dense: true,
|
|
216
|
+
disablePadding: true,
|
|
217
|
+
sx: {
|
|
218
|
+
// height: "25ch",
|
|
219
|
+
minHeight: "4ch",
|
|
220
|
+
maxHeight: "30ch",
|
|
221
|
+
overflow: "auto"
|
|
222
|
+
}
|
|
223
|
+
}, loading ? /*#__PURE__*/_react.default.createElement(_material.ListItem, {
|
|
224
|
+
dense: true,
|
|
225
|
+
key: "loader"
|
|
226
|
+
}, /*#__PURE__*/_react.default.createElement(_material.ListItemText, {
|
|
227
|
+
sx: {
|
|
228
|
+
fontStyle: "italic"
|
|
229
|
+
}
|
|
230
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, null, "Fetching options..."))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
231
|
+
sx: {
|
|
232
|
+
padding: "0rem 0.5rem"
|
|
233
|
+
}
|
|
234
|
+
}, (filteredLocalOptions === null || filteredLocalOptions === void 0 ? void 0 : filteredLocalOptions.length) === 0 ? /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
235
|
+
color: "secondary"
|
|
236
|
+
}, "No Data") : filteredLocalOptions.map((o, index) => {
|
|
237
|
+
const altVal = o[avatarKey] === "/" ? " " : o[displayKey];
|
|
238
|
+
const bgcAvatar = colors[o[colorKey]] ? colors[o[colorKey]][500] : "red";
|
|
239
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
240
|
+
key: o[valueKey]
|
|
241
|
+
}, /*#__PURE__*/_react.default.createElement(_material.ListItem, {
|
|
242
|
+
dense: true,
|
|
243
|
+
disablePadding: true,
|
|
244
|
+
ref: el => itemRefs.current[index] = el,
|
|
245
|
+
sx: _objectSpread(_objectSpread({}, o.selected && {
|
|
246
|
+
backgroundColor: "#F5FAFF"
|
|
247
|
+
}), activeIndex === index && {
|
|
248
|
+
backgroundColor: theme.palette.action.hover
|
|
249
|
+
})
|
|
250
|
+
}, /*#__PURE__*/_react.default.createElement(_material.ListItemButton, {
|
|
251
|
+
disableRipple: true,
|
|
252
|
+
dense: true,
|
|
253
|
+
onClick: () => handleSelection(o),
|
|
254
|
+
onMouseEnter: () => setActiveIndex(index)
|
|
255
|
+
}, multiple && /*#__PURE__*/_react.default.createElement(_material.ListItemIcon, {
|
|
256
|
+
sx: {
|
|
257
|
+
minWidth: "initial"
|
|
258
|
+
}
|
|
259
|
+
}), showAvatar && /*#__PURE__*/_react.default.createElement(_material.ListItemAvatar, null, /*#__PURE__*/_react.default.createElement(_material.Avatar, {
|
|
260
|
+
sx: {
|
|
261
|
+
bgcolor: bgcAvatar
|
|
262
|
+
},
|
|
263
|
+
alt: altVal,
|
|
264
|
+
src: o[avatarKey]
|
|
265
|
+
})), /*#__PURE__*/_react.default.createElement(_material.ListItemText, null, /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
266
|
+
sx: {
|
|
267
|
+
display: "flex",
|
|
268
|
+
flexDirection: "row",
|
|
269
|
+
alignItems: "center"
|
|
270
|
+
},
|
|
271
|
+
gap: 1
|
|
272
|
+
}, o === null || o === void 0 ? void 0 : o.icon, /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
273
|
+
display: "flex",
|
|
274
|
+
justifyContent: "space-between",
|
|
275
|
+
width: "100%"
|
|
276
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
277
|
+
semibold: true,
|
|
278
|
+
variant: "caption"
|
|
279
|
+
}, o[displayKey]), /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
280
|
+
style: {
|
|
281
|
+
fontSize: 10
|
|
282
|
+
}
|
|
283
|
+
}, o.selected && "✓")))))), o.selected && /*#__PURE__*/_react.default.createElement(_material.Divider, {
|
|
284
|
+
sx: {
|
|
285
|
+
background: "#d3d3d3"
|
|
286
|
+
}
|
|
287
|
+
}));
|
|
288
|
+
})))), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
289
|
+
dense: true,
|
|
290
|
+
disablePadding: true,
|
|
291
|
+
sx: {
|
|
292
|
+
padding: 0,
|
|
293
|
+
margin: 0,
|
|
294
|
+
display: "flex",
|
|
295
|
+
justifyContent: "flex-end",
|
|
296
|
+
borderTop: "0.5px solid lightgrey"
|
|
297
|
+
}
|
|
298
|
+
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
299
|
+
disableRipple: true,
|
|
300
|
+
onClick: handleClearSelection,
|
|
301
|
+
variant: "text",
|
|
302
|
+
style: {
|
|
303
|
+
cursor: "pointer",
|
|
304
|
+
justifySelf: "end",
|
|
305
|
+
border: clearFocused ? "2px solid ".concat(theme.palette.primary.main) : "2px solid transparent",
|
|
306
|
+
borderRadius: 4
|
|
307
|
+
}
|
|
308
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
309
|
+
sx: {
|
|
310
|
+
color: theme.palette.primary.main
|
|
311
|
+
},
|
|
312
|
+
style: {
|
|
313
|
+
display: "flex",
|
|
314
|
+
justifySelf: "flex-end"
|
|
315
|
+
}
|
|
316
|
+
// pt={"0.5rem"}
|
|
317
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
318
|
+
semibold: true,
|
|
319
|
+
variant: "caption"
|
|
320
|
+
}, "Clear Selection"))))));
|
|
321
|
+
});
|
|
322
|
+
ValueSelector.propTypes = {
|
|
323
|
+
label: _propTypes.default.string.isRequired,
|
|
324
|
+
options: _propTypes.default.array,
|
|
325
|
+
valueKey: _propTypes.default.string,
|
|
326
|
+
displayKey: _propTypes.default.string,
|
|
327
|
+
onChange: _propTypes.default.func.isRequired,
|
|
328
|
+
multiple: _propTypes.default.bool,
|
|
329
|
+
optionsContainerWidth: _propTypes.default.string,
|
|
330
|
+
defaultSelectedOptionIds: _propTypes.default.array,
|
|
331
|
+
fetchData: _propTypes.default.func
|
|
332
|
+
};
|
|
333
|
+
var _default = exports.default = ValueSelector;
|
|
@@ -6,20 +6,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _material = require("@mui/material");
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _react = require("react");
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _bs = require("react-icons/bs");
|
|
11
11
|
var _button = _interopRequireDefault(require("../button"));
|
|
12
12
|
var _text = _interopRequireDefault(require("../text"));
|
|
13
13
|
var _ValueSelector = _interopRequireDefault(require("./ValueSelector"));
|
|
14
|
-
function
|
|
15
|
-
function
|
|
14
|
+
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); }
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
16
17
|
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."); }
|
|
17
|
-
function _unsupportedIterableToArray(
|
|
18
|
-
function _arrayLikeToArray(
|
|
19
|
-
function _iterableToArrayLimit(
|
|
20
|
-
function _arrayWithHoles(
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
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; } }
|
|
19
|
+
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; }
|
|
20
|
+
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; } }
|
|
21
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
22
|
+
const Filter = _ref => {
|
|
23
|
+
let label = _ref.label,
|
|
23
24
|
options = _ref.options,
|
|
24
25
|
valueKey = _ref.valueKey,
|
|
25
26
|
displayKey = _ref.displayKey,
|
|
@@ -37,63 +38,64 @@ var Filter = function Filter(_ref) {
|
|
|
37
38
|
onClick = _ref.onClick,
|
|
38
39
|
isSearch = _ref.isSearch,
|
|
39
40
|
loading = _ref.loading;
|
|
40
|
-
|
|
41
|
+
const _useState = (0, _react.useState)(false),
|
|
41
42
|
_useState2 = _slicedToArray(_useState, 2),
|
|
42
43
|
menuExpanded = _useState2[0],
|
|
43
44
|
setMenuExpanded = _useState2[1];
|
|
44
|
-
|
|
45
|
+
const _useState3 = (0, _react.useState)(null),
|
|
45
46
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
46
47
|
menuAnchor = _useState4[0],
|
|
47
48
|
setMenuAnchor = _useState4[1];
|
|
48
|
-
|
|
49
|
+
const _useState5 = (0, _react.useState)(defaultSelectedOptions),
|
|
49
50
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
50
51
|
selectedValues = _useState6[0],
|
|
51
52
|
setSelectedValues = _useState6[1];
|
|
52
|
-
(0, _react.useEffect)(
|
|
53
|
+
(0, _react.useEffect)(() => {
|
|
53
54
|
setSelectedValues(defaultSelectedOptions);
|
|
54
55
|
}, [defaultSelectedOptions]);
|
|
55
|
-
|
|
56
|
+
const handleMenuClose = () => {
|
|
56
57
|
setMenuAnchor(null);
|
|
57
58
|
if (!atleastOneItemSelected) setMenuExpanded(false);
|
|
58
59
|
};
|
|
59
|
-
|
|
60
|
+
const handleMenuOpen = e => {
|
|
60
61
|
setMenuAnchor(e.currentTarget);
|
|
61
62
|
setMenuExpanded(true);
|
|
62
63
|
onClick && onClick(true);
|
|
63
64
|
};
|
|
64
|
-
|
|
65
|
+
const handleChange = selection => {
|
|
65
66
|
setSelectedValues(selection);
|
|
66
67
|
onChange(selection);
|
|
67
68
|
};
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
const atleastOneItemSelected = selectedValues && selectedValues.length > 0;
|
|
70
|
+
const theme = (0, _material.useTheme)();
|
|
71
|
+
const _useState7 = (0, _react.useState)(""),
|
|
71
72
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
72
73
|
filter = _useState8[0],
|
|
73
74
|
setFilter = _useState8[1];
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
const valueSelectorRef = (0, _react.useRef)(null);
|
|
76
|
+
const inputRef = (0, _react.useRef)(null);
|
|
77
|
+
const handleKeyDown = e => {
|
|
78
|
+
if (["ArrowDown", "ArrowUp", "Enter", "Tab"].includes(e.key)) {
|
|
77
79
|
e.stopPropagation();
|
|
78
80
|
}
|
|
79
81
|
if (valueSelectorRef.current) {
|
|
80
82
|
valueSelectorRef.current.handleKeyDown(e);
|
|
81
83
|
}
|
|
82
84
|
};
|
|
83
|
-
|
|
84
|
-
|
|
85
|
+
const handleFilterChange = e => {
|
|
86
|
+
const value = e.target.value;
|
|
85
87
|
setFilter(value);
|
|
86
88
|
};
|
|
87
|
-
return /*#__PURE__*/
|
|
88
|
-
startIcon: /*#__PURE__*/
|
|
89
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
90
|
+
startIcon: /*#__PURE__*/_react.default.createElement(_bs.BsFilter, null),
|
|
89
91
|
variant: (selectedValues === null || selectedValues === void 0 ? void 0 : selectedValues.length) > 0 ? "contained" : buttonVariant,
|
|
90
92
|
onClick: handleMenuOpen
|
|
91
|
-
}, showSelectedValue ? /*#__PURE__*/
|
|
93
|
+
}, showSelectedValue ? /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
92
94
|
variant: "body2"
|
|
93
|
-
}, "".concat(label).concat(atleastOneItemSelected ? ": ".concat(selectedValues[0][displayKey]).concat(selectedValues.length > 1 ? " +".concat(selectedValues.length - 1) : "") : "")) : /*#__PURE__*/
|
|
95
|
+
}, "".concat(label).concat(atleastOneItemSelected ? ": ".concat(selectedValues[0][displayKey]).concat(selectedValues.length > 1 ? " +".concat(selectedValues.length - 1) : "") : "")) : /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
94
96
|
semibold: true,
|
|
95
97
|
variant: "body2"
|
|
96
|
-
}, label)), /*#__PURE__*/
|
|
98
|
+
}, label)), /*#__PURE__*/_react.default.createElement(_material.Menu, {
|
|
97
99
|
sx: {
|
|
98
100
|
padding: 0,
|
|
99
101
|
paddingTop: theme.spacing(0.5),
|
|
@@ -121,87 +123,84 @@ var Filter = function Filter(_ref) {
|
|
|
121
123
|
overflow: "auto"
|
|
122
124
|
}
|
|
123
125
|
}
|
|
124
|
-
}, /*#__PURE__*/
|
|
126
|
+
}, /*#__PURE__*/_react.default.createElement(_material.MenuItem, {
|
|
125
127
|
disabled: true
|
|
126
|
-
}, /*#__PURE__*/
|
|
128
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
127
129
|
pb: 0.5,
|
|
128
130
|
pl: 1,
|
|
129
131
|
display: "flex",
|
|
130
132
|
flexDirection: "row",
|
|
131
133
|
alignItems: "center"
|
|
132
|
-
}, /*#__PURE__*/
|
|
134
|
+
}, /*#__PURE__*/_react.default.createElement(_bs.BsFilter, null), /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
133
135
|
bold: true,
|
|
134
136
|
variant: "body2",
|
|
135
137
|
sx: {
|
|
136
138
|
marginLeft: "0.75rem"
|
|
137
139
|
}
|
|
138
|
-
}, (label === null || label === void 0 ? void 0 : label.toUpperCase()) || "FILTER"))), /*#__PURE__*/
|
|
140
|
+
}, (label === null || label === void 0 ? void 0 : label.toUpperCase()) || "FILTER"))), /*#__PURE__*/_react.default.createElement(_material.Divider, null), isSearch && /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
139
141
|
paddingLeft: 2,
|
|
140
142
|
paddingRight: 2,
|
|
141
143
|
paddingTop: 1.5,
|
|
142
144
|
paddingBottom: 1.5
|
|
143
|
-
}, /*#__PURE__*/
|
|
145
|
+
}, /*#__PURE__*/_react.default.createElement(_material.TextField, {
|
|
146
|
+
inputRef: inputRef,
|
|
144
147
|
fullWidth: true,
|
|
145
148
|
autoFocus: true,
|
|
146
149
|
value: filter,
|
|
147
150
|
onChange: handleFilterChange,
|
|
148
151
|
placeholder: "Type to search...",
|
|
149
152
|
variant: "standard"
|
|
150
|
-
})), /*#__PURE__*/
|
|
153
|
+
})), /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
151
154
|
height: "100%"
|
|
152
|
-
}, /*#__PURE__*/
|
|
155
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
153
156
|
container: true,
|
|
154
157
|
sx: {
|
|
155
158
|
padding: "0 0.25rem",
|
|
156
159
|
maxWidth: optionsContainerWidth,
|
|
157
160
|
width: optionsContainerWidth
|
|
158
161
|
}
|
|
159
|
-
}, /*#__PURE__*/
|
|
162
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
160
163
|
item: true,
|
|
161
164
|
xs: 12
|
|
162
|
-
}, loading ? /*#__PURE__*/
|
|
165
|
+
}, loading ? /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
163
166
|
style: {
|
|
164
167
|
padding: "0 0.5rem"
|
|
165
168
|
}
|
|
166
|
-
}, /*#__PURE__*/
|
|
169
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Skeleton, {
|
|
167
170
|
style: {
|
|
168
171
|
marginBottom: 5
|
|
169
172
|
},
|
|
170
173
|
variant: "rectangular",
|
|
171
174
|
width: "100%",
|
|
172
175
|
height: 10
|
|
173
|
-
}), /*#__PURE__*/
|
|
176
|
+
}), /*#__PURE__*/_react.default.createElement(_material.Skeleton, {
|
|
174
177
|
style: {
|
|
175
178
|
marginBottom: 5
|
|
176
179
|
},
|
|
177
180
|
variant: "rectangular",
|
|
178
181
|
width: "100%",
|
|
179
182
|
height: 10
|
|
180
|
-
}), /*#__PURE__*/
|
|
183
|
+
}), /*#__PURE__*/_react.default.createElement(_material.Skeleton, {
|
|
181
184
|
style: {
|
|
182
185
|
marginBottom: 5
|
|
183
186
|
},
|
|
184
187
|
variant: "rectangular",
|
|
185
188
|
width: "100%",
|
|
186
189
|
height: 10
|
|
187
|
-
}), /*#__PURE__*/
|
|
190
|
+
}), /*#__PURE__*/_react.default.createElement(_material.Skeleton, {
|
|
188
191
|
style: {
|
|
189
192
|
marginBottom: 5
|
|
190
193
|
},
|
|
191
194
|
variant: "rectangular",
|
|
192
195
|
width: "100%",
|
|
193
196
|
height: 10
|
|
194
|
-
})) : /*#__PURE__*/
|
|
197
|
+
})) : /*#__PURE__*/_react.default.createElement(_ValueSelector.default, {
|
|
195
198
|
ref: valueSelectorRef,
|
|
199
|
+
inputRef: inputRef,
|
|
196
200
|
key: JSON.stringify(filter),
|
|
197
|
-
options:
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
defaultSelectedOptionIds: selectedValues ? selectedValues.map(function (s) {
|
|
201
|
-
return s[valueKey];
|
|
202
|
-
}) : defaultSelectedOptions.map(function (s) {
|
|
203
|
-
return s[valueKey];
|
|
204
|
-
}),
|
|
201
|
+
options: options,
|
|
202
|
+
searchText: filter,
|
|
203
|
+
defaultSelectedOptionIds: selectedValues ? selectedValues.map(s => s[valueKey]) : defaultSelectedOptions.map(s => s[valueKey]),
|
|
205
204
|
valueKey: valueKey,
|
|
206
205
|
displayKey: displayKey,
|
|
207
206
|
avatarKey: avatarKey,
|
|
@@ -229,5 +228,4 @@ Filter.propTypes = {
|
|
|
229
228
|
Filter.defaultProps = {
|
|
230
229
|
defaultSelectedOptions: []
|
|
231
230
|
};
|
|
232
|
-
var _default = Filter;
|
|
233
|
-
exports.default = _default;
|
|
231
|
+
var _default = exports.default = Filter;
|
|
@@ -8,8 +8,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _LoadingButton = _interopRequireDefault(require("@mui/lab/LoadingButton"));
|
|
10
10
|
var _material = require("@mui/material");
|
|
11
|
-
function _interopRequireDefault(
|
|
12
|
-
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
const IconButton = props => {
|
|
13
13
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !props.loading ? /*#__PURE__*/_react.default.createElement(_material.Tooltip, {
|
|
14
14
|
arrow: true,
|
|
15
15
|
placement: "top",
|
|
@@ -30,5 +30,4 @@ IconButton.prototypes = {
|
|
|
30
30
|
color: _propTypes.default.oneOf(["primary", "secondary", "#ff0000"]),
|
|
31
31
|
loading: _propTypes.default.oneOf([true, false])
|
|
32
32
|
};
|
|
33
|
-
var _default = IconButton;
|
|
34
|
-
exports.default = _default;
|
|
33
|
+
var _default = exports.default = IconButton;
|