@pisell/materials 1.0.498 → 1.0.500
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +5 -5
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +22 -22
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +21 -21
- package/es/components/dataSourceComponents/dataSourceForm/style.less +9 -0
- package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.js +13 -10
- package/es/components/dataSourceComponents/dataSourceForm/type.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceForm/utils.js +16 -11
- package/es/components/dataSourceComponents/dataSourceTable/BaseTable.js +7 -3
- package/es/components/dataSourceComponents/dataSourceTable/filter/utils.js +2 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useColumns.js +1 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +11 -2
- package/es/components/dataSourceComponents/fields/Checkbox/ReadPretty.js +3 -2
- package/es/components/dataSourceComponents/fields/DatePicker/ReadPretty.js +6 -2
- package/es/components/dataSourceComponents/fields/DatePicker/ReadPretty.less +5 -0
- package/es/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.js +6 -2
- package/es/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.less +5 -0
- package/es/components/dataSourceComponents/fields/Input/ReadPretty.js +7 -2
- package/es/components/dataSourceComponents/fields/Input/ReadPretty.less +5 -0
- package/es/components/dataSourceComponents/fields/Input.Email/ReadPretty.js +7 -2
- package/es/components/dataSourceComponents/fields/Input.Email/ReadPretty.less +5 -0
- package/es/components/dataSourceComponents/fields/Input.Password/ReadPretty.js +11 -5
- package/es/components/dataSourceComponents/fields/Input.Password/ReadPretty.less +5 -0
- package/es/components/dataSourceComponents/fields/Input.Phone/ReadPretty.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Input.Phone/ReadPretty.js +11 -4
- package/es/components/dataSourceComponents/fields/Input.Phone/ReadPretty.less +5 -0
- package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +2 -0
- package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.js +3 -7
- package/es/components/dataSourceComponents/fields/Input.TextArea/ReadPretty.js +7 -2
- package/es/components/dataSourceComponents/fields/Input.TextArea/ReadPretty.less +5 -0
- package/es/components/dataSourceComponents/fields/Input.Url/ReadPretty.js +8 -3
- package/es/components/dataSourceComponents/fields/Input.Url/ReadPretty.less +5 -0
- package/es/components/dataSourceComponents/fields/InputNumber/ReadPretty.js +9 -4
- package/es/components/dataSourceComponents/fields/InputNumber/ReadPretty.less +5 -0
- package/es/components/dataSourceComponents/fields/Radio/ReadPretty.js +3 -2
- package/es/components/dataSourceComponents/fields/Select/ReadPretty.js +3 -2
- package/es/components/dataSourceComponents/fields/TimePicker/ReadPretty.js +6 -2
- package/es/components/dataSourceComponents/fields/TimePicker/ReadPretty.less +5 -0
- package/es/components/dataSourceComponents/fields/Translation/BaseTranslation.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/Translation/BaseTranslation.js +103 -0
- package/es/components/dataSourceComponents/fields/Translation/ReadPretty.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/Translation/ReadPretty.js +13 -0
- package/es/components/dataSourceComponents/fields/Translation/ReadPretty.less +11 -0
- package/es/components/dataSourceComponents/fields/Translation/WithMode.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/Translation/WithMode.js +5 -0
- package/es/components/dataSourceComponents/fields/Translation/index.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/Translation/index.js +4 -0
- package/es/components/dataSourceComponents/fields/Translation/index.less +61 -0
- package/es/components/dataSourceComponents/fields/Translation/type.d.ts +15 -0
- package/es/components/dataSourceComponents/fields/Translation/type.js +1 -0
- package/es/components/dataSourceComponents/fields/Upload/BaseUpload.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Upload/BaseUpload.js +377 -235
- package/es/components/dataSourceComponents/fields/Upload/ReadPretty.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Upload/ReadPretty.js +35 -11
- package/es/components/dataSourceComponents/fields/Upload/constants.d.ts +9 -0
- package/es/components/dataSourceComponents/fields/Upload/constants.js +9 -0
- package/es/components/dataSourceComponents/fields/Upload/index.less +56 -0
- package/es/components/dataSourceComponents/fields/Upload/type.d.ts +12 -11
- package/es/components/dataSourceComponents/fields/Upload/types.d.ts +48 -0
- package/es/components/dataSourceComponents/fields/Upload/types.js +1 -0
- package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +13 -13
- package/es/components/dataSourceComponents/fields/Upload/utils.js +240 -215
- package/es/components/dataSourceComponents/fields/index.d.ts +4 -2
- package/es/components/dataSourceComponents/fields/index.js +4 -1
- package/es/hooks/useTranslationOriginal.d.ts +2 -0
- package/es/hooks/useTranslationOriginal.js +9 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/locales/en-US.d.ts +6 -0
- package/es/locales/en-US.js +12 -2
- package/es/locales/zh-CN.d.ts +6 -0
- package/es/locales/zh-CN.js +7 -1
- package/es/locales/zh-TW.d.ts +6 -0
- package/es/locales/zh-TW.js +7 -1
- package/lib/components/dataSourceComponents/dataSourceForm/style.less +9 -0
- package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.js +6 -3
- package/lib/components/dataSourceComponents/dataSourceForm/type.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceForm/utils.js +11 -9
- package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.js +4 -1
- package/lib/components/dataSourceComponents/dataSourceTable/filter/utils.js +2 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useColumns.js +1 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +10 -1
- package/lib/components/dataSourceComponents/fields/Checkbox/ReadPretty.js +2 -2
- package/lib/components/dataSourceComponents/fields/DatePicker/ReadPretty.js +11 -2
- package/lib/components/dataSourceComponents/fields/DatePicker/ReadPretty.less +5 -0
- package/lib/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.js +11 -2
- package/lib/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.less +5 -0
- package/lib/components/dataSourceComponents/fields/Input/ReadPretty.js +11 -1
- package/lib/components/dataSourceComponents/fields/Input/ReadPretty.less +5 -0
- package/lib/components/dataSourceComponents/fields/Input.Email/ReadPretty.js +11 -1
- package/lib/components/dataSourceComponents/fields/Input.Email/ReadPretty.less +5 -0
- package/lib/components/dataSourceComponents/fields/Input.Password/ReadPretty.js +9 -4
- package/lib/components/dataSourceComponents/fields/Input.Password/ReadPretty.less +5 -0
- package/lib/components/dataSourceComponents/fields/Input.Phone/ReadPretty.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Input.Phone/ReadPretty.js +11 -4
- package/lib/components/dataSourceComponents/fields/Input.Phone/ReadPretty.less +5 -0
- package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +2 -0
- package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.js +6 -8
- package/lib/components/dataSourceComponents/fields/Input.TextArea/ReadPretty.js +11 -1
- package/lib/components/dataSourceComponents/fields/Input.TextArea/ReadPretty.less +5 -0
- package/lib/components/dataSourceComponents/fields/Input.Url/ReadPretty.js +12 -1
- package/lib/components/dataSourceComponents/fields/Input.Url/ReadPretty.less +5 -0
- package/lib/components/dataSourceComponents/fields/InputNumber/ReadPretty.js +9 -4
- package/lib/components/dataSourceComponents/fields/InputNumber/ReadPretty.less +5 -0
- package/lib/components/dataSourceComponents/fields/Radio/ReadPretty.js +2 -2
- package/lib/components/dataSourceComponents/fields/Select/ReadPretty.js +2 -2
- package/lib/components/dataSourceComponents/fields/TimePicker/ReadPretty.js +11 -2
- package/lib/components/dataSourceComponents/fields/TimePicker/ReadPretty.less +5 -0
- package/lib/components/dataSourceComponents/fields/Translation/BaseTranslation.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/Translation/BaseTranslation.js +107 -0
- package/lib/components/dataSourceComponents/fields/Translation/ReadPretty.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/Translation/ReadPretty.js +50 -0
- package/lib/components/dataSourceComponents/fields/Translation/ReadPretty.less +11 -0
- package/lib/components/dataSourceComponents/fields/Translation/WithMode.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/Translation/WithMode.js +39 -0
- package/lib/components/dataSourceComponents/fields/Translation/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/Translation/index.js +38 -0
- package/lib/components/dataSourceComponents/fields/Translation/index.less +61 -0
- package/lib/components/dataSourceComponents/fields/Translation/type.d.ts +15 -0
- package/lib/components/dataSourceComponents/fields/Translation/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/Upload/BaseUpload.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Upload/BaseUpload.js +384 -247
- package/lib/components/dataSourceComponents/fields/Upload/ReadPretty.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Upload/ReadPretty.js +24 -4
- package/lib/components/dataSourceComponents/fields/Upload/constants.d.ts +9 -0
- package/lib/components/dataSourceComponents/fields/Upload/constants.js +47 -0
- package/lib/components/dataSourceComponents/fields/Upload/index.less +56 -0
- package/lib/components/dataSourceComponents/fields/Upload/type.d.ts +12 -11
- package/lib/components/dataSourceComponents/fields/Upload/types.d.ts +48 -0
- package/lib/components/dataSourceComponents/fields/Upload/types.js +17 -0
- package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +13 -13
- package/lib/components/dataSourceComponents/fields/Upload/utils.js +207 -254
- package/lib/components/dataSourceComponents/fields/index.d.ts +4 -2
- package/lib/components/dataSourceComponents/fields/index.js +4 -1
- package/lib/hooks/useTranslationOriginal.d.ts +2 -0
- package/lib/hooks/useTranslationOriginal.js +41 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lib/locales/en-US.d.ts +6 -0
- package/lib/locales/en-US.js +8 -1
- package/lib/locales/zh-CN.d.ts +6 -0
- package/lib/locales/zh-CN.js +7 -1
- package/lib/locales/zh-TW.d.ts +6 -0
- package/lib/locales/zh-TW.js +7 -1
- package/lowcode/data-source-form/constants.ts +1 -0
- package/lowcode/data-source-form/utils.ts +16 -4
- package/lowcode/data-source-table/utils.tsx +2 -2
- package/lowcode/form-item-translation/meta.ts +249 -0
- package/lowcode/form-item-translation/snippets.ts +13 -0
- package/lowcode/form-item-upload/meta.ts +11 -0
- package/lowcode/submit-button/meta.ts +10 -0
- package/package.json +1 -1
|
@@ -33,6 +33,7 @@ __export(ReadPretty_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(ReadPretty_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_classnames = __toESM(require("classnames"));
|
|
36
37
|
var import_utils = require("./utils");
|
|
37
38
|
var import_ReadPretty = require("./ReadPretty.less");
|
|
38
39
|
var ReadPretty = (props) => {
|
|
@@ -41,10 +42,14 @@ var ReadPretty = (props) => {
|
|
|
41
42
|
useThousandsSeparator,
|
|
42
43
|
previewFormatter,
|
|
43
44
|
precision = 0,
|
|
44
|
-
addonAfter
|
|
45
|
+
addonAfter,
|
|
46
|
+
renderMode
|
|
45
47
|
} = props;
|
|
48
|
+
const className = (0, import_classnames.default)("pisell-input-number-read-pretty", {
|
|
49
|
+
"pisell-input-number-read-pretty-table-view": renderMode === "tableView"
|
|
50
|
+
});
|
|
46
51
|
if (!value && value !== 0) {
|
|
47
|
-
return /* @__PURE__ */ import_react.default.createElement("span", { className
|
|
52
|
+
return /* @__PURE__ */ import_react.default.createElement("span", { className }, "-");
|
|
48
53
|
}
|
|
49
54
|
const formattedValue = (0, import_utils.formatNumberWithUnit)(
|
|
50
55
|
Number(value),
|
|
@@ -54,8 +59,8 @@ var ReadPretty = (props) => {
|
|
|
54
59
|
if (useThousandsSeparator && (!previewFormatter || previewFormatter === "none")) {
|
|
55
60
|
const parts = formattedValue.split(".");
|
|
56
61
|
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
57
|
-
return /* @__PURE__ */ import_react.default.createElement("span", { className
|
|
62
|
+
return /* @__PURE__ */ import_react.default.createElement("span", { className }, parts.join("."), addonAfter);
|
|
58
63
|
}
|
|
59
|
-
return /* @__PURE__ */ import_react.default.createElement("span", { className
|
|
64
|
+
return /* @__PURE__ */ import_react.default.createElement("span", { className }, formattedValue, addonAfter);
|
|
60
65
|
};
|
|
61
66
|
var ReadPretty_default = ReadPretty;
|
|
@@ -39,9 +39,9 @@ var RadioReadPretty = (props) => {
|
|
|
39
39
|
return (0, import_utils.renderValueWithMap)(value);
|
|
40
40
|
};
|
|
41
41
|
var RadioGroupReadPretty = (props) => {
|
|
42
|
-
const { value, options } = props;
|
|
42
|
+
const { value, options, renderMode } = props;
|
|
43
43
|
const valueMap = (0, import_useValueMap.default)(options || []);
|
|
44
|
-
return (0, import_utils.renderValueWithMap)(value, valueMap);
|
|
44
|
+
return (0, import_utils.renderValueWithMap)(value, valueMap, renderMode);
|
|
45
45
|
};
|
|
46
46
|
RadioReadPretty.Group = RadioGroupReadPretty;
|
|
47
47
|
var ReadPretty_default = RadioReadPretty;
|
|
@@ -35,8 +35,8 @@ module.exports = __toCommonJS(ReadPretty_exports);
|
|
|
35
35
|
var import_utils = require("../../dataSourceForm/utils");
|
|
36
36
|
var import_useValueMap = __toESM(require("../../hooks/useValueMap"));
|
|
37
37
|
var SelectReadPretty = (props) => {
|
|
38
|
-
const { value, options } = props;
|
|
38
|
+
const { value, options, renderMode } = props;
|
|
39
39
|
const valueMap = (0, import_useValueMap.default)(options || []);
|
|
40
|
-
return (0, import_utils.renderValueWithMap)(value, valueMap);
|
|
40
|
+
return (0, import_utils.renderValueWithMap)(value, valueMap, renderMode);
|
|
41
41
|
};
|
|
42
42
|
var ReadPretty_default = SelectReadPretty;
|
|
@@ -33,9 +33,18 @@ __export(ReadPretty_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(ReadPretty_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_classnames = __toESM(require("classnames"));
|
|
36
37
|
var import_ReadPretty = require("./ReadPretty.less");
|
|
37
38
|
var TimePickerReadPretty = (props) => {
|
|
38
|
-
const { value } = props;
|
|
39
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
39
|
+
const { value, renderMode } = props;
|
|
40
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
41
|
+
"span",
|
|
42
|
+
{
|
|
43
|
+
className: (0, import_classnames.default)("pisell-time-picker-read-pretty", {
|
|
44
|
+
"pisell-time-picker-read-pretty-table-view": renderMode === "tableView"
|
|
45
|
+
})
|
|
46
|
+
},
|
|
47
|
+
value
|
|
48
|
+
);
|
|
40
49
|
};
|
|
41
50
|
var ReadPretty_default = TimePickerReadPretty;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/dataSourceComponents/fields/Translation/BaseTranslation.tsx
|
|
30
|
+
var BaseTranslation_exports = {};
|
|
31
|
+
__export(BaseTranslation_exports, {
|
|
32
|
+
default: () => BaseTranslation_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(BaseTranslation_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_icons = require("@ant-design/icons");
|
|
38
|
+
var import_locales = require("../../../../locales");
|
|
39
|
+
var import_index = require("./index.less");
|
|
40
|
+
var defaultValue = {
|
|
41
|
+
en: "",
|
|
42
|
+
"zh-CN": "",
|
|
43
|
+
"zh-HK": "",
|
|
44
|
+
original: ""
|
|
45
|
+
};
|
|
46
|
+
var languageConfig = [
|
|
47
|
+
{ key: "original", label: (0, import_locales.getText)("pisell-translation-original") },
|
|
48
|
+
{ key: "en", label: "English" },
|
|
49
|
+
{ key: "zh-CN", label: "简体中文" },
|
|
50
|
+
{ key: "zh-HK", label: "繁體中文" }
|
|
51
|
+
];
|
|
52
|
+
var Translation = ({
|
|
53
|
+
value = defaultValue,
|
|
54
|
+
onChange,
|
|
55
|
+
placeholder,
|
|
56
|
+
disabled
|
|
57
|
+
}) => {
|
|
58
|
+
const [open, setOpen] = (0, import_react.useState)(false);
|
|
59
|
+
const hasAnyTranslation = (0, import_react.useCallback)(() => {
|
|
60
|
+
return Object.entries(value).some(([key, val]) => val);
|
|
61
|
+
}, [value]);
|
|
62
|
+
const handleInputChange = (0, import_react.useCallback)(
|
|
63
|
+
(lang) => (e) => {
|
|
64
|
+
const newValue = {
|
|
65
|
+
...value,
|
|
66
|
+
[lang]: e.target.value
|
|
67
|
+
};
|
|
68
|
+
onChange == null ? void 0 : onChange(newValue);
|
|
69
|
+
},
|
|
70
|
+
[value, onChange]
|
|
71
|
+
);
|
|
72
|
+
const content = /* @__PURE__ */ import_react.default.createElement("div", { className: "translation-popover" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { direction: "vertical", style: { width: "100%" }, size: 16 }, languageConfig.map(({ key, label }) => /* @__PURE__ */ import_react.default.createElement("div", { key, className: "translation-field" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "translation-label" }, label), /* @__PURE__ */ import_react.default.createElement(
|
|
73
|
+
import_antd.Input,
|
|
74
|
+
{
|
|
75
|
+
value: value[key],
|
|
76
|
+
onChange: handleInputChange(key),
|
|
77
|
+
allowClear: true
|
|
78
|
+
}
|
|
79
|
+
)))));
|
|
80
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "translation-wrapper" }, /* @__PURE__ */ import_react.default.createElement(
|
|
81
|
+
import_antd.Input,
|
|
82
|
+
{
|
|
83
|
+
value: value.original,
|
|
84
|
+
onChange: handleInputChange("original"),
|
|
85
|
+
placeholder,
|
|
86
|
+
disabled,
|
|
87
|
+
className: "translation-input"
|
|
88
|
+
}
|
|
89
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
90
|
+
import_antd.Popover,
|
|
91
|
+
{
|
|
92
|
+
content,
|
|
93
|
+
trigger: "click",
|
|
94
|
+
open,
|
|
95
|
+
onOpenChange: setOpen,
|
|
96
|
+
placement: "bottomRight"
|
|
97
|
+
},
|
|
98
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
99
|
+
"div",
|
|
100
|
+
{
|
|
101
|
+
className: `translation-icon-wrapper ${hasAnyTranslation() ? "has-translation" : ""} ${disabled ? "disabled" : ""}`
|
|
102
|
+
},
|
|
103
|
+
/* @__PURE__ */ import_react.default.createElement(import_icons.GlobalOutlined, { className: "translation-icon" })
|
|
104
|
+
)
|
|
105
|
+
));
|
|
106
|
+
};
|
|
107
|
+
var BaseTranslation_default = Translation;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/dataSourceComponents/fields/Translation/ReadPretty.tsx
|
|
30
|
+
var ReadPretty_exports = {};
|
|
31
|
+
__export(ReadPretty_exports, {
|
|
32
|
+
default: () => ReadPretty_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(ReadPretty_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_classnames = __toESM(require("classnames"));
|
|
37
|
+
var import_ReadPretty = require("./ReadPretty.less");
|
|
38
|
+
var TranslationReadPretty = (props) => {
|
|
39
|
+
const { value, renderMode } = props;
|
|
40
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
41
|
+
"span",
|
|
42
|
+
{
|
|
43
|
+
className: (0, import_classnames.default)("pisell-translation-read-pretty", {
|
|
44
|
+
"pisell-translation-read-pretty-table-view": renderMode === "tableView"
|
|
45
|
+
})
|
|
46
|
+
},
|
|
47
|
+
(value == null ? void 0 : value.original) || ""
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
var ReadPretty_default = TranslationReadPretty;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/dataSourceComponents/fields/Translation/WithMode.ts
|
|
30
|
+
var WithMode_exports = {};
|
|
31
|
+
__export(WithMode_exports, {
|
|
32
|
+
default: () => WithMode_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(WithMode_exports);
|
|
35
|
+
var import_ReadPretty = __toESM(require("./ReadPretty"));
|
|
36
|
+
var import_utils = require("../../dataSourceForm/utils");
|
|
37
|
+
var import_BaseTranslation = __toESM(require("./BaseTranslation"));
|
|
38
|
+
var TranslationWithMode = (0, import_utils.withMode)(import_BaseTranslation.default, import_ReadPretty.default);
|
|
39
|
+
var WithMode_default = TranslationWithMode;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/dataSourceComponents/fields/Translation/index.tsx
|
|
30
|
+
var Translation_exports = {};
|
|
31
|
+
__export(Translation_exports, {
|
|
32
|
+
default: () => Translation_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Translation_exports);
|
|
35
|
+
var import_utils = require("../../dataSourceForm/utils");
|
|
36
|
+
var import_BaseTranslation = __toESM(require("./BaseTranslation"));
|
|
37
|
+
var Translation = (0, import_utils.withFormItem)(import_BaseTranslation.default);
|
|
38
|
+
var Translation_default = Translation;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
.translation-wrapper {
|
|
2
|
+
position: relative;
|
|
3
|
+
|
|
4
|
+
.translation-input {
|
|
5
|
+
padding-right: 40px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.translation-icon-wrapper {
|
|
9
|
+
position: absolute;
|
|
10
|
+
right: 0;
|
|
11
|
+
top: 0;
|
|
12
|
+
height: 100%;
|
|
13
|
+
padding: 0 13px;
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
border-radius: 0 6px 6px 0;
|
|
17
|
+
transition: all 0.3s;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
.translation-icon {
|
|
20
|
+
color: #d9d9d9;
|
|
21
|
+
transition: all 0.3s;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&:hover {
|
|
25
|
+
.translation-icon {
|
|
26
|
+
color: var(--theme-color);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
&.has-translation {
|
|
32
|
+
background-color: var(--theme-color);
|
|
33
|
+
transition: all 0.3s;
|
|
34
|
+
|
|
35
|
+
.translation-icon {
|
|
36
|
+
transition: all 0.3s;
|
|
37
|
+
|
|
38
|
+
color: #fff;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&.disabled {
|
|
43
|
+
cursor: not-allowed;
|
|
44
|
+
|
|
45
|
+
.translation-icon {
|
|
46
|
+
color: var(--ant-color-text-disabled);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.translation-popover {
|
|
53
|
+
min-width: 300px;
|
|
54
|
+
padding: 8px;
|
|
55
|
+
|
|
56
|
+
.translation-field {
|
|
57
|
+
.translation-label {
|
|
58
|
+
margin-bottom: 8px;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ModeType } from "../../dataSourceForm/type";
|
|
2
|
+
export interface TranslationValue {
|
|
3
|
+
en: string;
|
|
4
|
+
'zh-CN': string;
|
|
5
|
+
'zh-HK': string;
|
|
6
|
+
original: string;
|
|
7
|
+
}
|
|
8
|
+
export interface TranslationProps {
|
|
9
|
+
renderMode: ModeType;
|
|
10
|
+
value?: TranslationValue;
|
|
11
|
+
onChange?: (value: TranslationValue) => void;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
|
|
15
|
+
// src/components/dataSourceComponents/fields/Translation/type.ts
|
|
16
|
+
var type_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(type_exports);
|