@abtnode/ux 1.15.17 → 1.16.0-beta-b16cb035
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/lib/actions.js +111 -0
- package/lib/blocklet/access/config-access.js +303 -0
- package/lib/blocklet/access/index.js +221 -0
- package/lib/blocklet/actions.js +438 -0
- package/lib/blocklet/add-cert.js +191 -0
- package/lib/blocklet/agreement-app.js +30 -0
- package/lib/blocklet/agreement.js +72 -0
- package/lib/blocklet/app-avatar.js +74 -0
- package/lib/blocklet/audit-logs.js +197 -0
- package/lib/blocklet/blocklet-source.js +56 -0
- package/lib/blocklet/bundle-avatar.js +80 -0
- package/lib/blocklet/component/add.js +1063 -0
- package/lib/blocklet/component/configuration.js +124 -0
- package/lib/blocklet/component/delete.js +117 -0
- package/lib/blocklet/component/environment.js +289 -0
- package/lib/blocklet/component/expiration.js +53 -0
- package/lib/blocklet/component/index.js +804 -0
- package/lib/blocklet/component/line.js +28 -0
- package/lib/blocklet/component/navigation/locale-tabs.js +218 -0
- package/lib/blocklet/component/navigation/navigation-actions.js +120 -0
- package/lib/blocklet/component/navigation/navigation-dialog.js +620 -0
- package/lib/blocklet/component/navigation/navigation-preview.js +102 -0
- package/lib/blocklet/component/navigation/simple-select.js +131 -0
- package/lib/blocklet/component/select-store.js +153 -0
- package/lib/blocklet/component/setting.js +151 -0
- package/lib/blocklet/component/sortable-tree.js +138 -0
- package/lib/blocklet/component/space-gateway-selector.js +174 -0
- package/lib/blocklet/component/store-blocklet-list.js +205 -0
- package/lib/blocklet/config-navigation.js +344 -0
- package/lib/blocklet/configuration.js +574 -0
- package/lib/blocklet/disk-info.js +91 -0
- package/lib/blocklet/icons.js +26 -0
- package/lib/blocklet/install-from-url.js +347 -0
- package/lib/blocklet/log.js +62 -0
- package/lib/blocklet/migration.js +153 -0
- package/lib/blocklet/mode.js +35 -0
- package/lib/blocklet/monitor.js +186 -0
- package/lib/blocklet/overview.js +236 -0
- package/lib/blocklet/preferences/app-sk.js +131 -0
- package/lib/blocklet/preferences/index.js +238 -0
- package/lib/blocklet/preferences/wallet-type.js +107 -0
- package/lib/blocklet/purchase/common.js +103 -0
- package/lib/blocklet/purchase/component-purchase.js +253 -0
- package/lib/blocklet/purchase/index.js +13 -0
- package/lib/blocklet/router/action/add-domain-alias.js +173 -0
- package/lib/blocklet/router/action/add-rule.js +204 -0
- package/lib/blocklet/router/action/config-routing-rule.js +129 -0
- package/lib/blocklet/router/action/delete-domain-alias.js +107 -0
- package/lib/blocklet/router/action/delete-rule.js +114 -0
- package/lib/blocklet/router/action/update-rule.js +203 -0
- package/lib/blocklet/router/domain-actions.js +71 -0
- package/lib/blocklet/router/domain-status.js +96 -0
- package/lib/blocklet/router/rule-actions.js +77 -0
- package/lib/blocklet/router/rule-list.js +181 -0
- package/lib/blocklet/router/util.js +146 -0
- package/lib/blocklet/runtime-info.js +87 -0
- package/lib/blocklet/status.js +105 -0
- package/lib/blocklet/storage.js +322 -0
- package/lib/blocklet/types.js +25 -0
- package/lib/blocklet/util.js +213 -0
- package/lib/blocklet/version.js +156 -0
- package/lib/card-selector.js +109 -0
- package/lib/certificate.js +110 -0
- package/lib/click-to-copy.js +38 -0
- package/lib/confirm.js +149 -0
- package/lib/contexts/audit-log.js +141 -0
- package/lib/contexts/blocklet.js +19 -0
- package/lib/contexts/deleting-blocklets.js +78 -0
- package/lib/contexts/node.js +30 -0
- package/lib/contexts/session.js +20 -0
- package/lib/contexts/team.js +19 -0
- package/lib/delete-confirm.js +127 -0
- package/lib/did-address.js +77 -0
- package/lib/dot.js +18 -0
- package/lib/form/form-text-input.js +266 -0
- package/lib/form/form-wrapper.js +13 -0
- package/lib/form/required.js +13 -0
- package/lib/hooks/blocklet.js +231 -0
- package/lib/hooks/mobile-width.js +19 -0
- package/lib/hooks/url-evaluation.js +168 -0
- package/lib/hooks/use-app-logo.js +25 -0
- package/lib/hooks/use-bundle-logo.js +36 -0
- package/lib/hooks/use-navigation.js +355 -0
- package/lib/hooks/use-passport-id.js +21 -0
- package/lib/hooks/use-subscription.js +28 -0
- package/lib/icons/long-arrow.svg +5 -0
- package/lib/index.js +0 -3
- package/lib/invitation/invitation-app.js +51 -0
- package/lib/invitation/invitation-login.js +47 -0
- package/lib/invitation/invitation-passport.js +130 -0
- package/lib/invitation/invitation-receive.js +108 -0
- package/lib/invitation/invitation-success.js +82 -0
- package/lib/invitation/invitation-user.js +79 -0
- package/lib/invitation/invitation.js +80 -0
- package/lib/issue-passport.js +84 -84
- package/lib/launch-blocklet/content-layout.js +33 -0
- package/lib/launch-blocklet/page-header.js +38 -0
- package/lib/layout/addon.js +100 -0
- package/lib/layout/feedback.js +55 -0
- package/lib/locales/en.js +1221 -10
- package/lib/locales/index.js +3 -4
- package/lib/locales/zh.js +1232 -15
- package/lib/logs/clock.js +19 -0
- package/lib/logs/download.js +139 -0
- package/lib/logs/log-terminal.js +183 -0
- package/lib/lost-passport.js +191 -195
- package/lib/monitor/card.js +73 -0
- package/lib/monitor/cpu.js +109 -0
- package/lib/monitor/disk.js +122 -0
- package/lib/monitor/memory.js +144 -0
- package/lib/nav-logo.js +120 -0
- package/lib/passport-tag.js +43 -0
- package/lib/permission.js +70 -0
- package/lib/relative-time.js +61 -0
- package/lib/schema-form/color-input.js +105 -0
- package/lib/schema-form/common-prop-types.js +21 -0
- package/lib/schema-form/index.js +229 -0
- package/lib/schema-form/passport-input.js +66 -0
- package/lib/schema-form/text-input.js +72 -0
- package/lib/store/add.js +185 -0
- package/lib/store/delete.js +102 -0
- package/lib/store/item.js +84 -0
- package/lib/table-icons.js +42 -0
- package/lib/table.js +13 -0
- package/lib/tag.js +37 -0
- package/lib/team/members/actions.js +99 -0
- package/lib/team/members/index.js +503 -0
- package/lib/team/members/invitations.js +196 -0
- package/lib/team/members/invite-member.js +212 -0
- package/lib/team/members/issue-passport.js +155 -0
- package/lib/team/members/member.js +300 -0
- package/lib/team/members/passport-issuances.js +154 -0
- package/lib/team/members/passports.js +336 -0
- package/lib/team/members/toggle-user-approval.js +128 -0
- package/lib/team/members/transfer-node.js +262 -0
- package/lib/team/members/util.js +20 -0
- package/lib/team/passports/color.js +132 -0
- package/lib/team/passports/detail.js +271 -0
- package/lib/team/passports/index.js +233 -0
- package/lib/team/passports/mutate-role.js +204 -0
- package/lib/team/passports/trusted-issuer.js +297 -0
- package/lib/team/passports/trusted-issuers.js +240 -0
- package/lib/team/search-input.js +38 -0
- package/lib/team/styles/dialog.js +13 -0
- package/lib/team/styles/list-header.js +13 -0
- package/lib/toast.js +86 -0
- package/lib/util/api.js +21 -0
- package/lib/util/constants.js +10 -0
- package/lib/util/index.js +703 -0
- package/lib/util/locales.js +28 -0
- package/lib/util/mode.js +11 -0
- package/lib/who-can-access/config.js +46 -0
- package/lib/wrap-locale.js +12 -13
- package/package.json +69 -17
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = Line;
|
|
7
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
|
+
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
function Line(_ref) {
|
|
12
|
+
let {
|
|
13
|
+
depth
|
|
14
|
+
} = _ref;
|
|
15
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
16
|
+
ml: Math.max((depth - 1) * 2, 0),
|
|
17
|
+
sx: {
|
|
18
|
+
borderBottom: 1,
|
|
19
|
+
borderColor: 'rgba(0,0,0,0.12)'
|
|
20
|
+
}
|
|
21
|
+
}, "group-collapse-box");
|
|
22
|
+
}
|
|
23
|
+
Line.propTypes = {
|
|
24
|
+
depth: _propTypes.default.number
|
|
25
|
+
};
|
|
26
|
+
Line.defaultProps = {
|
|
27
|
+
depth: 1
|
|
28
|
+
};
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
|
+
var _ahooks = require("ahooks");
|
|
9
|
+
var _lodash = require("lodash");
|
|
10
|
+
var _react = require("react");
|
|
11
|
+
var _react2 = require("@iconify/react");
|
|
12
|
+
var _material = require("@mui/material");
|
|
13
|
+
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
14
|
+
var _simpleSelect = _interopRequireDefault(require("./simple-select"));
|
|
15
|
+
var _locales = _interopRequireDefault(require("../../../util/locales"));
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
+
/* eslint-disable react/jsx-no-bind */
|
|
19
|
+
|
|
20
|
+
const defaultLocale = 'en';
|
|
21
|
+
function LocaleTabs(_ref) {
|
|
22
|
+
let {
|
|
23
|
+
sx,
|
|
24
|
+
onChange,
|
|
25
|
+
locales,
|
|
26
|
+
onRemoveLocale
|
|
27
|
+
} = _ref;
|
|
28
|
+
const {
|
|
29
|
+
t
|
|
30
|
+
} = (0, _context.useLocaleContext)();
|
|
31
|
+
const inputRef = (0, _react.useRef)();
|
|
32
|
+
const [addLocaleButtonEl, setAddLocaleButtonEl] = (0, _react.useState)(null);
|
|
33
|
+
const state = (0, _ahooks.useReactive)({
|
|
34
|
+
currentLocale: defaultLocale,
|
|
35
|
+
localeList: [],
|
|
36
|
+
inputLocale: '',
|
|
37
|
+
localeError: ''
|
|
38
|
+
});
|
|
39
|
+
const openChooseLocale = (0, _react.useMemo)(() => {
|
|
40
|
+
return !!addLocaleButtonEl;
|
|
41
|
+
}, [addLocaleButtonEl]);
|
|
42
|
+
const localeOptions = (0, _react.useMemo)(() => {
|
|
43
|
+
return Object.keys((0, _lodash.omit)(_locales.default, [...state.localeList, defaultLocale])).map(locale => ({
|
|
44
|
+
title: _locales.default[locale],
|
|
45
|
+
value: locale
|
|
46
|
+
}));
|
|
47
|
+
}, [state.localeList]);
|
|
48
|
+
(0, _react.useEffect)(() => {
|
|
49
|
+
onChange(state.currentLocale);
|
|
50
|
+
}, [onChange, state.currentLocale]);
|
|
51
|
+
(0, _react.useEffect)(() => {
|
|
52
|
+
state.localeList = [...locales];
|
|
53
|
+
}, [locales, state]);
|
|
54
|
+
(0, _ahooks.useKeyPress)('enter', () => {
|
|
55
|
+
// HACK: 必须加一个延时,否则无法正确关闭 chooseLocale 弹窗
|
|
56
|
+
setTimeout(() => {
|
|
57
|
+
handleAddLocale();
|
|
58
|
+
});
|
|
59
|
+
}, {
|
|
60
|
+
target: inputRef
|
|
61
|
+
});
|
|
62
|
+
function checkLocale(locale) {
|
|
63
|
+
if (!locale) {
|
|
64
|
+
return t('common.requiredErrorText', {
|
|
65
|
+
name: 'Locale'
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
if (locale === 'en' || state.localeList.includes(locale)) {
|
|
69
|
+
return t('navigation.form.localeExists', {
|
|
70
|
+
value: locale
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
function checkValidLocale() {
|
|
76
|
+
let locale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
77
|
+
const value = locale === null || locale === void 0 ? void 0 : locale.trim();
|
|
78
|
+
const checkResult = checkLocale(value);
|
|
79
|
+
if (checkResult !== true) {
|
|
80
|
+
state.localeError = checkResult;
|
|
81
|
+
} else {
|
|
82
|
+
state.localeError = '';
|
|
83
|
+
}
|
|
84
|
+
return checkResult;
|
|
85
|
+
}
|
|
86
|
+
function handleAddLocale() {
|
|
87
|
+
var _state$inputLocale;
|
|
88
|
+
const value = (_state$inputLocale = state.inputLocale) === null || _state$inputLocale === void 0 ? void 0 : _state$inputLocale.trim();
|
|
89
|
+
const checkResult = checkValidLocale(value);
|
|
90
|
+
if (checkResult === true) {
|
|
91
|
+
close();
|
|
92
|
+
state.localeList.push(value);
|
|
93
|
+
state.currentLocale = value;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function close() {
|
|
97
|
+
setAddLocaleButtonEl(null);
|
|
98
|
+
state.inputLocale = '';
|
|
99
|
+
state.localeError = '';
|
|
100
|
+
}
|
|
101
|
+
function handleRemoveLocale(e, locale) {
|
|
102
|
+
e.preventDefault();
|
|
103
|
+
e.stopPropagation();
|
|
104
|
+
state.localeList = (0, _lodash.without)(state.localeList, locale);
|
|
105
|
+
onRemoveLocale(locale);
|
|
106
|
+
if (locale === state.currentLocale) {
|
|
107
|
+
state.currentLocale = defaultLocale;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function handleChangeLocale(e) {
|
|
111
|
+
const {
|
|
112
|
+
value
|
|
113
|
+
} = e.target;
|
|
114
|
+
checkValidLocale(value);
|
|
115
|
+
state.inputLocale = value;
|
|
116
|
+
}
|
|
117
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
118
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Tabs, {
|
|
119
|
+
sx: sx,
|
|
120
|
+
value: state.currentLocale,
|
|
121
|
+
onChange: (e, value) => {
|
|
122
|
+
state.currentLocale = value;
|
|
123
|
+
},
|
|
124
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tab, {
|
|
125
|
+
label: "Default (".concat(_locales.default[defaultLocale], ")"),
|
|
126
|
+
value: "en"
|
|
127
|
+
}), state.localeList.map(item => /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tab, {
|
|
128
|
+
sx: {
|
|
129
|
+
position: 'relative'
|
|
130
|
+
},
|
|
131
|
+
label: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
132
|
+
children: [_locales.default[item], /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
133
|
+
size: "small",
|
|
134
|
+
color: "inherit",
|
|
135
|
+
sx: {
|
|
136
|
+
position: 'absolute',
|
|
137
|
+
top: 0,
|
|
138
|
+
right: 0
|
|
139
|
+
},
|
|
140
|
+
onClick: e => {
|
|
141
|
+
handleRemoveLocale(e, item);
|
|
142
|
+
},
|
|
143
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.Icon, {
|
|
144
|
+
icon: "mdi:close",
|
|
145
|
+
height: 14
|
|
146
|
+
})
|
|
147
|
+
})]
|
|
148
|
+
}),
|
|
149
|
+
value: item
|
|
150
|
+
}, item)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
151
|
+
color: "primary",
|
|
152
|
+
disableFocusRipple: true,
|
|
153
|
+
sx: {
|
|
154
|
+
width: '48px'
|
|
155
|
+
},
|
|
156
|
+
onClick: e => {
|
|
157
|
+
setAddLocaleButtonEl(e.currentTarget);
|
|
158
|
+
},
|
|
159
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.Icon, {
|
|
160
|
+
icon: "mdi:plus"
|
|
161
|
+
})
|
|
162
|
+
})]
|
|
163
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Popover, {
|
|
164
|
+
open: openChooseLocale,
|
|
165
|
+
anchorEl: addLocaleButtonEl,
|
|
166
|
+
onClose: close,
|
|
167
|
+
anchorOrigin: {
|
|
168
|
+
vertical: 'bottom',
|
|
169
|
+
horizontal: 'left'
|
|
170
|
+
},
|
|
171
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
172
|
+
sx: {
|
|
173
|
+
p: 2,
|
|
174
|
+
width: '270px'
|
|
175
|
+
},
|
|
176
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
177
|
+
variant: "subtitle2",
|
|
178
|
+
children: t('navigation.form.localePlaceholder')
|
|
179
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
180
|
+
mt: 1,
|
|
181
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_simpleSelect.default, {
|
|
182
|
+
required: true,
|
|
183
|
+
fullWidth: true,
|
|
184
|
+
label: "Locale",
|
|
185
|
+
value: state.inputLocale,
|
|
186
|
+
options: localeOptions,
|
|
187
|
+
onChange: handleChangeLocale,
|
|
188
|
+
error: !!state.localeError,
|
|
189
|
+
helperText: state.localeError || ' '
|
|
190
|
+
})
|
|
191
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
192
|
+
display: "flex",
|
|
193
|
+
justifyContent: "flex-end",
|
|
194
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
|
|
195
|
+
size: "small",
|
|
196
|
+
variant: "contained",
|
|
197
|
+
onClick: handleAddLocale,
|
|
198
|
+
children: t('common.confirm')
|
|
199
|
+
})
|
|
200
|
+
})]
|
|
201
|
+
})
|
|
202
|
+
})]
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
LocaleTabs.propTypes = {
|
|
206
|
+
sx: _propTypes.default.any,
|
|
207
|
+
onChange: _propTypes.default.func,
|
|
208
|
+
onRemoveLocale: _propTypes.default.func,
|
|
209
|
+
locales: _propTypes.default.array
|
|
210
|
+
};
|
|
211
|
+
LocaleTabs.defaultProps = {
|
|
212
|
+
sx: null,
|
|
213
|
+
onChange: () => {},
|
|
214
|
+
onRemoveLocale: () => {},
|
|
215
|
+
locales: []
|
|
216
|
+
};
|
|
217
|
+
var _default = LocaleTabs;
|
|
218
|
+
exports.default = _default;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
|
+
var _react = require("@iconify/react");
|
|
9
|
+
var _material = require("@mui/material");
|
|
10
|
+
var _react2 = require("react");
|
|
11
|
+
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
function NavigationActions(_ref) {
|
|
15
|
+
let {
|
|
16
|
+
className,
|
|
17
|
+
add,
|
|
18
|
+
edit,
|
|
19
|
+
toggle,
|
|
20
|
+
del,
|
|
21
|
+
data,
|
|
22
|
+
section
|
|
23
|
+
} = _ref;
|
|
24
|
+
const {
|
|
25
|
+
t
|
|
26
|
+
} = (0, _context.useLocaleContext)();
|
|
27
|
+
const isDisabled = ['yaml', 'tmpl'].includes(data.from);
|
|
28
|
+
const isUninstalled = /*#__PURE__*/(0, _react2.isValidElement)(data.subtitle);
|
|
29
|
+
function handleClick(e) {
|
|
30
|
+
e.preventDefault();
|
|
31
|
+
e.stopPropagation();
|
|
32
|
+
}
|
|
33
|
+
const handleClickAdd = (0, _react2.useCallback)(e => {
|
|
34
|
+
handleClick(e);
|
|
35
|
+
add(data);
|
|
36
|
+
}, [add, data]);
|
|
37
|
+
const handleClickEdit = (0, _react2.useCallback)(e => {
|
|
38
|
+
handleClick(e);
|
|
39
|
+
edit(data);
|
|
40
|
+
}, [edit, data]);
|
|
41
|
+
const handleClickToggle = (0, _react2.useCallback)(e => {
|
|
42
|
+
handleClick(e);
|
|
43
|
+
toggle(data);
|
|
44
|
+
}, [toggle, data]);
|
|
45
|
+
const handleClickDelete = (0, _react2.useCallback)(e => {
|
|
46
|
+
handleClick(e);
|
|
47
|
+
del(data);
|
|
48
|
+
}, [del, data]);
|
|
49
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
50
|
+
className: className,
|
|
51
|
+
children: [!data.parent && ['header', 'footer', 'dashboard'].includes(section) && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
52
|
+
title: isUninstalled ? t('navigation.action.noAddSub') : t('navigation.action.addSub'),
|
|
53
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
54
|
+
size: "small",
|
|
55
|
+
color: "success",
|
|
56
|
+
onClick: handleClickAdd,
|
|
57
|
+
disabled: isUninstalled,
|
|
58
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Icon, {
|
|
59
|
+
icon: "mdi:plus-box-outline"
|
|
60
|
+
})
|
|
61
|
+
})
|
|
62
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
63
|
+
title: isUninstalled ? t('navigation.action.noEdit') : t('navigation.action.edit'),
|
|
64
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
65
|
+
size: "small",
|
|
66
|
+
color: "primary",
|
|
67
|
+
onClick: handleClickEdit,
|
|
68
|
+
disabled: isUninstalled,
|
|
69
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Icon, {
|
|
70
|
+
icon: "mdi:pencil"
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
74
|
+
title:
|
|
75
|
+
// eslint-disable-next-line no-nested-ternary
|
|
76
|
+
isUninstalled ? t('navigation.action.noEdit') : data.visible ? t('navigation.action.hide') : t('navigation.action.show'),
|
|
77
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
78
|
+
size: "small",
|
|
79
|
+
color: "warning",
|
|
80
|
+
onClick: handleClickToggle,
|
|
81
|
+
disabled: isUninstalled,
|
|
82
|
+
children: data.visible === false ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Icon, {
|
|
83
|
+
icon: "mdi:eye-off-outline"
|
|
84
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Icon, {
|
|
85
|
+
icon: "mdi:eye-outline"
|
|
86
|
+
})
|
|
87
|
+
})
|
|
88
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
89
|
+
title: isDisabled && !isUninstalled ? t('navigation.action.noDel') : t('navigation.action.del'),
|
|
90
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
91
|
+
disabled: isDisabled && !isUninstalled,
|
|
92
|
+
size: "small",
|
|
93
|
+
color: "error",
|
|
94
|
+
onClick: handleClickDelete,
|
|
95
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Icon, {
|
|
96
|
+
icon: "mdi:delete"
|
|
97
|
+
})
|
|
98
|
+
})
|
|
99
|
+
})]
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
NavigationActions.propTypes = {
|
|
103
|
+
data: _propTypes.default.object.isRequired,
|
|
104
|
+
className: _propTypes.default.string,
|
|
105
|
+
add: _propTypes.default.func,
|
|
106
|
+
edit: _propTypes.default.func,
|
|
107
|
+
toggle: _propTypes.default.func,
|
|
108
|
+
del: _propTypes.default.func,
|
|
109
|
+
section: _propTypes.default.string
|
|
110
|
+
};
|
|
111
|
+
NavigationActions.defaultProps = {
|
|
112
|
+
className: '',
|
|
113
|
+
add: () => {},
|
|
114
|
+
edit: () => {},
|
|
115
|
+
toggle: () => {},
|
|
116
|
+
del: () => {},
|
|
117
|
+
section: ''
|
|
118
|
+
};
|
|
119
|
+
var _default = NavigationActions;
|
|
120
|
+
exports.default = _default;
|