@pisell/materials 1.0.882 → 1.0.883

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.
@@ -69,7 +69,7 @@ var Translation = function Translation(props) {
69
69
  var _ref = (store === null || store === void 0 || (_store$getState = store.getState()) === null || _store$getState === void 0 ? void 0 : _store$getState.global) || defaultGlobal,
70
70
  shopLanguages = _ref.shopLanguages;
71
71
  var getInputComponent = useCallback(function () {
72
- console.log(type, props, '翻译组件type值');
72
+ console.log(type, props, '翻译组件type值11');
73
73
  switch (type) {
74
74
  case 'textarea':
75
75
  return Input.TextArea;
@@ -128,19 +128,38 @@ var Translation = function Translation(props) {
128
128
  onChange === null || onChange === void 0 || onChange(_value);
129
129
  setOpen(false);
130
130
  };
131
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InputComponent, _extends({}, others, {
132
- value: inputValue,
133
- onChange: function onChange(e) {
134
- return allChange(e.target.value);
135
- },
136
- suffix: /*#__PURE__*/React.createElement(GlobalOutlined, {
131
+
132
+ /**
133
+ * @title: 多语言图标
134
+ * @description:
135
+ * @param {*} useMemo
136
+ * @return {*}
137
+ * @Author: WangHan
138
+ * @Date: 2025-08-13 14:39
139
+ */
140
+ var suffixIcon = useMemo(function () {
141
+ return /*#__PURE__*/React.createElement(GlobalOutlined, {
137
142
  className: classNames('pisell-lowcode-translation-icon', {
138
143
  active: isActive
139
144
  }),
140
145
  onClick: function onClick() {
141
146
  return setOpen(true);
142
147
  }
143
- })
148
+ });
149
+ }, [isActive]);
150
+ return /*#__PURE__*/React.createElement(React.Fragment, null, type === 'textarea' ? /*#__PURE__*/React.createElement("div", {
151
+ className: "pisell-lowcode-translation-textarea-wrapper"
152
+ }, /*#__PURE__*/React.createElement(InputComponent, _extends({}, others, {
153
+ value: inputValue,
154
+ onChange: function onChange(e) {
155
+ return allChange(e.target.value);
156
+ }
157
+ })), suffixIcon) : /*#__PURE__*/React.createElement(InputComponent, _extends({}, others, {
158
+ value: inputValue,
159
+ onChange: function onChange(e) {
160
+ return allChange(e.target.value);
161
+ },
162
+ suffix: suffixIcon
144
163
  })), /*#__PURE__*/React.createElement(Modal, {
145
164
  open: open,
146
165
  onOk: _onOk,
@@ -13,3 +13,13 @@
13
13
  position: relative;
14
14
  width: 100%;
15
15
  }
16
+
17
+ .pisell-lowcode-translation-textarea-wrapper {
18
+ position: relative;
19
+
20
+ .pisell-lowcode-translation-icon {
21
+ position: absolute;
22
+ right: 11px;
23
+ bottom: 11px;
24
+ }
25
+ }
@@ -84,7 +84,7 @@ var Translation = (props) => {
84
84
  const store = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.store;
85
85
  const { shopLanguages } = ((_b = store == null ? void 0 : store.getState()) == null ? void 0 : _b.global) || defaultGlobal;
86
86
  const getInputComponent = (0, import_react.useCallback)(() => {
87
- console.log(type, props, "翻译组件type值");
87
+ console.log(type, props, "翻译组件type值11");
88
88
  switch (type) {
89
89
  case "textarea":
90
90
  return import_antd.Input.TextArea;
@@ -146,21 +146,31 @@ var Translation = (props) => {
146
146
  onChange == null ? void 0 : onChange(_value);
147
147
  setOpen(false);
148
148
  };
149
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
149
+ const suffixIcon = (0, import_react.useMemo)(() => {
150
+ return /* @__PURE__ */ import_react.default.createElement(
151
+ import_icons.GlobalOutlined,
152
+ {
153
+ className: (0, import_classnames.default)("pisell-lowcode-translation-icon", {
154
+ active: isActive
155
+ }),
156
+ onClick: () => setOpen(true)
157
+ }
158
+ );
159
+ }, [isActive]);
160
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, type === "textarea" ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-translation-textarea-wrapper" }, /* @__PURE__ */ import_react.default.createElement(
161
+ InputComponent,
162
+ {
163
+ ...others,
164
+ value: inputValue,
165
+ onChange: (e) => allChange(e.target.value)
166
+ }
167
+ ), suffixIcon) : /* @__PURE__ */ import_react.default.createElement(
150
168
  InputComponent,
151
169
  {
152
170
  ...others,
153
171
  value: inputValue,
154
172
  onChange: (e) => allChange(e.target.value),
155
- suffix: /* @__PURE__ */ import_react.default.createElement(
156
- import_icons.GlobalOutlined,
157
- {
158
- className: (0, import_classnames.default)("pisell-lowcode-translation-icon", {
159
- active: isActive
160
- }),
161
- onClick: () => setOpen(true)
162
- }
163
- )
173
+ suffix: suffixIcon
164
174
  }
165
175
  ), /* @__PURE__ */ import_react.default.createElement(
166
176
  import_antd.Modal,
@@ -13,3 +13,13 @@
13
13
  position: relative;
14
14
  width: 100%;
15
15
  }
16
+
17
+ .pisell-lowcode-translation-textarea-wrapper {
18
+ position: relative;
19
+
20
+ .pisell-lowcode-translation-icon {
21
+ position: absolute;
22
+ right: 11px;
23
+ bottom: 11px;
24
+ }
25
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "1.0.882",
3
+ "version": "1.0.883",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -74,8 +74,8 @@
74
74
  "swiper": "^8.4.7",
75
75
  "vod-js-sdk-v6": "^1.4.11",
76
76
  "@pisell/date-picker": "1.0.122",
77
- "@pisell/utils": "1.0.50",
78
- "@pisell/icon": "0.0.10"
77
+ "@pisell/icon": "0.0.10",
78
+ "@pisell/utils": "1.0.50"
79
79
  },
80
80
  "peerDependencies": {
81
81
  "react": "^18.0.0",