@pisell/materials 6.3.9 → 6.3.10

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 (66) 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 +15 -15
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +16 -16
  11. package/es/components/dataSourceComponents/fields/index.d.ts +2 -2
  12. package/es/components/pisellQRScanner/index.d.ts +0 -13
  13. package/es/components/pisellQRScanner/index.js +0 -8
  14. package/es/components/pisellText/components/Editable/index.d.ts +29 -0
  15. package/es/components/pisellText/components/Editable/index.js +130 -0
  16. package/es/components/pisellText/components/Editable/index.less +40 -0
  17. package/es/components/pisellText/index.d.ts +1 -0
  18. package/es/components/pisellText/index.js +2 -0
  19. package/es/components/select/index.js +4 -2
  20. package/es/components/sortableList/index.d.ts +1 -1
  21. package/es/components/sortableList/index.js +2 -1
  22. package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.js +9 -1
  23. package/es/components/table/Actions/component/ExportImport/index.js +55 -27
  24. package/es/components/table/Table/utils.d.ts +1 -1
  25. package/es/components/table/serve.js +8 -0
  26. package/es/components/tabs/index.d.ts +1 -0
  27. package/es/components/tabs/index.js +9 -0
  28. package/es/components/walletCard/index.d.ts +11 -11
  29. package/es/components/walletCard/index.js +51 -40
  30. package/es/locales/en-US.d.ts +1 -1
  31. package/es/locales/en-US.js +2 -2
  32. package/es/locales/zh-CN.d.ts +1 -1
  33. package/es/locales/zh-CN.js +1 -1
  34. package/es/locales/zh-TW.d.ts +1 -1
  35. package/es/locales/zh-TW.js +1 -1
  36. package/es/typings.d.ts +7 -1
  37. package/lib/components/dataSourceComponents/fields/index.d.ts +2 -2
  38. package/lib/components/pisellQRScanner/index.d.ts +0 -13
  39. package/lib/components/pisellText/components/Editable/index.d.ts +29 -0
  40. package/lib/components/pisellText/components/Editable/index.js +139 -0
  41. package/lib/components/pisellText/components/Editable/index.less +40 -0
  42. package/lib/components/pisellText/index.d.ts +1 -0
  43. package/lib/components/pisellText/index.js +2 -0
  44. package/lib/components/select/index.js +7 -2
  45. package/lib/components/sortableList/index.d.ts +1 -1
  46. package/lib/components/sortableList/index.js +2 -2
  47. package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.js +7 -1
  48. package/lib/components/table/Actions/component/ExportImport/index.js +37 -25
  49. package/lib/components/table/Table/utils.d.ts +1 -1
  50. package/lib/components/table/serve.js +8 -0
  51. package/lib/components/tabs/index.d.ts +1 -0
  52. package/lib/components/tabs/index.js +5 -0
  53. package/lib/components/walletCard/index.d.ts +11 -11
  54. package/lib/components/walletCard/index.js +47 -29
  55. package/lib/locales/en-US.d.ts +1 -1
  56. package/lib/locales/en-US.js +2 -2
  57. package/lib/locales/zh-CN.d.ts +1 -1
  58. package/lib/locales/zh-CN.js +1 -1
  59. package/lib/locales/zh-TW.d.ts +1 -1
  60. package/lib/locales/zh-TW.js +1 -1
  61. package/lib/typings.d.ts +7 -1
  62. package/lowcode/pisell-text.editable/meta.ts +115 -0
  63. package/lowcode/pisell-text.editable/snippets.ts +15 -0
  64. package/lowcode/sortable-list/meta.ts +1 -1
  65. package/lowcode/wallet-card/meta.ts +20 -0
  66. package/package.json +1 -1
@@ -4,10 +4,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
8
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
10
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
11
7
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
12
8
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
13
9
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -28,8 +24,6 @@ import Guest from "./Guest";
28
24
  import Guide from "./Guide";
29
25
  import "./index.less";
30
26
 
31
- // 添加JSX类型声明
32
-
33
27
  // 类型定义
34
28
 
35
29
  // 默认值
@@ -41,7 +35,7 @@ var DEFAULT_PROPS = {
41
35
  showWalletName: true,
42
36
  shopName: 'Store name',
43
37
  showShopName: true,
44
- cardNo: 'Wallet number',
38
+ cardNo: 'WL0000000001',
45
39
  cardStyle: 'normal',
46
40
  codeType: 'barCode',
47
41
  platform: 'pc',
@@ -51,21 +45,41 @@ var DEFAULT_PROPS = {
51
45
  walletName: 'Level',
52
46
  isLogin: true,
53
47
  items: [{
54
- key: 'rechargeable',
55
- label: 'rechargeable',
56
- value: 0
48
+ type: 'rechargeable',
49
+ display: 1,
50
+ custom_title: {
51
+ original: 'Balance',
52
+ 'zh-CN': '充值卡',
53
+ 'zh-HK': '充值卡',
54
+ en: 'Balance'
55
+ }
57
56
  }, {
58
- key: 'piont',
59
- label: 'piont',
60
- value: 10
57
+ type: 'point',
58
+ display: 1,
59
+ custom_title: {
60
+ original: 'Points',
61
+ 'zh-CN': '积分卡',
62
+ 'zh-HK': '積分卡',
63
+ en: 'Points'
64
+ }
61
65
  }, {
62
- key: 'voucher',
63
- label: 'Discount cardvoucher',
64
- value: 0
66
+ type: 'voucher',
67
+ display: 1,
68
+ custom_title: {
69
+ original: 'Voucher',
70
+ 'zh-CN': '代金券',
71
+ 'zh-HK': '代金券',
72
+ en: 'Voucher'
73
+ }
65
74
  }, {
66
- key: 'discount',
67
- label: 'discount',
68
- value: 0
75
+ type: 'discount',
76
+ display: 1,
77
+ custom_title: {
78
+ original: 'Discount',
79
+ 'zh-CN': '折扣卡',
80
+ 'zh-HK': '折扣卡',
81
+ en: 'Discount'
82
+ }
69
83
  }]
70
84
  };
71
85
 
@@ -93,7 +107,7 @@ var useCodeModal = function useCodeModal(cardNo, onCodeClick, codeType) {
93
107
  if (interaction !== null && interaction !== void 0 && (_interaction$utils = interaction.utils) !== null && _interaction$utils !== void 0 && (_interaction$utils$is = _interaction$utils.isAppEnv) !== null && _interaction$utils$is !== void 0 && _interaction$utils$is.call(_interaction$utils)) {
94
108
  var _interaction$utils2, _interaction$utils2$p;
95
109
  var typeMap = {
96
- orCode: 'qrCode',
110
+ qrCode: 'qrCode',
97
111
  barCode: 'barCode'
98
112
  };
99
113
  interaction === null || interaction === void 0 || (_interaction$utils2 = interaction.utils) === null || _interaction$utils2 === void 0 || (_interaction$utils2$p = _interaction$utils2.postMessageToApp) === null || _interaction$utils2$p === void 0 || _interaction$utils2$p.call(_interaction$utils2, {
@@ -198,49 +212,44 @@ var CardHeader = function CardHeader(_ref2) {
198
212
 
199
213
  // 子组件:卡片内容项
200
214
  var CardItem = function CardItem(_ref3) {
215
+ var _context$appHelper2;
201
216
  var item = _ref3.item,
202
217
  symbol = _ref3.symbol;
203
- var key = item.key,
204
- label = item.label,
218
+ var type = item.type,
219
+ custom_title = item.custom_title,
205
220
  value = item.value;
221
+ var context = useEngineContext();
222
+ var utils = context === null || context === void 0 || (_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 ? void 0 : _context$appHelper2.utils;
223
+ var translationOriginal = (utils === null || utils === void 0 ? void 0 : utils.translationOriginal) || (utils === null || utils === void 0 ? void 0 : utils.translation);
206
224
  return /*#__PURE__*/React.createElement("div", {
207
225
  className: "pisell-wallet-card-item"
208
226
  }, /*#__PURE__*/React.createElement("div", {
209
227
  className: "pisell-wallet-card-item-label"
210
- }, getText("walletCard-".concat(label)) || ''), /*#__PURE__*/React.createElement("div", {
228
+ }, translationOriginal(custom_title || '') || ''), /*#__PURE__*/React.createElement("div", {
211
229
  className: "pisell-wallet-card-item-value"
212
- }, key === 'rechargeable' ? /*#__PURE__*/React.createElement(Amount, {
230
+ }, type === 'rechargeable' ? /*#__PURE__*/React.createElement(Amount, {
213
231
  className: "pisell-card-amount-item-value",
214
232
  platform: "h5",
215
233
  symbol: symbol,
216
234
  useThousandsSeparator: true,
217
235
  showCurrencySymbol: true,
218
236
  value: value
219
- }) : value));
237
+ }) : value || '0'));
220
238
  };
221
239
 
222
240
  // 子组件:卡片内容
223
241
  var CardContent = function CardContent(_ref4) {
224
242
  var items = _ref4.items,
225
243
  symbol = _ref4.symbol;
226
- // 定义期望的顺序
227
- var expectedOrder = ['piont', 'balance', 'discount', 'voucher'];
228
-
229
- // 对 items 进行排序
230
- var sortedItems = useMemo(function () {
231
- if (!(items !== null && items !== void 0 && items.length)) return [];
232
- return _toConsumableArray(items).sort(function (a, b) {
233
- var indexA = expectedOrder.indexOf(a.key);
234
- var indexB = expectedOrder.indexOf(b.key);
235
- return indexA - indexB;
236
- });
237
- }, [items]);
244
+ var filteredItems = (items || []).filter(function (item) {
245
+ return item.display !== 0;
246
+ });
238
247
  return /*#__PURE__*/React.createElement("div", {
239
248
  className: "pisell-wallet-card-list",
240
249
  style: {
241
- justifyContent: (sortedItems || []).length > 1 ? 'space-between' : 'flex-start'
250
+ justifyContent: filteredItems.length > 1 ? 'space-between' : 'flex-start'
242
251
  }
243
- }, (sortedItems || []).map(function (item, index) {
252
+ }, filteredItems.map(function (item, index) {
244
253
  return /*#__PURE__*/React.createElement(CardItem, {
245
254
  key: index,
246
255
  item: item,
@@ -386,7 +395,9 @@ var WalletCard = function WalletCard(props) {
386
395
  }
387
396
  utils === null || utils === void 0 || utils.action({
388
397
  type: 'pisell1.goWallet',
389
- data: {},
398
+ data: {
399
+ id: props.id
400
+ },
390
401
  callback: function callback() {}
391
402
  });
392
403
  };
@@ -175,7 +175,7 @@ declare const _default: {
175
175
  'pisell-action-get-data': string;
176
176
  'pisell-action-delete-success': string;
177
177
  'pisell-action-delete-failed': string;
178
- 'walletCard-piont': string;
178
+ 'walletCard-point': string;
179
179
  'walletCard-rechargeable': string;
180
180
  'walletCard-voucher': string;
181
181
  'walletCard-discount': string;
@@ -162,7 +162,7 @@ export default {
162
162
  'pisell-adjust-price-total-after-discount': 'Total after discount: ',
163
163
  'pisell-adjust-price-discount-can-be-maximum': 'Discount can be maximum',
164
164
  'pisell-discount-card-title': 'Discount',
165
- 'pisell-discount-card-unit': 'off',
165
+ 'pisell-discount-card-unit': 'OFF',
166
166
  'pisell-discount-card-fixed-amount-prefix': 'Save',
167
167
  // 数据源表格
168
168
  'pisell-data-source-table-add': 'Add',
@@ -225,7 +225,7 @@ export default {
225
225
  'pisell-action-get-data': 'Please get data first',
226
226
  'pisell-action-delete-success': 'Deleted successfully',
227
227
  'pisell-action-delete-failed': 'Delete failed, please try again',
228
- 'walletCard-piont': 'Points',
228
+ 'walletCard-point': 'Points',
229
229
  'walletCard-rechargeable': 'Balance',
230
230
  'walletCard-voucher': 'Voucher',
231
231
  'walletCard-discount': 'Discount',
@@ -175,7 +175,7 @@ declare const _default: {
175
175
  'pisell-action-get-data': string;
176
176
  'pisell-action-delete-success': string;
177
177
  'pisell-action-delete-failed': string;
178
- 'walletCard-piont': string;
178
+ 'walletCard-point': string;
179
179
  'walletCard-rechargeable': string;
180
180
  'walletCard-voucher': string;
181
181
  'walletCard-discount': string;
@@ -224,7 +224,7 @@ export default {
224
224
  'pisell-action-get-data': '请先获取数据',
225
225
  'pisell-action-delete-success': '删除成功',
226
226
  'pisell-action-delete-failed': '删除失败,请重试',
227
- 'walletCard-piont': '积分',
227
+ 'walletCard-point': '积分',
228
228
  'walletCard-rechargeable': '余额',
229
229
  'walletCard-voucher': '代金券',
230
230
  'walletCard-discount': '折扣卡',
@@ -174,7 +174,7 @@ declare const _default: {
174
174
  'pisell-action-get-data': string;
175
175
  'pisell-action-delete-success': string;
176
176
  'pisell-action-delete-failed': string;
177
- 'walletCard-piont': string;
177
+ 'walletCard-point': string;
178
178
  'walletCard-rechargeable': string;
179
179
  'walletCard-voucher': string;
180
180
  'walletCard-discount': string;
@@ -224,7 +224,7 @@ export default {
224
224
  'pisell-action-get-data': '請先獲取數據',
225
225
  'pisell-action-delete-success': '刪除成功',
226
226
  'pisell-action-delete-failed': '刪除失敗,請重試',
227
- 'walletCard-piont': '積分',
227
+ 'walletCard-point': '積分',
228
228
  'walletCard-rechargeable': '餘額',
229
229
  'walletCard-voucher': '代金券',
230
230
  'walletCard-discount': '折扣卡',
package/es/typings.d.ts CHANGED
@@ -1,4 +1,10 @@
1
1
  declare module '*.png' {
2
2
  const content: string;
3
3
  export default content;
4
- }
4
+ }
5
+
6
+ namespace JSX {
7
+ interface IntrinsicElements {
8
+ [elemName: string]: any;
9
+ }
10
+ }
@@ -79,7 +79,7 @@ declare const getFieldComponent: (fieldComponent: string) => (import("react").FC
79
79
  name?: string | undefined;
80
80
  fieldKey?: string | undefined;
81
81
  } & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
82
- }) | import("react").FC<any> | import("react").FC<import("./Input.Mobile/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Input.Phone/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./DateRangePicker/type").DateRangePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | (import("react").FC<{}> & {
82
+ }) | import("react").FC<any> | import("react").FC<import("./Input.Mobile/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Input.Phone/WithMode").PhoneInputProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | (import("react").FC<{}> & {
83
83
  Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
84
84
  } & {
85
85
  Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
@@ -97,5 +97,5 @@ declare const getFieldComponent: (fieldComponent: string) => (import("react").FC
97
97
  dataSource?: any;
98
98
  }) => JSX.Element) | import("react").FC<import("./TimePicker/type").TimePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & {
99
99
  onChange: (value: string) => void;
100
- } & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<import("./Upload/type").UploadProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
100
+ } & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd").InputProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("antd/es/input").PasswordProps & import("react").RefAttributes<import("antd").InputRef> & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Radio/type").RadioGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps> | import("react").FC<import("./DateRangePicker/type").DateRangePickerProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Upload/type").UploadProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps> | import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
101
101
  export { getFieldComponent, formFieldMap };
@@ -1,18 +1,5 @@
1
1
  import React from 'react';
2
2
  import './index.less';
3
- import type { DetailedHTMLProps, HTMLAttributes, VideoHTMLAttributes, InputHTMLAttributes } from 'react';
4
- declare type ExtendedDetailedHTMLProps<T extends HTMLAttributes<E>, E extends HTMLElement> = DetailedHTMLProps<T, E> & {
5
- children?: React.ReactNode;
6
- };
7
- declare global {
8
- namespace JSX {
9
- interface IntrinsicElements {
10
- div: ExtendedDetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
11
- video: DetailedHTMLProps<VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>;
12
- input: DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
13
- }
14
- }
15
- }
16
3
  export interface PisellQRScannerProps {
17
4
  /** 是否可见 */
18
5
  visible: boolean;
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ export declare type MultiLanguageValue = {
4
+ en: string;
5
+ 'zh-CN': string;
6
+ 'zh-HK': string;
7
+ };
8
+ export interface EditableConfig {
9
+ /** 是否禁用编辑 */
10
+ disabled?: boolean;
11
+ /** 最大长度 */
12
+ maxLength?: number;
13
+ /** 编辑图标 */
14
+ icon?: React.ReactNode;
15
+ }
16
+ export interface EditableProps extends React.HTMLAttributes<HTMLSpanElement> {
17
+ /** 文本内容,支持字符串或多语言对象 */
18
+ value?: string | MultiLanguageValue;
19
+ /** 子节点内容,优先级高于 value */
20
+ children?: string;
21
+ /** 可编辑配置,boolean 时使用默认配置 */
22
+ editable?: boolean | EditableConfig;
23
+ /** 编辑变更回调 */
24
+ onChange?: (value: string | MultiLanguageValue) => void;
25
+ /** 输入框尺寸 */
26
+ size?: 'large' | 'middle' | 'small';
27
+ }
28
+ declare const Editable: React.FC<EditableProps>;
29
+ export default Editable;
@@ -0,0 +1,139 @@
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/pisellText/components/Editable/index.tsx
30
+ var Editable_exports = {};
31
+ __export(Editable_exports, {
32
+ default: () => Editable_default
33
+ });
34
+ module.exports = __toCommonJS(Editable_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_antd = require("antd");
37
+ var import_icon = __toESM(require("../../../icon"));
38
+ var import_utils = require("@pisell/utils");
39
+ var import_classnames = __toESM(require("classnames"));
40
+ var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
41
+ var import_translation = __toESM(require("../../../translation"));
42
+ var import_index = require("./index.less");
43
+ var Editable = (props) => {
44
+ const {
45
+ value,
46
+ children,
47
+ editable = false,
48
+ onChange,
49
+ className,
50
+ size = "middle",
51
+ ...others
52
+ } = props;
53
+ const context = (0, import_useEngineContext.default)();
54
+ const [isEditing, setIsEditing] = (0, import_react.useState)(false);
55
+ const editableConfig = (0, import_react.useMemo)(() => {
56
+ if (typeof editable === "boolean") {
57
+ return editable ? {} : null;
58
+ }
59
+ return editable || null;
60
+ }, [editable]);
61
+ const currentLocale = (0, import_react.useMemo)(() => {
62
+ var _a, _b;
63
+ const locale = (_b = (_a = context.appHelper.utils) == null ? void 0 : _a.storage) == null ? void 0 : _b.get("umi_locale");
64
+ return import_utils.locales.formatLocale(locale);
65
+ }, []);
66
+ const displayValue = (0, import_react.useMemo)(() => {
67
+ if (typeof children === "string") return children;
68
+ if (typeof value === "string") {
69
+ return value;
70
+ }
71
+ if (value && typeof value === "object") {
72
+ return value[currentLocale] || "";
73
+ }
74
+ return "";
75
+ }, [value, currentLocale, children]);
76
+ const isMultiLanguage = (0, import_react.useMemo)(() => {
77
+ return !!value && typeof value === "object";
78
+ }, [value]);
79
+ const handleEdit = () => {
80
+ if (editableConfig == null ? void 0 : editableConfig.disabled) return;
81
+ setIsEditing(true);
82
+ };
83
+ const handleInputChange = (newValue) => {
84
+ if (!onChange) return;
85
+ onChange(newValue);
86
+ };
87
+ if (isEditing && editableConfig) {
88
+ if (isMultiLanguage) {
89
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("pisell-text-editable-editing", className) }, /* @__PURE__ */ import_react.default.createElement(
90
+ import_translation.default,
91
+ {
92
+ value,
93
+ onChange: handleInputChange,
94
+ onPressEnter: () => setIsEditing(false),
95
+ maxLength: editableConfig.maxLength,
96
+ size,
97
+ autoFocus: true
98
+ }
99
+ ));
100
+ }
101
+ return /* @__PURE__ */ import_react.default.createElement(
102
+ import_antd.Input,
103
+ {
104
+ value: displayValue,
105
+ onChange: (e) => handleInputChange(e.target.value),
106
+ onPressEnter: () => setIsEditing(false),
107
+ maxLength: editableConfig.maxLength,
108
+ size,
109
+ autoFocus: true,
110
+ className: (0, import_classnames.default)("pisell-text-editable-input", className),
111
+ style: others.style
112
+ }
113
+ );
114
+ }
115
+ return /* @__PURE__ */ import_react.default.createElement(
116
+ "span",
117
+ {
118
+ className: (0, import_classnames.default)("pisell-text-editable", className, {
119
+ "pisell-text-editable-enabled": editableConfig && !editableConfig.disabled
120
+ }),
121
+ ...others
122
+ },
123
+ displayValue,
124
+ editableConfig && !editableConfig.disabled && !isEditing && /* @__PURE__ */ import_react.default.createElement(
125
+ "span",
126
+ {
127
+ className: "pisell-text-editable-edit-icon",
128
+ onClick: (e) => {
129
+ e.preventDefault();
130
+ e.stopPropagation();
131
+ handleEdit();
132
+ },
133
+ title: "点击编辑"
134
+ },
135
+ editableConfig.icon || /* @__PURE__ */ import_react.default.createElement(import_icon.default, { type: "pisell2-edit-05", size: 16 })
136
+ )
137
+ );
138
+ };
139
+ var Editable_default = Editable;
@@ -0,0 +1,40 @@
1
+ .pisell-text-editable {
2
+ position: relative;
3
+
4
+ &-enabled {
5
+ cursor: pointer;
6
+ }
7
+
8
+ &-edit-icon {
9
+ margin-left: 4px;
10
+ color: rgba(0, 0, 0, 0.45);
11
+ font-size: 12px;
12
+ opacity: 1;
13
+ cursor: pointer;
14
+ pointer-events: auto;
15
+ z-index: 1;
16
+
17
+ &:hover {
18
+ color: #1890ff;
19
+ }
20
+
21
+ // 确保内部的图标不会阻止点击事件
22
+ * {
23
+ pointer-events: none;
24
+ }
25
+ }
26
+
27
+ &-input {
28
+ min-width: 100px;
29
+
30
+ &.ant-input {
31
+ border: 1px solid #1890ff;
32
+ box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
33
+ }
34
+ }
35
+
36
+ &-editing {
37
+ display: inline-block;
38
+ width: 100%;
39
+ }
40
+ }
@@ -4,5 +4,6 @@ export interface PisellTextProps extends React.HTMLAttributes<HTMLSpanElement> {
4
4
  declare const PisellText: {
5
5
  (props: PisellTextProps): JSX.Element;
6
6
  Amount: (props: import("./components/Amount").AmountProps) => JSX.Element;
7
+ Editable: React.FC<import("./components/Editable").EditableProps>;
7
8
  };
8
9
  export default PisellText;
@@ -34,8 +34,10 @@ __export(pisellText_exports, {
34
34
  module.exports = __toCommonJS(pisellText_exports);
35
35
  var import_react = __toESM(require("react"));
36
36
  var import_Amount = __toESM(require("./components/Amount"));
37
+ var import_Editable = __toESM(require("./components/Editable"));
37
38
  var PisellText = (props) => {
38
39
  return /* @__PURE__ */ import_react.default.createElement("span", { ...props });
39
40
  };
40
41
  PisellText.Amount = import_Amount.default;
42
+ PisellText.Editable = import_Editable.default;
41
43
  var pisellText_default = PisellText;
@@ -51,6 +51,7 @@ var SelectBase = (0, import_react.forwardRef)((props, ref) => {
51
51
  options,
52
52
  dropdownRender: propsDropdownRender,
53
53
  showSearch,
54
+ onSearch,
54
55
  styleType,
55
56
  optionFilterProp = "value",
56
57
  popupClassName,
@@ -111,7 +112,10 @@ var SelectBase = (0, import_react.forwardRef)((props, ref) => {
111
112
  size: "middle",
112
113
  placeholder: (0, import_locales.getText)("select-dropdown-render-search"),
113
114
  value: searchValue,
114
- onChange: (e) => setSearchValue(e.target.value),
115
+ onChange: (e) => {
116
+ onSearch == null ? void 0 : onSearch(e.target.value);
117
+ setSearchValue(e.target.value);
118
+ },
115
119
  bordered: false,
116
120
  allowClear: true,
117
121
  prefix: /* @__PURE__ */ import_react.default.createElement(import_iconfont.default, { style: { color: "#98A2B3" }, type: "pisell2-search-lg" })
@@ -142,7 +146,8 @@ var SelectBase = (0, import_react.forwardRef)((props, ref) => {
142
146
  checkboxChecked,
143
147
  propsDropdownRender,
144
148
  searchValue,
145
- showSearch
149
+ showSearch,
150
+ onSearch
146
151
  ]
147
152
  );
148
153
  if (styleType === "system") {
@@ -4,7 +4,7 @@ export interface SortableListProps<T> {
4
4
  dataSource: Props<T>["list"];
5
5
  onChange: Props<T>["onChange"];
6
6
  rowKey: Props<T>["rowKey"];
7
- renderItem?: (item: T) => React.ReactNode;
7
+ renderItem?: (item: T, index: number) => React.ReactNode;
8
8
  activationConstraint?: Props<T>["activationConstraint"];
9
9
  }
10
10
  declare const SortableList: React.FC<SortableListProps<any>>;
@@ -54,8 +54,8 @@ var SortableList = (props) => {
54
54
  activationConstraint
55
55
  },
56
56
  (params) => {
57
- const { item, props: p, attributes, listeners, style } = params;
58
- return /* @__PURE__ */ import_react.default.createElement("div", { ...p, ...attributes, ...listeners, style }, renderItem == null ? void 0 : renderItem(item));
57
+ const { item, index, props: p, attributes, listeners, style } = params;
58
+ return /* @__PURE__ */ import_react.default.createElement("div", { ...p, ...attributes, ...listeners, style }, renderItem == null ? void 0 : renderItem(item, index));
59
59
  }
60
60
  );
61
61
  };
@@ -27,6 +27,11 @@ var import_locales = require("../../../../../../../locales/index");
27
27
  var import_serve = require("../../../../../serve");
28
28
  var import_status = require("../../../../../status");
29
29
  var import_file = require("../../utils/file");
30
+ var exportImportTypeMap = {
31
+ "current-page": "page",
32
+ "all-records": "all",
33
+ "selected-records": "select"
34
+ };
30
35
  var _batchExport = async (params) => {
31
36
  let { status } = await (0, import_serve.exportData)(params);
32
37
  if (status) {
@@ -42,7 +47,7 @@ var _batchExport = async (params) => {
42
47
  var batchExport = (exportParams, exportImport) => {
43
48
  const { selectLists, apiUrl, otherParams } = exportImport;
44
49
  let _name = (0, import_file.getFileDateName)();
45
- let params = { ...otherParams };
50
+ let params = (otherParams == null ? void 0 : otherParams.export) ? { ...otherParams == null ? void 0 : otherParams.export } : { ...otherParams };
46
51
  params.url = apiUrl == null ? void 0 : apiUrl.export;
47
52
  console.log("exportParams", exportParams);
48
53
  const type = (exportParams == null ? void 0 : exportParams.type) || import_status.defaultOptions.exportType;
@@ -72,6 +77,7 @@ var batchExport = (exportParams, exportImport) => {
72
77
  params == null ? true : delete params.payment_status;
73
78
  params == null ? true : delete params.status;
74
79
  }
80
+ params.export_select = exportImportTypeMap[type];
75
81
  return _batchExport(params);
76
82
  };
77
83
  // Annotate the CommonJS export names for ESM import in node: