@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.
Files changed (164) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +5 -5
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +22 -22
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +21 -21
  11. package/es/components/dataSourceComponents/dataSourceForm/style.less +9 -0
  12. package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.d.ts +1 -0
  13. package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.js +13 -10
  14. package/es/components/dataSourceComponents/dataSourceForm/type.d.ts +1 -1
  15. package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
  16. package/es/components/dataSourceComponents/dataSourceForm/utils.js +16 -11
  17. package/es/components/dataSourceComponents/dataSourceTable/BaseTable.js +7 -3
  18. package/es/components/dataSourceComponents/dataSourceTable/filter/utils.js +2 -1
  19. package/es/components/dataSourceComponents/dataSourceTable/hooks/useColumns.js +1 -1
  20. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +1 -0
  21. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +11 -2
  22. package/es/components/dataSourceComponents/fields/Checkbox/ReadPretty.js +3 -2
  23. package/es/components/dataSourceComponents/fields/DatePicker/ReadPretty.js +6 -2
  24. package/es/components/dataSourceComponents/fields/DatePicker/ReadPretty.less +5 -0
  25. package/es/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.js +6 -2
  26. package/es/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.less +5 -0
  27. package/es/components/dataSourceComponents/fields/Input/ReadPretty.js +7 -2
  28. package/es/components/dataSourceComponents/fields/Input/ReadPretty.less +5 -0
  29. package/es/components/dataSourceComponents/fields/Input.Email/ReadPretty.js +7 -2
  30. package/es/components/dataSourceComponents/fields/Input.Email/ReadPretty.less +5 -0
  31. package/es/components/dataSourceComponents/fields/Input.Password/ReadPretty.js +11 -5
  32. package/es/components/dataSourceComponents/fields/Input.Password/ReadPretty.less +5 -0
  33. package/es/components/dataSourceComponents/fields/Input.Phone/ReadPretty.d.ts +1 -1
  34. package/es/components/dataSourceComponents/fields/Input.Phone/ReadPretty.js +11 -4
  35. package/es/components/dataSourceComponents/fields/Input.Phone/ReadPretty.less +5 -0
  36. package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +2 -0
  37. package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.js +3 -7
  38. package/es/components/dataSourceComponents/fields/Input.TextArea/ReadPretty.js +7 -2
  39. package/es/components/dataSourceComponents/fields/Input.TextArea/ReadPretty.less +5 -0
  40. package/es/components/dataSourceComponents/fields/Input.Url/ReadPretty.js +8 -3
  41. package/es/components/dataSourceComponents/fields/Input.Url/ReadPretty.less +5 -0
  42. package/es/components/dataSourceComponents/fields/InputNumber/ReadPretty.js +9 -4
  43. package/es/components/dataSourceComponents/fields/InputNumber/ReadPretty.less +5 -0
  44. package/es/components/dataSourceComponents/fields/Radio/ReadPretty.js +3 -2
  45. package/es/components/dataSourceComponents/fields/Select/ReadPretty.js +3 -2
  46. package/es/components/dataSourceComponents/fields/TimePicker/ReadPretty.js +6 -2
  47. package/es/components/dataSourceComponents/fields/TimePicker/ReadPretty.less +5 -0
  48. package/es/components/dataSourceComponents/fields/Translation/BaseTranslation.d.ts +5 -0
  49. package/es/components/dataSourceComponents/fields/Translation/BaseTranslation.js +103 -0
  50. package/es/components/dataSourceComponents/fields/Translation/ReadPretty.d.ts +5 -0
  51. package/es/components/dataSourceComponents/fields/Translation/ReadPretty.js +13 -0
  52. package/es/components/dataSourceComponents/fields/Translation/ReadPretty.less +11 -0
  53. package/es/components/dataSourceComponents/fields/Translation/WithMode.d.ts +4 -0
  54. package/es/components/dataSourceComponents/fields/Translation/WithMode.js +5 -0
  55. package/es/components/dataSourceComponents/fields/Translation/index.d.ts +3 -0
  56. package/es/components/dataSourceComponents/fields/Translation/index.js +4 -0
  57. package/es/components/dataSourceComponents/fields/Translation/index.less +61 -0
  58. package/es/components/dataSourceComponents/fields/Translation/type.d.ts +15 -0
  59. package/es/components/dataSourceComponents/fields/Translation/type.js +1 -0
  60. package/es/components/dataSourceComponents/fields/Upload/BaseUpload.d.ts +1 -1
  61. package/es/components/dataSourceComponents/fields/Upload/BaseUpload.js +377 -235
  62. package/es/components/dataSourceComponents/fields/Upload/ReadPretty.d.ts +1 -1
  63. package/es/components/dataSourceComponents/fields/Upload/ReadPretty.js +35 -11
  64. package/es/components/dataSourceComponents/fields/Upload/constants.d.ts +9 -0
  65. package/es/components/dataSourceComponents/fields/Upload/constants.js +9 -0
  66. package/es/components/dataSourceComponents/fields/Upload/index.less +56 -0
  67. package/es/components/dataSourceComponents/fields/Upload/type.d.ts +12 -11
  68. package/es/components/dataSourceComponents/fields/Upload/types.d.ts +48 -0
  69. package/es/components/dataSourceComponents/fields/Upload/types.js +1 -0
  70. package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +13 -13
  71. package/es/components/dataSourceComponents/fields/Upload/utils.js +240 -215
  72. package/es/components/dataSourceComponents/fields/index.d.ts +4 -2
  73. package/es/components/dataSourceComponents/fields/index.js +4 -1
  74. package/es/hooks/useTranslationOriginal.d.ts +2 -0
  75. package/es/hooks/useTranslationOriginal.js +9 -0
  76. package/es/index.d.ts +1 -0
  77. package/es/index.js +1 -0
  78. package/es/locales/en-US.d.ts +6 -0
  79. package/es/locales/en-US.js +12 -2
  80. package/es/locales/zh-CN.d.ts +6 -0
  81. package/es/locales/zh-CN.js +7 -1
  82. package/es/locales/zh-TW.d.ts +6 -0
  83. package/es/locales/zh-TW.js +7 -1
  84. package/lib/components/dataSourceComponents/dataSourceForm/style.less +9 -0
  85. package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.d.ts +1 -0
  86. package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.js +6 -3
  87. package/lib/components/dataSourceComponents/dataSourceForm/type.d.ts +1 -1
  88. package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
  89. package/lib/components/dataSourceComponents/dataSourceForm/utils.js +11 -9
  90. package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.js +4 -1
  91. package/lib/components/dataSourceComponents/dataSourceTable/filter/utils.js +2 -1
  92. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useColumns.js +1 -1
  93. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +1 -0
  94. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +10 -1
  95. package/lib/components/dataSourceComponents/fields/Checkbox/ReadPretty.js +2 -2
  96. package/lib/components/dataSourceComponents/fields/DatePicker/ReadPretty.js +11 -2
  97. package/lib/components/dataSourceComponents/fields/DatePicker/ReadPretty.less +5 -0
  98. package/lib/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.js +11 -2
  99. package/lib/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.less +5 -0
  100. package/lib/components/dataSourceComponents/fields/Input/ReadPretty.js +11 -1
  101. package/lib/components/dataSourceComponents/fields/Input/ReadPretty.less +5 -0
  102. package/lib/components/dataSourceComponents/fields/Input.Email/ReadPretty.js +11 -1
  103. package/lib/components/dataSourceComponents/fields/Input.Email/ReadPretty.less +5 -0
  104. package/lib/components/dataSourceComponents/fields/Input.Password/ReadPretty.js +9 -4
  105. package/lib/components/dataSourceComponents/fields/Input.Password/ReadPretty.less +5 -0
  106. package/lib/components/dataSourceComponents/fields/Input.Phone/ReadPretty.d.ts +1 -1
  107. package/lib/components/dataSourceComponents/fields/Input.Phone/ReadPretty.js +11 -4
  108. package/lib/components/dataSourceComponents/fields/Input.Phone/ReadPretty.less +5 -0
  109. package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +2 -0
  110. package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.js +6 -8
  111. package/lib/components/dataSourceComponents/fields/Input.TextArea/ReadPretty.js +11 -1
  112. package/lib/components/dataSourceComponents/fields/Input.TextArea/ReadPretty.less +5 -0
  113. package/lib/components/dataSourceComponents/fields/Input.Url/ReadPretty.js +12 -1
  114. package/lib/components/dataSourceComponents/fields/Input.Url/ReadPretty.less +5 -0
  115. package/lib/components/dataSourceComponents/fields/InputNumber/ReadPretty.js +9 -4
  116. package/lib/components/dataSourceComponents/fields/InputNumber/ReadPretty.less +5 -0
  117. package/lib/components/dataSourceComponents/fields/Radio/ReadPretty.js +2 -2
  118. package/lib/components/dataSourceComponents/fields/Select/ReadPretty.js +2 -2
  119. package/lib/components/dataSourceComponents/fields/TimePicker/ReadPretty.js +11 -2
  120. package/lib/components/dataSourceComponents/fields/TimePicker/ReadPretty.less +5 -0
  121. package/lib/components/dataSourceComponents/fields/Translation/BaseTranslation.d.ts +5 -0
  122. package/lib/components/dataSourceComponents/fields/Translation/BaseTranslation.js +107 -0
  123. package/lib/components/dataSourceComponents/fields/Translation/ReadPretty.d.ts +5 -0
  124. package/lib/components/dataSourceComponents/fields/Translation/ReadPretty.js +50 -0
  125. package/lib/components/dataSourceComponents/fields/Translation/ReadPretty.less +11 -0
  126. package/lib/components/dataSourceComponents/fields/Translation/WithMode.d.ts +4 -0
  127. package/lib/components/dataSourceComponents/fields/Translation/WithMode.js +39 -0
  128. package/lib/components/dataSourceComponents/fields/Translation/index.d.ts +3 -0
  129. package/lib/components/dataSourceComponents/fields/Translation/index.js +38 -0
  130. package/lib/components/dataSourceComponents/fields/Translation/index.less +61 -0
  131. package/lib/components/dataSourceComponents/fields/Translation/type.d.ts +15 -0
  132. package/lib/components/dataSourceComponents/fields/Translation/type.js +17 -0
  133. package/lib/components/dataSourceComponents/fields/Upload/BaseUpload.d.ts +1 -1
  134. package/lib/components/dataSourceComponents/fields/Upload/BaseUpload.js +384 -247
  135. package/lib/components/dataSourceComponents/fields/Upload/ReadPretty.d.ts +1 -1
  136. package/lib/components/dataSourceComponents/fields/Upload/ReadPretty.js +24 -4
  137. package/lib/components/dataSourceComponents/fields/Upload/constants.d.ts +9 -0
  138. package/lib/components/dataSourceComponents/fields/Upload/constants.js +47 -0
  139. package/lib/components/dataSourceComponents/fields/Upload/index.less +56 -0
  140. package/lib/components/dataSourceComponents/fields/Upload/type.d.ts +12 -11
  141. package/lib/components/dataSourceComponents/fields/Upload/types.d.ts +48 -0
  142. package/lib/components/dataSourceComponents/fields/Upload/types.js +17 -0
  143. package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +13 -13
  144. package/lib/components/dataSourceComponents/fields/Upload/utils.js +207 -254
  145. package/lib/components/dataSourceComponents/fields/index.d.ts +4 -2
  146. package/lib/components/dataSourceComponents/fields/index.js +4 -1
  147. package/lib/hooks/useTranslationOriginal.d.ts +2 -0
  148. package/lib/hooks/useTranslationOriginal.js +41 -0
  149. package/lib/index.d.ts +1 -0
  150. package/lib/index.js +3 -0
  151. package/lib/locales/en-US.d.ts +6 -0
  152. package/lib/locales/en-US.js +8 -1
  153. package/lib/locales/zh-CN.d.ts +6 -0
  154. package/lib/locales/zh-CN.js +7 -1
  155. package/lib/locales/zh-TW.d.ts +6 -0
  156. package/lib/locales/zh-TW.js +7 -1
  157. package/lowcode/data-source-form/constants.ts +1 -0
  158. package/lowcode/data-source-form/utils.ts +16 -4
  159. package/lowcode/data-source-table/utils.tsx +2 -2
  160. package/lowcode/form-item-translation/meta.ts +249 -0
  161. package/lowcode/form-item-translation/snippets.ts +13 -0
  162. package/lowcode/form-item-upload/meta.ts +11 -0
  163. package/lowcode/submit-button/meta.ts +10 -0
  164. 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: "pisell-input-number-read-pretty" }, "-");
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: "pisell-input-number-read-pretty" }, parts.join("."), addonAfter);
62
+ return /* @__PURE__ */ import_react.default.createElement("span", { className }, parts.join("."), addonAfter);
58
63
  }
59
- return /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-input-number-read-pretty" }, formattedValue, addonAfter);
64
+ return /* @__PURE__ */ import_react.default.createElement("span", { className }, formattedValue, addonAfter);
60
65
  };
61
66
  var ReadPretty_default = ReadPretty;
@@ -4,3 +4,8 @@
4
4
  font-weight: 600;
5
5
  line-height: 24px; /* 150% */
6
6
  }
7
+
8
+ .pisell-input-number-read-pretty-table-view {
9
+ font-size: 14px;
10
+ font-weight: 400;
11
+ }
@@ -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("span", { className: "pisell-time-picker-read-pretty" }, value);
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;
@@ -4,3 +4,8 @@
4
4
  font-weight: 600;
5
5
  line-height: 24px; /* 150% */
6
6
  }
7
+
8
+ .pisell-time-picker-read-pretty-table-view {
9
+ font-size: 14px;
10
+ font-weight: 400;
11
+ }
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { TranslationProps } from './type';
3
+ import './index.less';
4
+ declare const Translation: React.FC<TranslationProps>;
5
+ export default Translation;
@@ -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,5 @@
1
+ import React from 'react';
2
+ import { TranslationProps } from './type';
3
+ import './ReadPretty.less';
4
+ declare const TranslationReadPretty: (props: TranslationProps) => React.JSX.Element;
5
+ export default TranslationReadPretty;
@@ -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,11 @@
1
+ .pisell-translation-read-pretty {
2
+ color: var(--Gray-900, #101828);
3
+ font-size: 16px;
4
+ font-weight: 600;
5
+ line-height: 24px; /* 150% */
6
+ }
7
+
8
+ .pisell-translation-read-pretty-table-view {
9
+ font-size: 14px;
10
+ font-weight: 400;
11
+ }
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { TranslationProps } from './type';
3
+ declare const TranslationWithMode: import("react").FC<TranslationProps & import("../../dataSourceForm/utils").WithModeProps>;
4
+ export default TranslationWithMode;
@@ -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,3 @@
1
+ import React from 'react';
2
+ declare const Translation: React.FC<import("./type").TranslationProps & import("../../dataSourceForm/utils").WithFormItemProps>;
3
+ export default Translation;
@@ -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);
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { UploadProps } from './type';
3
3
  import './index.less';
4
- declare const BaseUpload: (props: UploadProps) => React.JSX.Element;
4
+ declare const BaseUpload: React.FC<UploadProps>;
5
5
  export default BaseUpload;