@pisell/materials 6.3.8 → 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 (108) 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 +155 -150
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +24 -25
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +34 -35
  11. package/dist/umd/materials.min.css +1 -0
  12. package/dist/umd/materials.min.js +1 -0
  13. package/dist/umd/static/DotsSix.57d66266.svg +1 -0
  14. package/dist/umd/static/arrow-left.e542294f.svg +1 -0
  15. package/dist/umd/static/arrow-right.763f03e0.svg +1 -0
  16. package/dist/umd/static/filter-lines.04a54ae9.svg +1 -0
  17. package/dist/umd/static/help-circle.31c9be40.svg +1 -0
  18. package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +1 -0
  19. package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
  20. package/es/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +0 -1
  21. package/es/components/dataSourceComponents/dataSourceTable/filter/utils.d.ts +0 -1
  22. package/es/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
  23. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +2 -2
  24. package/es/components/dataSourceComponents/fields/Input.Phone/serve.js +158 -22
  25. package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
  26. package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
  27. package/es/components/dataSourceComponents/fields/index.d.ts +21 -22
  28. package/es/components/pisellQRScanner/index.d.ts +0 -13
  29. package/es/components/pisellQRScanner/index.js +0 -8
  30. package/es/components/pisellText/components/Editable/index.d.ts +29 -0
  31. package/es/components/pisellText/components/Editable/index.js +130 -0
  32. package/es/components/pisellText/components/Editable/index.less +40 -0
  33. package/es/components/pisellText/index.d.ts +1 -0
  34. package/es/components/pisellText/index.js +2 -0
  35. package/es/components/pisellWalletPassCard/index.d.ts +0 -1
  36. package/es/components/productCard/components/Packages/utils.d.ts +1 -1
  37. package/es/components/select/index.js +4 -2
  38. package/es/components/select-time/index.d.ts +0 -1
  39. package/es/components/sortableList/index.d.ts +1 -1
  40. package/es/components/sortableList/index.js +2 -1
  41. package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.js +9 -1
  42. package/es/components/table/Actions/component/ExportImport/index.js +55 -27
  43. package/es/components/table/Gallery/components/VirtualGrid/useGapSize.d.ts +2 -2
  44. package/es/components/table/Table/fields/index.d.ts +2 -2
  45. package/es/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
  46. package/es/components/table/Table/fields/treeSelect/filterUtil/index.d.ts +1 -1
  47. package/es/components/table/Table/utils.d.ts +1 -1
  48. package/es/components/table/serve.js +8 -0
  49. package/es/components/tabs/index.d.ts +1 -0
  50. package/es/components/tabs/index.js +9 -0
  51. package/es/components/walletCard/index.d.ts +11 -11
  52. package/es/components/walletCard/index.js +51 -40
  53. package/es/locales/en-US.d.ts +1 -1
  54. package/es/locales/en-US.js +2 -2
  55. package/es/locales/zh-CN.d.ts +1 -1
  56. package/es/locales/zh-CN.js +1 -1
  57. package/es/locales/zh-TW.d.ts +1 -1
  58. package/es/locales/zh-TW.js +1 -1
  59. package/es/typings.d.ts +7 -1
  60. package/es/utils/index.d.ts +1 -1
  61. package/es/utils/platform.d.ts +1 -1
  62. package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
  63. package/lib/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +0 -1
  64. package/lib/components/dataSourceComponents/dataSourceTable/filter/utils.d.ts +0 -1
  65. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
  66. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +2 -2
  67. package/lib/components/dataSourceComponents/fields/Input.Phone/serve.js +182 -18
  68. package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
  69. package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
  70. package/lib/components/dataSourceComponents/fields/index.d.ts +21 -22
  71. package/lib/components/pisellQRScanner/index.d.ts +0 -13
  72. package/lib/components/pisellText/components/Editable/index.d.ts +29 -0
  73. package/lib/components/pisellText/components/Editable/index.js +139 -0
  74. package/lib/components/pisellText/components/Editable/index.less +40 -0
  75. package/lib/components/pisellText/index.d.ts +1 -0
  76. package/lib/components/pisellText/index.js +2 -0
  77. package/lib/components/pisellWalletPassCard/index.d.ts +0 -1
  78. package/lib/components/productCard/components/Packages/utils.d.ts +1 -1
  79. package/lib/components/select/index.js +7 -2
  80. package/lib/components/select-time/index.d.ts +0 -1
  81. package/lib/components/sortableList/index.d.ts +1 -1
  82. package/lib/components/sortableList/index.js +2 -2
  83. package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.js +7 -1
  84. package/lib/components/table/Actions/component/ExportImport/index.js +37 -25
  85. package/lib/components/table/Gallery/components/VirtualGrid/useGapSize.d.ts +2 -2
  86. package/lib/components/table/Table/fields/index.d.ts +2 -2
  87. package/lib/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
  88. package/lib/components/table/Table/fields/treeSelect/filterUtil/index.d.ts +1 -1
  89. package/lib/components/table/Table/utils.d.ts +1 -1
  90. package/lib/components/table/serve.js +8 -0
  91. package/lib/components/tabs/index.d.ts +1 -0
  92. package/lib/components/tabs/index.js +5 -0
  93. package/lib/components/walletCard/index.d.ts +11 -11
  94. package/lib/components/walletCard/index.js +47 -29
  95. package/lib/locales/en-US.d.ts +1 -1
  96. package/lib/locales/en-US.js +2 -2
  97. package/lib/locales/zh-CN.d.ts +1 -1
  98. package/lib/locales/zh-CN.js +1 -1
  99. package/lib/locales/zh-TW.d.ts +1 -1
  100. package/lib/locales/zh-TW.js +1 -1
  101. package/lib/typings.d.ts +7 -1
  102. package/lib/utils/index.d.ts +1 -1
  103. package/lib/utils/platform.d.ts +1 -1
  104. package/lowcode/pisell-text.editable/meta.ts +115 -0
  105. package/lowcode/pisell-text.editable/snippets.ts +15 -0
  106. package/lowcode/sortable-list/meta.ts +1 -1
  107. package/lowcode/wallet-card/meta.ts +20 -0
  108. package/package.json +2 -2
@@ -23,6 +23,7 @@ var SelectBase = /*#__PURE__*/forwardRef(function (props, ref) {
23
23
  options = props.options,
24
24
  propsDropdownRender = props.dropdownRender,
25
25
  showSearch = props.showSearch,
26
+ onSearch = props.onSearch,
26
27
  styleType = props.styleType,
27
28
  _props$optionFilterPr = props.optionFilterProp,
28
29
  optionFilterProp = _props$optionFilterPr === void 0 ? 'value' : _props$optionFilterPr,
@@ -87,7 +88,8 @@ var SelectBase = /*#__PURE__*/forwardRef(function (props, ref) {
87
88
  placeholder: getText('select-dropdown-render-search'),
88
89
  value: searchValue,
89
90
  onChange: function onChange(e) {
90
- return setSearchValue(e.target.value);
91
+ onSearch === null || onSearch === void 0 || onSearch(e.target.value);
92
+ setSearchValue(e.target.value);
91
93
  },
92
94
  bordered: false,
93
95
  allowClear: true,
@@ -105,7 +107,7 @@ var SelectBase = /*#__PURE__*/forwardRef(function (props, ref) {
105
107
  onChange: onSelectAllChange,
106
108
  checked: checkboxChecked
107
109
  }, getText('select-dropdown-render-select-all')))));
108
- }, [isShowDropdown, isShowSelectAll, checkboxChecked, propsDropdownRender, searchValue, showSearch]);
110
+ }, [isShowDropdown, isShowSelectAll, checkboxChecked, propsDropdownRender, searchValue, showSearch, onSearch]);
109
111
  if (styleType === 'system') {
110
112
  return /*#__PURE__*/React.createElement(BrowserSelect, props);
111
113
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { VirtualKeyboardTimeProps } from "../virtual-keyboard/Time";
3
2
  import { PopoverProps, TimePickerProps } from "antd";
4
3
  import "./index.less";
@@ -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>>;
@@ -18,13 +18,14 @@ var SortableList = function SortableList(props) {
18
18
  activationConstraint: activationConstraint
19
19
  }, function (params) {
20
20
  var item = params.item,
21
+ index = params.index,
21
22
  p = params.props,
22
23
  attributes = params.attributes,
23
24
  listeners = params.listeners,
24
25
  style = params.style;
25
26
  return /*#__PURE__*/React.createElement("div", _extends({}, p, attributes, listeners, {
26
27
  style: style
27
- }), renderItem === null || renderItem === void 0 ? void 0 : renderItem(item));
28
+ }), renderItem === null || renderItem === void 0 ? void 0 : renderItem(item, index));
28
29
  });
29
30
  };
30
31
  export default SortableList;
@@ -12,6 +12,12 @@ import { getText } from "../../../../../../../locales/index";
12
12
  import { exportData } from "../../../../../serve";
13
13
  import { defaultOptions } from "../../../../../status";
14
14
  import { getFileDateName } from "../../utils/file";
15
+ var exportImportTypeMap = {
16
+ 'current-page': 'page',
17
+ 'all-records': 'all',
18
+ 'selected-records': 'select'
19
+ };
20
+
15
21
  // 导出接口
16
22
  var _batchExport = /*#__PURE__*/function () {
17
23
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
@@ -52,7 +58,8 @@ export var batchExport = function batchExport(exportParams, exportImport) {
52
58
  apiUrl = exportImport.apiUrl,
53
59
  otherParams = exportImport.otherParams;
54
60
  var _name = getFileDateName();
55
- var params = _objectSpread({}, otherParams);
61
+ // 拆分导入导出参数
62
+ var params = otherParams !== null && otherParams !== void 0 && otherParams.export ? _objectSpread({}, otherParams === null || otherParams === void 0 ? void 0 : otherParams.export) : _objectSpread({}, otherParams);
56
63
  params.url = apiUrl === null || apiUrl === void 0 ? void 0 : apiUrl.export;
57
64
  console.log("exportParams", exportParams);
58
65
  var type = (exportParams === null || exportParams === void 0 ? void 0 : exportParams.type) || defaultOptions.exportType;
@@ -93,5 +100,6 @@ export var batchExport = function batchExport(exportParams, exportImport) {
93
100
  params === null || params === void 0 || delete params.payment_status;
94
101
  params === null || params === void 0 || delete params.status;
95
102
  }
103
+ params.export_select = exportImportTypeMap[type];
96
104
  return _batchExport(params);
97
105
  };
@@ -55,6 +55,10 @@ var ExportImport = function ExportImport(_ref) {
55
55
  _useState10 = _slicedToArray(_useState9, 2),
56
56
  errorStatus = _useState10[0],
57
57
  setErrorStatus = _useState10[1];
58
+ var _useState11 = useState(false),
59
+ _useState12 = _slicedToArray(_useState11, 2),
60
+ loading = _useState12[0],
61
+ setLoading = _useState12[1];
58
62
  var _useSharedState = useSharedState(Context),
59
63
  state = _useSharedState.state;
60
64
  var originResultDataSource = state.originResultDataSource,
@@ -147,9 +151,11 @@ var ExportImport = function ExportImport(_ref) {
147
151
  return _regeneratorRuntime().wrap(function _callee$(_context) {
148
152
  while (1) switch (_context.prev = _context.next) {
149
153
  case 0:
150
- apiUrl = exportImport.apiUrl, otherParams = exportImport.otherParams; // 导出
154
+ apiUrl = exportImport.apiUrl, otherParams = exportImport.otherParams;
155
+ setLoading(true);
156
+ _context.prev = 2;
151
157
  if (!(value === defaultOptions.exportValue)) {
152
- _context.next = 9;
158
+ _context.next = 11;
153
159
  break;
154
160
  }
155
161
  _params = {
@@ -157,41 +163,62 @@ var ExportImport = function ExportImport(_ref) {
157
163
  originDataSource: originResultDataSource,
158
164
  currentDataSource: currentDataSource
159
165
  };
160
- _context.next = 5;
166
+ _context.next = 7;
161
167
  return batchExport(_params, exportImport);
162
- case 5:
168
+ case 7:
163
169
  result = _context.sent;
164
170
  if (result) {
165
171
  onCancel();
166
172
  }
167
- _context.next = 10;
173
+ _context.next = 24;
168
174
  break;
169
- case 9:
170
- if (value === defaultOptions.importValue) {
171
- formData = new FormData();
172
- formData.append('file', file);
173
- formId = otherParams === null || otherParams === void 0 ? void 0 : otherParams.form_id;
174
- formCode = otherParams === null || otherParams === void 0 ? void 0 : otherParams.code;
175
- if (formId) {
176
- formData.append('form_id', formId);
177
- }
178
- if (formCode) {
179
- formData.append('code', formCode);
180
- }
181
- formData.append('url', (apiUrl === null || apiUrl === void 0 ? void 0 : apiUrl.export) || '');
182
- if (formData) {
183
- message.loading({
184
- content: 'Loading...',
185
- key: value
186
- });
187
- _batchImport.run(formData);
188
- }
175
+ case 11:
176
+ if (!(value === defaultOptions.importValue)) {
177
+ _context.next = 24;
178
+ break;
179
+ }
180
+ formData = new FormData();
181
+ formData.append('file', file);
182
+ formId = otherParams === null || otherParams === void 0 ? void 0 : otherParams.form_id;
183
+ formCode = otherParams === null || otherParams === void 0 ? void 0 : otherParams.code;
184
+ if (formId) {
185
+ formData.append('form_id', formId);
186
+ }
187
+ if (formCode) {
188
+ formData.append('code', formCode);
189
+ }
190
+ formData.append('url', (apiUrl === null || apiUrl === void 0 ? void 0 : apiUrl.import) || '');
191
+ if (otherParams.import) {
192
+ Object.entries(otherParams.import).forEach(function (_ref5) {
193
+ var _ref6 = _slicedToArray(_ref5, 2),
194
+ key = _ref6[0],
195
+ value = _ref6[1];
196
+ formData.append(key, value);
197
+ });
189
198
  }
190
- case 10:
199
+ if (!formData) {
200
+ _context.next = 24;
201
+ break;
202
+ }
203
+ message.loading({
204
+ content: 'Loading...',
205
+ key: value
206
+ });
207
+ _context.next = 24;
208
+ return _batchImport.run(formData);
209
+ case 24:
210
+ _context.next = 28;
211
+ break;
212
+ case 26:
213
+ _context.prev = 26;
214
+ _context.t0 = _context["catch"](2);
215
+ case 28:
216
+ setLoading(false);
217
+ case 29:
191
218
  case "end":
192
219
  return _context.stop();
193
220
  }
194
- }, _callee);
221
+ }, _callee, null, [[2, 26]]);
195
222
  }));
196
223
  return function onOk() {
197
224
  return _ref4.apply(this, arguments);
@@ -226,6 +253,7 @@ var ExportImport = function ExportImport(_ref) {
226
253
  onOk: onOk,
227
254
  cancelText: getText('table-action-export-import-cancel'),
228
255
  okButtonProps: {
256
+ loading: loading,
229
257
  disabled: value === defaultOptions.importValue && (!file || !!errorStatus)
230
258
  }
231
259
  }, /*#__PURE__*/React.createElement(Content, {
@@ -1,5 +1,5 @@
1
1
  declare const useGapSize: (gap: number | number[]) => {
2
- horizontal: number;
3
- vertical: number;
2
+ horizontal: any;
3
+ vertical: any;
4
4
  };
5
5
  export default useGapSize;
@@ -197,12 +197,12 @@ export declare const fieldList: ({
197
197
  field_icon: string;
198
198
  field_name: string;
199
199
  field_type: string;
200
- default_value: string;
200
+ default_value: boolean;
201
201
  } | {
202
202
  field_icon: string;
203
203
  field_name: string;
204
204
  field_type: string;
205
- default_value: boolean;
205
+ default_value: string;
206
206
  } | {
207
207
  field_icon: string;
208
208
  field_name: string;
@@ -2,4 +2,4 @@ export default function ({ value, key, item, }: {
2
2
  value: string | string[];
3
3
  key: string | string[];
4
4
  item: Record<string, any>;
5
- }): boolean;
5
+ }): any;
@@ -2,4 +2,4 @@ export default function ({ value, key, item, }: {
2
2
  value: string | string[] | Record<string, any>[];
3
3
  key: string | string[];
4
4
  item: Record<string, any>;
5
- }): boolean;
5
+ }): any;
@@ -155,7 +155,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
155
155
  sort?: SortType | undefined;
156
156
  mode: "" | "localStorage" | "remote";
157
157
  currentViewMode: ModeType;
158
- }) => ("filters" | "filter_setting" | "column_setting" | "gallery_setting" | "view_mode" | "group_by" | "order_by")[];
158
+ }) => ("view_mode" | "filter_setting" | "group_by" | "order_by" | "column_setting" | "gallery_setting" | "filters")[];
159
159
  export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
160
160
  export declare const stringify: (obj: Record<string, any>) => string;
161
161
  export {};
@@ -26,6 +26,14 @@ var defaultUrl = {
26
26
  * @Date: 2024-09-05 12:01
27
27
  */
28
28
  var formatApiParams = function formatApiParams(params, type) {
29
+ if (params instanceof FormData) {
30
+ var url = params.get('url');
31
+ params.delete('url');
32
+ return {
33
+ url: url || (defaultUrl === null || defaultUrl === void 0 ? void 0 : defaultUrl[type]),
34
+ params: params
35
+ };
36
+ }
29
37
  var _url = (params === null || params === void 0 ? void 0 : params.url) || (defaultUrl === null || defaultUrl === void 0 ? void 0 : defaultUrl[type]);
30
38
  var _params = _objectSpread({}, params);
31
39
  delete _params.url;
@@ -6,6 +6,7 @@ declare class Tabs extends Component<any> {
6
6
  activeKey: any;
7
7
  };
8
8
  componentDidMount(): void;
9
+ componentDidUpdate(prevProps: Readonly<any>): void;
9
10
  private _handleChange;
10
11
  setActiveKey: (key: string) => void;
11
12
  getActiveKey: () => any;
@@ -100,6 +100,15 @@ var Tabs = /*#__PURE__*/function (_Component) {
100
100
  value: function componentDidMount() {
101
101
  document.body.id = 'body'; // 解决 antd tabs 样式问题
102
102
  }
103
+ }, {
104
+ key: "componentDidUpdate",
105
+ value: function componentDidUpdate(prevProps) {
106
+ if (prevProps.activeKey !== this.props.activeKey) {
107
+ this.setState({
108
+ activeKey: this.props.activeKey
109
+ });
110
+ }
111
+ }
103
112
  }, {
104
113
  key: "render",
105
114
  value: function render() {
@@ -1,19 +1,19 @@
1
1
  import React from 'react';
2
2
  import './index.less';
3
- declare global {
4
- namespace JSX {
5
- interface IntrinsicElements {
6
- [elemName: string]: any;
7
- }
8
- }
9
- }
10
3
  export interface WalletCardItem {
11
- key: string;
12
- label?: string;
13
- hidden?: boolean;
4
+ type: string;
5
+ custom_title?: string | {
6
+ original: string;
7
+ en: string;
8
+ 'zh-CN': string;
9
+ 'zh-HK': string;
10
+ };
11
+ display?: 0 | 1;
14
12
  value?: number;
15
13
  }
16
14
  export interface WalletCardProps {
15
+ /** 钱包ID */
16
+ id?: string;
17
17
  /** 二维码弹窗适配平台 */
18
18
  platform?: 'pc' | 'h5' | 'ipad';
19
19
  /** 卡片主题 */
@@ -21,7 +21,7 @@ export interface WalletCardProps {
21
21
  /** 默认还是完整显示code */
22
22
  cardStyle?: 'normal' | 'full';
23
23
  /** 条形码还是二维码 */
24
- codeType?: 'barCode' | 'orCode';
24
+ codeType?: 'barCode' | 'qrCode';
25
25
  /** 二维码方向 */
26
26
  codeDirection?: 'bottom' | 'top';
27
27
  /** 自定义背景图 */
@@ -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
+ }
@@ -1,4 +1,4 @@
1
1
  export declare const isBrowser: boolean;
2
- export declare const getCssNumber: (val: string | number) => string;
2
+ export declare const getCssNumber: (val: string | number) => string | number;
3
3
  export declare function uuid(): string;
4
4
  export * from './mergeWith';
@@ -1 +1 @@
1
- export declare const isMobile: () => boolean;
1
+ export declare const isMobile: () => any;
@@ -43,7 +43,7 @@ export declare const withDataSource: <P extends unknown>(WrappedComponent: React
43
43
  }) => JSX.Element;
44
44
  export declare const withOptions: <P extends unknown>(WrappedComponent: React.ComponentType<P>) => (props: P & {
45
45
  options?: any;
46
- optionSourceType?: "custom" | "default" | "api" | undefined;
46
+ optionSourceType?: "default" | "custom" | "api" | undefined;
47
47
  labelField: string;
48
48
  valueField: string;
49
49
  extraParams?: Record<string, any> | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  interface BaseFilterItem {
4
3
  name?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { FilterItemProps } from '../../../filter/types';
3
2
  import { DataSourceType, Field } from '../../provider/dataSource/DataSourceContext';
4
3
  export declare const genGetField: (dataSource?: DataSourceType) => (key: string) => Field;
@@ -1,5 +1,5 @@
1
1
  declare const useDataSourceKey: () => {
2
- dataSourceKey: string | undefined;
3
- dataSourceKeyRef: import("react").MutableRefObject<string | undefined>;
2
+ dataSourceKey: string | import("../../provider/dataSource/DataSourceContext").DataSourceType | undefined;
3
+ dataSourceKeyRef: import("react").MutableRefObject<string | import("../../provider/dataSource/DataSourceContext").DataSourceType | undefined>;
4
4
  };
5
5
  export default useDataSourceKey;