awing-library 2.1.71 → 2.1.72
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.
|
@@ -22,12 +22,22 @@ var common_1 = require("./common");
|
|
|
22
22
|
var react_i18next_1 = require("react-i18next");
|
|
23
23
|
var i18n_1 = __importDefault(require("../../../../i18n"));
|
|
24
24
|
var lab_1 = require("@mui/lab");
|
|
25
|
-
var
|
|
25
|
+
var Context_1 = __importDefault(require("./Context"));
|
|
26
26
|
var SplitButtonExportType = function (props) {
|
|
27
27
|
var onSubmit = props.onSubmit, loading = props.loading;
|
|
28
|
+
var services = (0, Context_1.default)().services;
|
|
28
29
|
var _a = react_1.default.useState(false), open = _a[0], setOpen = _a[1];
|
|
29
30
|
var anchorRef = react_1.default.useRef(null);
|
|
30
31
|
var _b = react_1.default.useState(0), selectedIndex = _b[0], setSelectedIndex = _b[1];
|
|
32
|
+
var options = react_1.default.useMemo(function () {
|
|
33
|
+
return Object.values(common_1.EXPORT_TYPES)
|
|
34
|
+
.map(function (type, idx) { return type; })
|
|
35
|
+
.filter(function (type) {
|
|
36
|
+
return services.domainsGetAll ? true : type !== 'Domain';
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
40
|
+
[]);
|
|
31
41
|
var t = (0, react_i18next_1.useTranslation)(undefined, { i18n: i18n_1.default }).t;
|
|
32
42
|
var handleClick = function () {
|
|
33
43
|
onSubmit(options[selectedIndex]);
|