@blocklet/translation-input 2.3.106 → 2.4.0
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/dist/index.es.js +34 -31
- package/dist/index.umd.js +34 -31
- package/package.json +14 -14
package/dist/index.es.js
CHANGED
|
@@ -41,8 +41,10 @@ function TranslationInput({ value, onChange, onCancel, excludes = [], ...rest })
|
|
|
41
41
|
size: "small",
|
|
42
42
|
sx: { width: 1 },
|
|
43
43
|
onChange: (e) => setInternalValue({ ...internalValue, [code]: e.target.value }),
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
slotProps: {
|
|
45
|
+
input: {
|
|
46
|
+
startAdornment: /* @__PURE__ */ jsx(InputAdornment, { position: "start", sx: { minWidth: 64 }, children: name })
|
|
47
|
+
}
|
|
46
48
|
}
|
|
47
49
|
}
|
|
48
50
|
) }) }, code);
|
|
@@ -69,33 +71,35 @@ function TranslationTextField({ translationInputProps, InputProps, ...rest }) {
|
|
|
69
71
|
TextField,
|
|
70
72
|
{
|
|
71
73
|
...rest,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
74
|
+
slotProps: {
|
|
75
|
+
input: {
|
|
76
|
+
endAdornment: /* @__PURE__ */ jsxs(InputAdornment, { position: "end", children: [
|
|
77
|
+
/* @__PURE__ */ jsx(IconButton, { edge: "end", onClick: handleClick, children: /* @__PURE__ */ jsx(Translate, { sx: { fontSize: 18 } }) }),
|
|
78
|
+
/* @__PURE__ */ jsx(
|
|
79
|
+
Popover,
|
|
80
|
+
{
|
|
81
|
+
open: !!anchorEl,
|
|
82
|
+
anchorEl,
|
|
83
|
+
transformOrigin: {
|
|
84
|
+
vertical: "top",
|
|
85
|
+
horizontal: "right"
|
|
86
|
+
},
|
|
87
|
+
anchorOrigin: {
|
|
88
|
+
vertical: "bottom",
|
|
89
|
+
horizontal: "right"
|
|
90
|
+
},
|
|
91
|
+
slotProps: {
|
|
92
|
+
paper: { sx: { width: anchorEl?.clientWidth } }
|
|
93
|
+
},
|
|
94
|
+
elevation: 1,
|
|
95
|
+
transitionDuration: 0,
|
|
96
|
+
sx: { mt: 0.5 },
|
|
97
|
+
children: /* @__PURE__ */ jsx(TranslationInput, { value: translation, onChange: handleChange, onCancel: handleClose })
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
] }),
|
|
101
|
+
...InputProps
|
|
102
|
+
}
|
|
99
103
|
}
|
|
100
104
|
}
|
|
101
105
|
);
|
|
@@ -105,7 +109,6 @@ function TranslationTag({
|
|
|
105
109
|
value,
|
|
106
110
|
displayLanguageName
|
|
107
111
|
}) {
|
|
108
|
-
var _a;
|
|
109
112
|
const { languages } = useLocaleContext();
|
|
110
113
|
return /* @__PURE__ */ jsxs(
|
|
111
114
|
Box,
|
|
@@ -123,7 +126,7 @@ function TranslationTag({
|
|
|
123
126
|
},
|
|
124
127
|
className: "label-translation-tag",
|
|
125
128
|
children: [
|
|
126
|
-
/* @__PURE__ */ jsx(Box, { sx: { pr: 0.5, borderRight: 1, borderColor: "grey.400" }, children: displayLanguageName ?
|
|
129
|
+
/* @__PURE__ */ jsx(Box, { sx: { pr: 0.5, borderRight: 1, borderColor: "grey.400" }, children: displayLanguageName ? languages.find((x) => x.code === locale)?.name || locale : locale }),
|
|
127
130
|
/* @__PURE__ */ jsx(Box, { sx: { pl: 0.5, color: "grey.700", fontWeight: "bold" }, children: value })
|
|
128
131
|
]
|
|
129
132
|
}
|
package/dist/index.umd.js
CHANGED
|
@@ -39,8 +39,10 @@
|
|
|
39
39
|
size: "small",
|
|
40
40
|
sx: { width: 1 },
|
|
41
41
|
onChange: (e) => setInternalValue({ ...internalValue, [code]: e.target.value }),
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
slotProps: {
|
|
43
|
+
input: {
|
|
44
|
+
startAdornment: /* @__PURE__ */ jsxRuntime.jsx(material.InputAdornment, { position: "start", sx: { minWidth: 64 }, children: name })
|
|
45
|
+
}
|
|
44
46
|
}
|
|
45
47
|
}
|
|
46
48
|
) }) }, code);
|
|
@@ -67,33 +69,35 @@
|
|
|
67
69
|
material.TextField,
|
|
68
70
|
{
|
|
69
71
|
...rest,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
/* @__PURE__ */ jsxRuntime.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
72
|
+
slotProps: {
|
|
73
|
+
input: {
|
|
74
|
+
endAdornment: /* @__PURE__ */ jsxRuntime.jsxs(material.InputAdornment, { position: "end", children: [
|
|
75
|
+
/* @__PURE__ */ jsxRuntime.jsx(material.IconButton, { edge: "end", onClick: handleClick, children: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.Translate, { sx: { fontSize: 18 } }) }),
|
|
76
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
77
|
+
Popover,
|
|
78
|
+
{
|
|
79
|
+
open: !!anchorEl,
|
|
80
|
+
anchorEl,
|
|
81
|
+
transformOrigin: {
|
|
82
|
+
vertical: "top",
|
|
83
|
+
horizontal: "right"
|
|
84
|
+
},
|
|
85
|
+
anchorOrigin: {
|
|
86
|
+
vertical: "bottom",
|
|
87
|
+
horizontal: "right"
|
|
88
|
+
},
|
|
89
|
+
slotProps: {
|
|
90
|
+
paper: { sx: { width: anchorEl?.clientWidth } }
|
|
91
|
+
},
|
|
92
|
+
elevation: 1,
|
|
93
|
+
transitionDuration: 0,
|
|
94
|
+
sx: { mt: 0.5 },
|
|
95
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(TranslationInput, { value: translation, onChange: handleChange, onCancel: handleClose })
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
] }),
|
|
99
|
+
...InputProps
|
|
100
|
+
}
|
|
97
101
|
}
|
|
98
102
|
}
|
|
99
103
|
);
|
|
@@ -103,7 +107,6 @@
|
|
|
103
107
|
value,
|
|
104
108
|
displayLanguageName
|
|
105
109
|
}) {
|
|
106
|
-
var _a;
|
|
107
110
|
const { languages } = context.useLocaleContext();
|
|
108
111
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
109
112
|
material.Box,
|
|
@@ -121,7 +124,7 @@
|
|
|
121
124
|
},
|
|
122
125
|
className: "label-translation-tag",
|
|
123
126
|
children: [
|
|
124
|
-
/* @__PURE__ */ jsxRuntime.jsx(material.Box, { sx: { pr: 0.5, borderRight: 1, borderColor: "grey.400" }, children: displayLanguageName ?
|
|
127
|
+
/* @__PURE__ */ jsxRuntime.jsx(material.Box, { sx: { pr: 0.5, borderRight: 1, borderColor: "grey.400" }, children: displayLanguageName ? languages.find((x) => x.code === locale)?.name || locale : locale }),
|
|
125
128
|
/* @__PURE__ */ jsxRuntime.jsx(material.Box, { sx: { pl: 0.5, color: "grey.700", fontWeight: "bold" }, children: value })
|
|
126
129
|
]
|
|
127
130
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/translation-input",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
"access": "public"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@arcblock/did-connect": "^
|
|
22
|
-
"@arcblock/ux": "^
|
|
23
|
-
"@mui/icons-material": "^
|
|
24
|
-
"@mui/material": "^
|
|
25
|
-
"react": "
|
|
26
|
-
"react-dom": "
|
|
21
|
+
"@arcblock/did-connect": "^3.0.1",
|
|
22
|
+
"@arcblock/ux": "^3.0.1",
|
|
23
|
+
"@mui/icons-material": "^7.1.2",
|
|
24
|
+
"@mui/material": "^7.1.2",
|
|
25
|
+
"react": "^19.1.0",
|
|
26
|
+
"react-dom": "^19.1.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@arcblock/eslint-config-ts": "^0.3.3",
|
|
@@ -35,23 +35,23 @@
|
|
|
35
35
|
"@storybook/addon-essentials": "^6.5.16",
|
|
36
36
|
"@storybook/addon-interactions": "^6.5.16",
|
|
37
37
|
"@storybook/addon-links": "^6.5.16",
|
|
38
|
-
"@storybook/builder-vite": "^
|
|
38
|
+
"@storybook/builder-vite": "^9.0.13",
|
|
39
39
|
"@storybook/react": "^6.5.16",
|
|
40
40
|
"@storybook/testing-library": "^0.0.13",
|
|
41
41
|
"@svgr/core": "^6.5.1",
|
|
42
42
|
"@types/react": "^18.3.9",
|
|
43
43
|
"@types/react-color": "^3.0.12",
|
|
44
44
|
"@types/react-dom": "^18.3.0",
|
|
45
|
-
"@vitejs/plugin-react": "^4.
|
|
45
|
+
"@vitejs/plugin-react": "^4.6.0",
|
|
46
46
|
"babel-loader": "^8.4.1",
|
|
47
|
-
"react": "^
|
|
48
|
-
"react-dom": "^
|
|
47
|
+
"react": "^19.1.0",
|
|
48
|
+
"react-dom": "^19.1.0",
|
|
49
49
|
"rollup-plugin-node-externals": "^7.1.3",
|
|
50
50
|
"typescript": "^4.9.5",
|
|
51
51
|
"unplugin-icons": "^0.14.15",
|
|
52
|
-
"vite": "^
|
|
53
|
-
"vite-plugin-dts": "^4.
|
|
54
|
-
"vite-plugin-libcss": "^1.1.
|
|
52
|
+
"vite": "^7.0.0",
|
|
53
|
+
"vite-plugin-dts": "^4.5.4",
|
|
54
|
+
"vite-plugin-libcss": "^1.1.2"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"build": "tsc && vite build",
|