@abtnode/ux 1.16.21-beta-7b40ffb4 → 1.16.21-beta-bd0e2503
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/es/blocklet/configuration.js +8 -2
- package/es/form/form-autocomplete-input.js +6 -2
- package/es/locales/en.js +1 -0
- package/es/locales/zh.js +1 -0
- package/lib/blocklet/configuration.js +8 -2
- package/lib/form/form-autocomplete-input.js +7 -3
- package/lib/locales/en.js +1 -0
- package/lib/locales/zh.js +1 -0
- package/package.json +8 -8
|
@@ -364,8 +364,14 @@ function BlockletEnvironment({
|
|
|
364
364
|
initialValue: customLanguages ? customLanguages.value.split(',') : ['en', 'zh'],
|
|
365
365
|
onSubmit: value => onSubmitConfig('BLOCKLET_APP_LANGUAGES', value),
|
|
366
366
|
helperText: t('blocklet.config.selectLanguagesTip'),
|
|
367
|
-
placeholder: t('
|
|
368
|
-
filterKeys: languagesFilterKeys
|
|
367
|
+
placeholder: t('blocklet.config.languagesSearch'),
|
|
368
|
+
filterKeys: languagesFilterKeys,
|
|
369
|
+
renderLabel: (code, item) => {
|
|
370
|
+
if (item.name === item.enName) {
|
|
371
|
+
return `${item.name} (${code.toUpperCase()})`;
|
|
372
|
+
}
|
|
373
|
+
return `${item.name}, ${item.enName} (${code.toUpperCase()})`;
|
|
374
|
+
}
|
|
369
375
|
})]
|
|
370
376
|
}), /*#__PURE__*/_jsx(Box, {
|
|
371
377
|
className: "config-form",
|
|
@@ -32,6 +32,7 @@ export default function FormAutocompleteInput({
|
|
|
32
32
|
helperText,
|
|
33
33
|
placeholder,
|
|
34
34
|
renderImage,
|
|
35
|
+
renderLabel,
|
|
35
36
|
filterKeys,
|
|
36
37
|
noEmpty,
|
|
37
38
|
...rest
|
|
@@ -148,7 +149,7 @@ export default function FormAutocompleteInput({
|
|
|
148
149
|
flex: 1,
|
|
149
150
|
fontWeight: selected ? '700' : 'normal'
|
|
150
151
|
},
|
|
151
|
-
children: optionsMap[code]?.name
|
|
152
|
+
children: renderLabel(code, optionsMap[code]) || optionsMap[code]?.name
|
|
152
153
|
}), /*#__PURE__*/_jsx(Box, {
|
|
153
154
|
component: CloseIcon,
|
|
154
155
|
sx: {
|
|
@@ -237,7 +238,8 @@ FormAutocompleteInput.propTypes = {
|
|
|
237
238
|
placeholder: PropTypes.string,
|
|
238
239
|
renderImage: PropTypes.func,
|
|
239
240
|
filterKeys: PropTypes.arrayOf(PropTypes.string),
|
|
240
|
-
noEmpty: PropTypes.bool
|
|
241
|
+
noEmpty: PropTypes.bool,
|
|
242
|
+
renderLabel: PropTypes.func
|
|
241
243
|
};
|
|
242
244
|
FormAutocompleteInput.defaultProps = {
|
|
243
245
|
style: {},
|
|
@@ -254,6 +256,8 @@ FormAutocompleteInput.defaultProps = {
|
|
|
254
256
|
placeholder: '',
|
|
255
257
|
filterKeys: ['name'],
|
|
256
258
|
renderImage: () => null,
|
|
259
|
+
// eslint-disable-next-line no-unused-vars
|
|
260
|
+
renderLabel: (code, item) => '',
|
|
257
261
|
noEmpty: false
|
|
258
262
|
};
|
|
259
263
|
const Row = styled.div`
|
package/es/locales/en.js
CHANGED
|
@@ -420,6 +420,7 @@ export default {
|
|
|
420
420
|
},
|
|
421
421
|
languages: 'Supported Languages',
|
|
422
422
|
selectLanguagesTip: 'Adjust the order by removing and re-adding',
|
|
423
|
+
languagesSearch: "Search by Country's Local Name, English Name, or ISO Code...",
|
|
423
424
|
passportColor: 'Passport Color',
|
|
424
425
|
appUrl: 'App URL',
|
|
425
426
|
access: {
|
package/es/locales/zh.js
CHANGED
|
@@ -383,8 +383,14 @@ function BlockletEnvironment(_ref) {
|
|
|
383
383
|
initialValue: customLanguages ? customLanguages.value.split(',') : ['en', 'zh'],
|
|
384
384
|
onSubmit: value => onSubmitConfig('BLOCKLET_APP_LANGUAGES', value),
|
|
385
385
|
helperText: t('blocklet.config.selectLanguagesTip'),
|
|
386
|
-
placeholder: t('
|
|
387
|
-
filterKeys: languagesFilterKeys
|
|
386
|
+
placeholder: t('blocklet.config.languagesSearch'),
|
|
387
|
+
filterKeys: languagesFilterKeys,
|
|
388
|
+
renderLabel: (code, item) => {
|
|
389
|
+
if (item.name === item.enName) {
|
|
390
|
+
return "".concat(item.name, " (").concat(code.toUpperCase(), ")");
|
|
391
|
+
}
|
|
392
|
+
return "".concat(item.name, ", ").concat(item.enName, " (").concat(code.toUpperCase(), ")");
|
|
393
|
+
}
|
|
388
394
|
})]
|
|
389
395
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
390
396
|
className: "config-form",
|
|
@@ -22,7 +22,7 @@ var _formWrapper = _interopRequireDefault(require("./form-wrapper"));
|
|
|
22
22
|
var _inputTriggers = _interopRequireDefault(require("./input-triggers"));
|
|
23
23
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
24
|
var _templateObject;
|
|
25
|
-
const _excluded = ["label", "disabled", "required", "initialValue", "onChange", "style", "onSubmit", "triggers", "options", "formatterBeforeSubmit", "helperText", "placeholder", "renderImage", "filterKeys", "noEmpty"];
|
|
25
|
+
const _excluded = ["label", "disabled", "required", "initialValue", "onChange", "style", "onSubmit", "triggers", "options", "formatterBeforeSubmit", "helperText", "placeholder", "renderImage", "renderLabel", "filterKeys", "noEmpty"];
|
|
26
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
27
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
28
28
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -49,6 +49,7 @@ function FormAutocompleteInput(_ref) {
|
|
|
49
49
|
helperText,
|
|
50
50
|
placeholder,
|
|
51
51
|
renderImage,
|
|
52
|
+
renderLabel,
|
|
52
53
|
filterKeys,
|
|
53
54
|
noEmpty
|
|
54
55
|
} = _ref,
|
|
@@ -169,7 +170,7 @@ function FormAutocompleteInput(_ref) {
|
|
|
169
170
|
flex: 1,
|
|
170
171
|
fontWeight: selected ? '700' : 'normal'
|
|
171
172
|
},
|
|
172
|
-
children: (_optionsMap$code = optionsMap[code]) === null || _optionsMap$code === void 0 ? void 0 : _optionsMap$code.name
|
|
173
|
+
children: renderLabel(code, optionsMap[code]) || ((_optionsMap$code = optionsMap[code]) === null || _optionsMap$code === void 0 ? void 0 : _optionsMap$code.name)
|
|
173
174
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
174
175
|
component: _Close.default,
|
|
175
176
|
sx: {
|
|
@@ -257,7 +258,8 @@ FormAutocompleteInput.propTypes = {
|
|
|
257
258
|
placeholder: _propTypes.default.string,
|
|
258
259
|
renderImage: _propTypes.default.func,
|
|
259
260
|
filterKeys: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
260
|
-
noEmpty: _propTypes.default.bool
|
|
261
|
+
noEmpty: _propTypes.default.bool,
|
|
262
|
+
renderLabel: _propTypes.default.func
|
|
261
263
|
};
|
|
262
264
|
FormAutocompleteInput.defaultProps = {
|
|
263
265
|
style: {},
|
|
@@ -274,6 +276,8 @@ FormAutocompleteInput.defaultProps = {
|
|
|
274
276
|
placeholder: '',
|
|
275
277
|
filterKeys: ['name'],
|
|
276
278
|
renderImage: () => null,
|
|
279
|
+
// eslint-disable-next-line no-unused-vars
|
|
280
|
+
renderLabel: (code, item) => '',
|
|
277
281
|
noEmpty: false
|
|
278
282
|
};
|
|
279
283
|
const Row = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n height: 48px;\n border-bottom: 1px solid rgba(0, 0, 0, 0.08);\n font-size: 1.1em;\n"])));
|
package/lib/locales/en.js
CHANGED
|
@@ -426,6 +426,7 @@ var _default = exports.default = {
|
|
|
426
426
|
},
|
|
427
427
|
languages: 'Supported Languages',
|
|
428
428
|
selectLanguagesTip: 'Adjust the order by removing and re-adding',
|
|
429
|
+
languagesSearch: "Search by Country's Local Name, English Name, or ISO Code...",
|
|
429
430
|
passportColor: 'Passport Color',
|
|
430
431
|
appUrl: 'App URL',
|
|
431
432
|
access: {
|
package/lib/locales/zh.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abtnode/ux",
|
|
3
|
-
"version": "1.16.21-beta-
|
|
3
|
+
"version": "1.16.21-beta-bd0e2503",
|
|
4
4
|
"description": "UX components shared across abtnode packages",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
|
|
28
28
|
"license": "Apache-2.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@abtnode/auth": "1.16.21-beta-
|
|
31
|
-
"@abtnode/constant": "1.16.21-beta-
|
|
32
|
-
"@abtnode/util": "1.16.21-beta-
|
|
30
|
+
"@abtnode/auth": "1.16.21-beta-bd0e2503",
|
|
31
|
+
"@abtnode/constant": "1.16.21-beta-bd0e2503",
|
|
32
|
+
"@abtnode/util": "1.16.21-beta-bd0e2503",
|
|
33
33
|
"@ahooksjs/use-url-state": "^3.5.1",
|
|
34
34
|
"@arcblock/did": "^1.18.107",
|
|
35
35
|
"@arcblock/did-connect": "^2.8.23",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"@arcblock/react-hooks": "^2.8.23",
|
|
40
40
|
"@arcblock/terminal": "^2.8.23",
|
|
41
41
|
"@arcblock/ux": "^2.8.23",
|
|
42
|
-
"@blocklet/constant": "1.16.21-beta-
|
|
42
|
+
"@blocklet/constant": "1.16.21-beta-bd0e2503",
|
|
43
43
|
"@blocklet/launcher-layout": "2.2.48",
|
|
44
44
|
"@blocklet/list": "^0.12.60",
|
|
45
|
-
"@blocklet/meta": "1.16.21-beta-
|
|
45
|
+
"@blocklet/meta": "1.16.21-beta-bd0e2503",
|
|
46
46
|
"@blocklet/ui-react": "^2.8.23",
|
|
47
|
-
"@blocklet/uploader": "^0.0.
|
|
47
|
+
"@blocklet/uploader": "^0.0.56",
|
|
48
48
|
"@emotion/react": "^11.10.4",
|
|
49
49
|
"@emotion/styled": "^11.10.4",
|
|
50
50
|
"@iconify/react": "^4.0.0",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"babel-plugin-inline-react-svg": "^1.1.2",
|
|
103
103
|
"glob": "^10.3.3"
|
|
104
104
|
},
|
|
105
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "f4550e061b661cb67d7f1413ada51f3f6491f0b8",
|
|
106
106
|
"exports": {
|
|
107
107
|
".": {
|
|
108
108
|
"import": "./es/index.js",
|