@pisell/materials 6.4.13 → 6.4.14

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 (74) hide show
  1. package/build/lowcode/index.js +1 -1
  2. package/build/lowcode/meta.js +1 -1
  3. package/build/lowcode/preview.js +9 -9
  4. package/build/lowcode/render/default/view.js +23 -23
  5. package/build/lowcode/view.js +24 -24
  6. package/es/components/cardPro/index.d.ts +4 -0
  7. package/es/components/cardPro/index.js +3 -10
  8. package/es/components/dataSourceComponents/dataSourceForm/utils.js +31 -5
  9. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +4 -1
  10. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +4 -2
  11. package/es/components/dataSourceComponents/fields/Input.Mobile/WithMode.d.ts +10 -3
  12. package/es/components/dataSourceComponents/fields/Input.Mobile/WithMode.js +70 -28
  13. package/es/components/dataSourceComponents/fields/Input.Mobile/serve.d.ts +2 -2
  14. package/es/components/dataSourceComponents/fields/Input.Mobile/serve.js +24 -2
  15. package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +8 -2
  16. package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.js +45 -13
  17. package/es/components/dataSourceComponents/fields/Input.Phone/serve.d.ts +3 -2
  18. package/es/components/dataSourceComponents/fields/Input.Phone/serve.js +76 -8
  19. package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
  20. package/es/components/dataSourceComponents/fields/index.d.ts +19 -19
  21. package/es/components/dataSourceComponents/hooks/usePlatform.d.ts +3 -1
  22. package/es/components/dataSourceComponents/hooks/usePlatform.js +9 -1
  23. package/es/components/drag-sort-tree/TreeItem/index.d.ts +1 -0
  24. package/es/components/filter/types.d.ts +2 -1
  25. package/es/components/iconfont/index.d.ts +8 -0
  26. package/es/components/iconfont/index.js +1 -1
  27. package/es/components/table/Actions/index.d.ts +1 -0
  28. package/es/components/table/Actions/index.js +4 -1
  29. package/es/components/table/Table/fields/index.d.ts +2 -2
  30. package/es/components/table/Table/utils.d.ts +1 -1
  31. package/es/components/table/hooks/useTableSetting.js +2 -2
  32. package/es/components/virtual-keyboard/Amount/index.d.ts +1 -0
  33. package/es/locales/en-US.d.ts +297 -0
  34. package/es/locales/en-US.js +1 -16
  35. package/es/locales/zh-CN.d.ts +292 -0
  36. package/es/locales/zh-CN.js +1 -16
  37. package/es/locales/zh-TW.d.ts +292 -0
  38. package/es/locales/zh-TW.js +1 -16
  39. package/lib/components/cardPro/index.d.ts +4 -0
  40. package/lib/components/cardPro/index.js +2 -3
  41. package/lib/components/dataSourceComponents/dataSourceForm/utils.js +26 -2
  42. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +4 -1
  43. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +4 -2
  44. package/lib/components/dataSourceComponents/fields/Input.Mobile/WithMode.d.ts +10 -3
  45. package/lib/components/dataSourceComponents/fields/Input.Mobile/WithMode.js +67 -18
  46. package/lib/components/dataSourceComponents/fields/Input.Mobile/serve.d.ts +2 -2
  47. package/lib/components/dataSourceComponents/fields/Input.Mobile/serve.js +29 -7
  48. package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +8 -2
  49. package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.js +41 -9
  50. package/lib/components/dataSourceComponents/fields/Input.Phone/serve.d.ts +3 -2
  51. package/lib/components/dataSourceComponents/fields/Input.Phone/serve.js +53 -11
  52. package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
  53. package/lib/components/dataSourceComponents/fields/index.d.ts +19 -19
  54. package/lib/components/dataSourceComponents/hooks/usePlatform.d.ts +3 -1
  55. package/lib/components/dataSourceComponents/hooks/usePlatform.js +12 -0
  56. package/lib/components/drag-sort-tree/TreeItem/index.d.ts +1 -0
  57. package/lib/components/filter/types.d.ts +2 -1
  58. package/lib/components/iconfont/index.d.ts +8 -0
  59. package/lib/components/iconfont/index.js +1 -1
  60. package/lib/components/table/Actions/index.d.ts +1 -0
  61. package/lib/components/table/Actions/index.js +4 -1
  62. package/lib/components/table/Table/fields/index.d.ts +2 -2
  63. package/lib/components/table/Table/utils.d.ts +1 -1
  64. package/lib/components/table/hooks/useTableSetting.js +2 -2
  65. package/lib/components/virtual-keyboard/Amount/index.d.ts +1 -0
  66. package/lib/locales/en-US.d.ts +297 -0
  67. package/lib/locales/en-US.js +1 -12
  68. package/lib/locales/zh-CN.d.ts +292 -0
  69. package/lib/locales/zh-CN.js +1 -12
  70. package/lib/locales/zh-TW.d.ts +292 -0
  71. package/lib/locales/zh-TW.js +1 -12
  72. package/lowcode/form-item-input.mobile/meta.ts +22 -0
  73. package/lowcode/form-item-input.phone/meta.ts +22 -0
  74. package/package.json +1 -1
@@ -0,0 +1,292 @@
1
+ declare const _default: {
2
+ 'table-filter-search': string;
3
+ 'table-filter-clear': string;
4
+ 'table-filter-filter': string;
5
+ 'table-filter-min': string;
6
+ 'table-filter-max': string;
7
+ 'table-pagination-previous': string;
8
+ 'table-pagination-next': string;
9
+ 'table-pagination-total': (current: string, total: string) => string;
10
+ 'select-dropdown-render-select-all': string;
11
+ 'select-dropdown-render-search': string;
12
+ 'sort-button-text': string;
13
+ 'sort-oldest-to-newest': string;
14
+ 'sort-newest-to-oldest': string;
15
+ 'sort-a-z': string;
16
+ 'sort-z-a': string;
17
+ 'sort-from-morning-to-night': string;
18
+ 'sort-from-evening-to-morning': string;
19
+ 'sort-0-9': string;
20
+ 'sort-9-0': string;
21
+ 'table-action-filter-button': string;
22
+ 'table-action-filter-quick-filter': string;
23
+ 'table-action-filter-quick-filter-tip': (count: number) => string;
24
+ 'table-action-filter-other-filter': string;
25
+ 'table-action-filter-other-filter-tip': () => string;
26
+ 'table-action-group-by-title': string;
27
+ 'table-action-group-by-title-tip': string;
28
+ 'table-action-column-title': string;
29
+ 'table-column-group-records': string;
30
+ 'table-column-group-lock-tip': string;
31
+ 'table-column-drag-sort-disabled-tip': string;
32
+ 'table-action-filter-no-filter': string;
33
+ 'table-action-range-picker-presets-today': string;
34
+ 'table-action-range-picker-presets-yesterday': string;
35
+ 'table-action-range-picker-presets-last-3-day': string;
36
+ 'table-action-range-picker-presets-last-7-day': string;
37
+ 'table-action-range-picker-presets-last-14-day': string;
38
+ 'table-action-range-picker-presets-last-30-day': string;
39
+ 'table-action-range-picker-presets-last-90-day': string;
40
+ 'virtual-keyboard-time-now': string;
41
+ 'virtual-keyboard-time-ok': string;
42
+ 'batch-editor-batch-edit': string;
43
+ 'batch-editor-actions': string;
44
+ 'batch-editor-remove': string;
45
+ 'batch-editor-price': string;
46
+ 'batch-editor-cancel': string;
47
+ 'batch-editor-search': string;
48
+ 'batch-editor-confirm': string;
49
+ 'batch-editor-batch-remove': string;
50
+ 'batch-editor-what-price': string;
51
+ 'batch-editor-quick-edit': string;
52
+ 'batch-editor-quick-edit-title': (product: string, num: string) => string;
53
+ 'batch-editor-quick-edit-title-2': (product: string) => string;
54
+ 'table-action-export-import-export-success': string;
55
+ 'table-action-export-import-button': string;
56
+ 'table-action-export-import-export-range': string;
57
+ 'table-action-export-import-current-page': string;
58
+ 'table-action-export-import-all-records': string;
59
+ 'table-action-export-import-selected-records': string;
60
+ 'table-action-export-import-selected': string;
61
+ 'table-action-export-import-item': (length: number) => string;
62
+ 'table-action-export-import-product': string;
63
+ 'table-action-export-import-table-text-input-title': string;
64
+ 'table-action-export-import-table-text-input-describe': string;
65
+ 'table-action-export-import-table-error-file': string;
66
+ 'table-action-export-import-import-success': string;
67
+ 'table-action-export-import-import-phone': string;
68
+ 'table-action-export-import-table-success-download': string;
69
+ 'table-action-export-import-table-textimport-product': string;
70
+ 'table-action-export-import-table-text-product-template': string;
71
+ 'table-action-export-import-table-text-click-download': string;
72
+ 'table-action-export-import-table-text-edit-file': string;
73
+ 'table-action-export-import-button-import': string;
74
+ 'table-action-export-import-cancel': string;
75
+ 'table-action-export-import-file-completed': string;
76
+ 'table-action-export-import-file-processing': string;
77
+ 'table-action-export-import-file-pending': string;
78
+ 'table-action-export-import-file-refresh': string;
79
+ 'table-action-export-import-export-title': string;
80
+ 'table-action-export-import-file-hint': string;
81
+ 'table-action-export-import-file-name': string;
82
+ 'table-action-export-import-file-content': string;
83
+ 'table-action-export-import-file-content-all': string;
84
+ 'table-action-export-import-file-content-part': string;
85
+ 'table-action-export-import-file-status': string;
86
+ 'table-action-export-import-file-account': string;
87
+ 'table-action-export-import-file-created': string;
88
+ 'table-action-export-import-file-record': (length: number) => string;
89
+ 'table-action-export-import-import-title': string;
90
+ 'table-action-export-import-log-hint': string;
91
+ 'table-action-export-import-log-name': string;
92
+ 'table-action-export-import-log-result': string;
93
+ 'table-action-export-import-log-ok': (num: number) => string;
94
+ 'table-action-export-import-log-err': (num: number) => string;
95
+ 'table-action-export-import-log-check': string;
96
+ 'table-action-export-import-log-detail-title': string;
97
+ 'table-action-export-import-log-err-log': string;
98
+ 'table-action-export-import-log-copy': string;
99
+ 'table-action-export-import-table-success-copy': string;
100
+ 'drag-sort-tree-unavailable-today-tip': string;
101
+ 'date-picker-today': string;
102
+ 'date-picker-yesterday': string;
103
+ 'date-picker-tomorrow': string;
104
+ 'date-picker-next_monday': string;
105
+ 'date-picker-last_friday': string;
106
+ 'date-picker-first_day_of_this_month': string;
107
+ 'date-picker-last_day_of_this_month': string;
108
+ 'date-picker-first_day_of_next_month': string;
109
+ 'date-picker-last_day_of_last_month': string;
110
+ 'date-picker-invalid-date': string;
111
+ 'date-picker-apply': string;
112
+ 'date-picker-shortcut-custom': string;
113
+ 'pisell-input-copy-success': string;
114
+ 'pisell-input-copy': string;
115
+ 'pisell-empty-description-no-data': string;
116
+ 'pisell-information-entry-input-search': string;
117
+ 'pisell-information-entry-input-confirm': string;
118
+ 'pisell-information-entry-scan-exit': string;
119
+ 'pisell-wallet-pass-card-detail': string;
120
+ 'pisell-wallet-pass-card-edit': string;
121
+ 'pisell-wallet-pass-card-name': string;
122
+ 'pisell-wallet-pass-card-store-name': string;
123
+ 'pisell-wallet-pass-card-balance': string;
124
+ 'pisell-wallet-pass-card-redeem': string;
125
+ 'pisell-wallet-pass-card-code': string;
126
+ 'pisell-wallet-pass-card-valid-to': string;
127
+ 'pisell-wallet-pass-card-confirm': string;
128
+ 'pisell-wallet-pass-card-cancel': string;
129
+ 'pisell-wallet-pass-card-required': string;
130
+ 'pisell-wallet-pass-card-expireDate': string;
131
+ 'pisell-adjust-price-price-override': string;
132
+ 'pisell-adjust-price-discount': string;
133
+ 'pisell-adjust-price-discount-amount': string;
134
+ 'pisell-adjust-price-discount-percentage': string;
135
+ 'pisell-adjust-price-total-after-discount': string;
136
+ 'pisell-adjust-price-discount-can-be-maximum': string;
137
+ 'pisell-discount-card-title': string;
138
+ 'pisell-discount-card-unit': string;
139
+ 'pisell-discount-card-fixed-amount-prefix': string;
140
+ 'pisell-data-source-table-add': string;
141
+ 'pisell-data-source-table-edit': string;
142
+ 'pisell-data-source-table-detail': string;
143
+ 'pisell-data-source-table-delete': string;
144
+ 'pisell-record-view-available': string;
145
+ 'pisell-record-view-unavailable': string;
146
+ 'pisell-data-source-form-required-message': string;
147
+ 'pisell-data-source-form-email-message': string;
148
+ 'pisell-data-source-form-domain-message': string;
149
+ 'pisell-data-source-form-url-message': string;
150
+ 'pisell-data-source-form-phone-message': string;
151
+ 'pisell-data-source-form-min-length-message': (minLength: number) => string;
152
+ 'pisell-data-source-form-max-length-message': (maxLength: number) => string;
153
+ 'pisell-data-source-form-min-value-message': (minValue: number) => string;
154
+ 'pisell-data-source-form-max-value-message': (maxValue: number) => string;
155
+ 'pisell-data-source-form-mobile-message': string;
156
+ 'pisell-number-format-thousand': string;
157
+ 'pisell-number-format-million': string;
158
+ 'pisell-number-format-billion': string;
159
+ 'walletCard-done': string;
160
+ 'walletCard-qrcode': string;
161
+ 'walletCard-barcode': string;
162
+ 'walletCard-viewPin': string;
163
+ 'pisell-upload-button': string;
164
+ 'pisell-upload-setting-size-error': (maxSize: number) => string;
165
+ 'pisell-upload-setting-type-error': (type: string) => string;
166
+ 'pisell-upload-count-error': (count: number) => string;
167
+ 'pisell-upload-error': (name: string) => string;
168
+ 'pisell-upload-multilingual-title': string;
169
+ 'pisell-upload-multilingual-item-title-original': string;
170
+ 'pisell-upload-multilingual-item-title-en': string;
171
+ 'pisell-upload-multilingual-item-title-zh-CN': string;
172
+ 'pisell-upload-multilingual-item-title-zh-HK': string;
173
+ 'pisell-color-picker-default': string;
174
+ 'pisell-action-get-data': string;
175
+ 'pisell-action-delete-success': string;
176
+ 'pisell-action-delete-failed': string;
177
+ 'walletCard-piont': string;
178
+ 'walletCard-rechargeable': string;
179
+ 'walletCard-voucher': string;
180
+ 'walletCard-discount': string;
181
+ 'pisellQrcode-done': string;
182
+ 'pisellQrcode-qrcode': string;
183
+ 'pisell-delete-confirm-title': string;
184
+ 'pisell-delete-confirm-content': string;
185
+ 'pisell-delete-confirm-ok': string;
186
+ 'pisell-delete-confirm-cancel': string;
187
+ 'pisell-design-mode-action-disabled': string;
188
+ 'pisell-translation-original': string;
189
+ 'pisell-version-modal-title': string;
190
+ 'pisell-version-modal-current-version': string;
191
+ 'pisell-version-modal-version': string;
192
+ 'pisell-version-modal-update-notes': string;
193
+ 'pisell-version-modal-patch': string;
194
+ 'pisell-version-modal-minor': string;
195
+ 'pisell-version-modal-major': string;
196
+ 'pisell-version-modal-custom': string;
197
+ 'pisell-version-modal-cancel': string;
198
+ 'pisell-version-modal-confirm': string;
199
+ 'pisell-version-modal-describe-update-notes': string;
200
+ 'pisell-version-modal-version-error': string;
201
+ 'pisell-version-modal-version-required': string;
202
+ 'pisell-version-modal-based-on-version': string;
203
+ 'subdomain-error-too-short': string;
204
+ 'subdomain-error-too-long': string;
205
+ 'subdomain-error-pattern': string;
206
+ 'subdomain-error-numbers-only': string;
207
+ 'subdomain-error-hyphen-ends': string;
208
+ 'subdomain-error-consecutive-hyphens': string;
209
+ 'pisell-icon-select-placeholder': string;
210
+ 'pisell-icon-select-outlined': string;
211
+ 'pisell-icon-select-filled': string;
212
+ 'pisell-icon-select-two-tone': string;
213
+ 'pisell-icon-select-iconfont': string;
214
+ 'pisell-icon-select-search': string;
215
+ 'pisell-icon-select-select': string;
216
+ 'pisell-lowcode-app-version-control-live': string;
217
+ 'pisell-lowcode-app-version-control-draft': string;
218
+ 'pisell-lowcode-app-version-control-deprecated': string;
219
+ 'pisell-lowcode-app-version-control-new-version': string;
220
+ 'pisell-lowcode-app-version-control-promote-to-live': string;
221
+ 'pisell-lowcode-app-version-control-promote-version': (version: string) => string;
222
+ 'pisell-lowcode-app-version-control-promote-version-describe': string;
223
+ 'pisell-lowcode-app-version-control-promote-version-ok': string;
224
+ 'pisell-lowcode-app-version-control-promote-version-cancel': string;
225
+ 'pisell-lowcode-app-version-control-version-exists': string;
226
+ 'pisell-lowcode-drop-sort-add': string;
227
+ 'pisell-lowcode-navigation-menu-add-sub-menu': string;
228
+ 'pisell-lowcode-navigation-menu-add-page': string;
229
+ 'pisell-lowcode-navigation-menu-add-page-tip': string;
230
+ 'pisell-lowcode-navigation-menu-tag-base': string;
231
+ 'pisell-lowcode-navigation-menu-tag-proCode': string;
232
+ 'pisell-lowcode-navigation-menu-tag-pisell1': string;
233
+ 'pisell-lowcode-navigation-menu-tag-group': string;
234
+ 'pisell-lowcode-navigation-menu-tag-sub-menu': string;
235
+ 'pisell-lowcode-navigation-menu-tag-custom': string;
236
+ 'pisell-data-source-form-app-identifier-pattern': string;
237
+ 'pisell-data-source-form-app-identifier-start-with-letter': string;
238
+ 'pisell-data-source-form-app-identifier-special-ends': string;
239
+ 'pisell-data-source-form-app-identifier-consecutive-special': string;
240
+ 'qrscanner-loading': string;
241
+ 'qrscanner-success': string;
242
+ 'qrscanner-success-qrcode': string;
243
+ 'qrscanner-success-barcode': string;
244
+ 'qrscanner-error-upload-image': string;
245
+ 'qrscanner-error-load-failed': string;
246
+ 'qrscanner-error-no-code': string;
247
+ 'qrscanner-error-camera-init': string;
248
+ 'qrscanner-error-process-image': string;
249
+ 'pisell-login-and-register-title': string;
250
+ 'pisell-login-and-register-subtitle': string;
251
+ 'pisell-login-and-register-email-label': string;
252
+ 'pisell-login-and-register-email-placeholder': string;
253
+ 'pisell-login-and-register-password-label': string;
254
+ 'pisell-login-and-register-password-placeholder': string;
255
+ 'pisell-login-and-register-email-error': string;
256
+ 'pisell-login-and-register-email-error-valid': string;
257
+ 'pisell-login-and-register-password-error': string;
258
+ 'pisell-login-and-register-login': string;
259
+ 'pisell-login-and-register-google': string;
260
+ 'pisell-login-and-register-facebook': string;
261
+ 'pisell-login-and-register-apple': string;
262
+ 'pisell-login-and-register-sign-up': string;
263
+ 'pisell-login-and-register-login-tab': string;
264
+ 'pisell-login-and-register-register-tab': string;
265
+ 'pisell-login-and-register-register-email-placeholder': string;
266
+ 'pisell-login-and-register-register-password-placeholder': string;
267
+ 'pisell-login-and-register-register-button-text': string;
268
+ 'pisell-login-and-register-remember-me': string;
269
+ 'pisell-login-and-register-forgot-password': string;
270
+ 'pisell2.text.goodpass.product-vouchers': string;
271
+ 'pisell2.text.goodpass.last-settlement': string;
272
+ 'pisell2.text.goodpass.view-more': string;
273
+ 'pisell2.text.goodpass.save': string;
274
+ 'pisell-wallet-pass-card-status-used': string;
275
+ 'pisell-wallet-pass-card-status-expired': string;
276
+ 'pisell-wallet-pass-card-status-disabled': string;
277
+ 'pisell-wallet-pass-card-status-conflict': string;
278
+ 'pisell-wallet-pass-card-status-lastPayment': string;
279
+ 'pisell-wallet-pass-card-reset': string;
280
+ 'pisell-wallet-pass-card-done': string;
281
+ 'pisell-camera-no-camera-accessible': string;
282
+ 'pisell-camera-permission-denied': string;
283
+ 'pisell-camera-switch-camera': string;
284
+ 'pisell-camera-canvas': string;
285
+ 'pisell-camera-checking': string;
286
+ 'pisell-camera-no-camera-desc': string;
287
+ 'pisell-upload-camera-local-files': string;
288
+ 'pisell-upload-camera-capture': string;
289
+ 'pisell-upload-camera-retake': string;
290
+ 'pisell-upload-camera-use': string;
291
+ };
292
+ export default _default;
@@ -352,20 +352,5 @@ export default {
352
352
  'pisell-upload-camera-local-files': '本地文件',
353
353
  'pisell-upload-camera-capture': '拍攝/拍照',
354
354
  'pisell-upload-camera-retake': '重拍',
355
- 'pisell-upload-camera-use': '使用照片',
356
- // 列表組件
357
- 'pisell-list-tab-group-default': '字段',
358
- 'pisell-list-empty-text-default': '暫無數據',
359
- 'pisell-list-load-more': '查看更多',
360
- 'pisell-list-view-less': '查看更少',
361
- 'pisell-list-pagination-total': function pisellListPaginationTotal(start, end, total) {
362
- return "\u986F\u793A\u7B2C ".concat(start, "-").concat(end, " \u689D\uFF0C\u5171 ").concat(total, " \u689D");
363
- },
364
- 'pisell-list-scroll-down': '向下滾動',
365
- 'pisell-list-scroll-right': '向右滾動',
366
- 'pisell-list-pagination-page-of': function pisellListPaginationPageOf(current, total) {
367
- return "\u7B2C ".concat(current, " \u9801 \u5171 ").concat(total, " \u9801");
368
- },
369
- 'pisell-list-pagination-previous': '上一頁',
370
- 'pisell-list-pagination-next': '下一頁'
355
+ 'pisell-upload-camera-use': '使用照片'
371
356
  };
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import './index.less';
3
+ declare const _default: (props: any) => JSX.Element;
4
+ export default _default;
@@ -51,14 +51,13 @@ var CardPro = (props) => {
51
51
  isShowHead,
52
52
  className,
53
53
  coverHeight,
54
- badge,
55
- style
54
+ badge
56
55
  } = props;
57
56
  return /* @__PURE__ */ import_react.default.createElement(
58
57
  import_antd.Card,
59
58
  {
60
59
  title: null,
61
- style: { padding: 0, ...style },
60
+ style: { padding: 0 },
62
61
  className: (0, import_classnames.default)(
63
62
  "pisell-cardPro-wrap",
64
63
  className,
@@ -186,8 +186,26 @@ var withFormItem = (WrappedComponent, overlayProps) => {
186
186
  break;
187
187
  case "phone":
188
188
  rules.push({
189
- validator: (_, value) => {
189
+ validator: (_, originValue) => {
190
+ var _a2;
191
+ let value = "";
192
+ if ((0, import_utils.isString)(originValue)) {
193
+ value = originValue;
194
+ } else if (originValue && "phone" in originValue) {
195
+ value = `${(originValue == null ? void 0 : originValue.countryCallingCode) || ""}${originValue.phone || ""}`;
196
+ }
190
197
  if (!(value == null ? void 0 : value.trim())) {
198
+ if ((requiredobj == null ? void 0 : requiredobj.required) === false) {
199
+ return Promise.resolve();
200
+ } else if (typeof originValue == "object") {
201
+ return Promise.reject(
202
+ new Error(
203
+ requiredobj.message || (0, import_locales.getText)("pisell-data-source-form-required-message")
204
+ )
205
+ );
206
+ }
207
+ }
208
+ if (typeof originValue !== "string" && (requiredobj == null ? void 0 : requiredobj.required) === false && ((_a2 = originValue == null ? void 0 : originValue.phone) == null ? void 0 : _a2.trim()) === "") {
191
209
  return Promise.resolve();
192
210
  }
193
211
  try {
@@ -213,7 +231,13 @@ var withFormItem = (WrappedComponent, overlayProps) => {
213
231
  break;
214
232
  case "mobile":
215
233
  rules.push({
216
- validator: (_, value) => {
234
+ validator: (_, originValue) => {
235
+ let value = "";
236
+ if ((0, import_utils.isString)(originValue)) {
237
+ value = originValue;
238
+ } else if (originValue && "phone" in originValue) {
239
+ value = `${(originValue == null ? void 0 : originValue.countryCallingCode) || ""}${originValue.phone || ""}`;
240
+ }
217
241
  if (!(value == null ? void 0 : value.trim())) {
218
242
  return Promise.resolve();
219
243
  }
@@ -30,7 +30,10 @@ declare const useTableProps: (props: UseTablePropsProps) => {
30
30
  columns: import("./useColumns").Column[];
31
31
  subTitle: number | boolean | React.ReactFragment | JSX.Element | (() => React.ReactNode) | null | undefined;
32
32
  buttons: any[] | null;
33
- filter: any;
33
+ filter: {
34
+ dom: any;
35
+ items: any;
36
+ } | null;
34
37
  onRow: (record: any) => any;
35
38
  actionButtons: any[] | null;
36
39
  __id?: string | undefined;
@@ -280,8 +280,10 @@ var useTableProps = (props) => {
280
280
  getInitialValues
281
281
  }
282
282
  );
283
- dom.__proto__.__items = propsFilter == null ? void 0 : propsFilter.items;
284
- return dom;
283
+ return {
284
+ dom,
285
+ items: propsFilter == null ? void 0 : propsFilter.items
286
+ };
285
287
  }, [propsFilter, search]);
286
288
  const onRow = (0, import_ahooks.useMemoizedFn)((record) => {
287
289
  if (!(clickToDetail == null ? void 0 : clickToDetail.show)) {
@@ -1,10 +1,17 @@
1
1
  import React from 'react';
2
2
  import { InputProps } from 'antd';
3
- import { ModeType } from "../../dataSourceForm/type";
3
+ import { ModeType } from '../../dataSourceForm/type';
4
+ declare type PhoneValue = string | {
5
+ phone: string;
6
+ countryCallingCode: string;
7
+ countryCode?: string;
8
+ };
4
9
  export interface PhoneInputProps extends Omit<InputProps, 'value' | 'onChange'> {
5
10
  renderMode: ModeType;
6
- value?: string;
7
- onChange?: (value: string) => void;
11
+ value?: PhoneValue;
12
+ onChange?: (value: PhoneValue) => void;
13
+ returnFormat?: 'string' | 'object';
14
+ inputRef?: any;
8
15
  }
9
16
  declare const MobileNumberInputWithMode: React.FC<PhoneInputProps & import("../../dataSourceForm/utils").WithModeProps>;
10
17
  export default MobileNumberInputWithMode;
@@ -36,12 +36,20 @@ var import_react = __toESM(require("react"));
36
36
  var import_antd = require("antd");
37
37
  var import_utils = require("@pisell/utils");
38
38
  var import_select = __toESM(require("../../../select"));
39
- var import_serve = require("./serve");
39
+ var import_serve = require("./../Input.Phone/serve");
40
40
  var import_ReadPretty = __toESM(require("./ReadPretty"));
41
41
  var import_utils2 = require("../../dataSourceForm/utils");
42
42
  var import_useTranslationOriginal = __toESM(require("../../../../hooks/useTranslationOriginal"));
43
+ var import_useSetRequest = __toESM(require("../../../../hooks/useSetRequest"));
43
44
  var { Option } = import_select.default;
44
- var MobileNumberInput = ({ value: propsValue, onChange, disabled, ...props }) => {
45
+ var MobileNumberInput = ({
46
+ value: propsValue,
47
+ onChange,
48
+ disabled,
49
+ returnFormat = "string",
50
+ ...props
51
+ }) => {
52
+ (0, import_useSetRequest.default)();
45
53
  const { data: countries = [] } = (0, import_serve.useCountries)();
46
54
  const translationOriginal = (0, import_useTranslationOriginal.default)();
47
55
  const value = (0, import_react.useMemo)(() => {
@@ -50,20 +58,46 @@ var MobileNumberInput = ({ value: propsValue, onChange, disabled, ...props }) =>
50
58
  }
51
59
  return propsValue;
52
60
  }, [propsValue]);
61
+ const handleChange = (prefix, phoneNumber2, countryCode2) => {
62
+ if (returnFormat === "string") {
63
+ const newValue = phoneNumber2 ? `${prefix}${phoneNumber2}` : "";
64
+ onChange == null ? void 0 : onChange(newValue);
65
+ } else {
66
+ onChange == null ? void 0 : onChange({
67
+ phone: phoneNumber2,
68
+ countryCallingCode: prefix,
69
+ countryCode: countryCode2
70
+ });
71
+ }
72
+ };
53
73
  const parseExternalValue = (val) => {
54
74
  if (!val) return { countryCode: "AU", phoneNumber: "" };
55
- const matchedPrefix = countries.find(
56
- (country) => val.startsWith(country.prefix)
57
- );
58
- if (matchedPrefix) {
75
+ let srtValue = "";
76
+ if ((0, import_utils.isString)(val)) {
77
+ srtValue = val;
78
+ } else if ("phone" in val) {
79
+ srtValue = `${val.countryCallingCode || ""}${val.phone || ""}`;
80
+ }
81
+ let matchedContry = null;
82
+ if (!(0, import_utils.isString)(val) && (val == null ? void 0 : val.countryCode)) {
83
+ matchedContry = countries.find(
84
+ (country) => (country == null ? void 0 : country.code) === (val == null ? void 0 : val.countryCode)
85
+ );
86
+ }
87
+ if (!matchedContry) {
88
+ matchedContry = countries.find(
89
+ (country) => srtValue.startsWith(country.prefix)
90
+ );
91
+ }
92
+ if (matchedContry) {
59
93
  return {
60
- countryCode: matchedPrefix.code,
61
- phoneNumber: val.slice(matchedPrefix.prefix.length)
94
+ countryCode: matchedContry.code,
95
+ phoneNumber: srtValue.slice(matchedContry.prefix.length)
62
96
  };
63
97
  }
64
98
  return {
65
99
  countryCode: "AU",
66
- phoneNumber: val.replace(/\D/g, "")
100
+ phoneNumber: srtValue.replace(/\D/g, "")
67
101
  };
68
102
  };
69
103
  const [countryCode, setCountryCode] = (0, import_react.useState)(
@@ -83,12 +117,9 @@ var MobileNumberInput = ({ value: propsValue, onChange, disabled, ...props }) =>
83
117
  }, [value, countries]);
84
118
  const handleCountryChange = (value2) => {
85
119
  setCountryCode(value2);
86
- const selectedCountry = countries.find(
87
- (c) => c.code === value2
88
- );
120
+ const selectedCountry = countries.find((c) => c.code === value2);
89
121
  const prefix = (selectedCountry == null ? void 0 : selectedCountry.prefix) || "";
90
- const newValue = `${prefix}${phoneNumber}`;
91
- onChange == null ? void 0 : onChange(newValue);
122
+ handleChange(prefix, phoneNumber, selectedCountry == null ? void 0 : selectedCountry.code);
92
123
  setTimeout(() => {
93
124
  const formInstance = props.form;
94
125
  const fieldName = props.fieldKey;
@@ -104,8 +135,7 @@ var MobileNumberInput = ({ value: propsValue, onChange, disabled, ...props }) =>
104
135
  (c) => c.code === countryCode
105
136
  );
106
137
  const prefix = (selectedCountry == null ? void 0 : selectedCountry.prefix) || "";
107
- const newValue = cleanNumber ? `${prefix}${cleanNumber}` : "";
108
- onChange == null ? void 0 : onChange(newValue);
138
+ handleChange(prefix, cleanNumber, selectedCountry == null ? void 0 : selectedCountry.code);
109
139
  if (!cleanNumber) {
110
140
  const formInstance = props.form;
111
141
  const fieldName = props.fieldKey;
@@ -132,9 +162,24 @@ var MobileNumberInput = ({ value: propsValue, onChange, disabled, ...props }) =>
132
162
  const prefix = (selectedCountry == null ? void 0 : selectedCountry.prefix) || "";
133
163
  return `${prefix}${phoneNumber}`;
134
164
  }, [countryCode, phoneNumber, countries]);
165
+ const objValue = (0, import_react.useMemo)(() => {
166
+ const selectedCountry = countries.find(
167
+ (c) => c.code === countryCode
168
+ );
169
+ const prefix = (selectedCountry == null ? void 0 : selectedCountry.prefix) || "";
170
+ return {
171
+ phone: phoneNumber || "",
172
+ countryCallingCode: prefix,
173
+ countryCode
174
+ };
175
+ }, [countryCode, phoneNumber, countries]);
135
176
  const handleBlur = () => {
136
177
  const finalValue = concatenatedNumber;
137
- onChange == null ? void 0 : onChange(finalValue);
178
+ if (returnFormat === "string") {
179
+ onChange == null ? void 0 : onChange(finalValue);
180
+ } else {
181
+ onChange == null ? void 0 : onChange(objValue);
182
+ }
138
183
  };
139
184
  return /* @__PURE__ */ import_react.default.createElement(import_antd.Space.Compact, { block: true }, /* @__PURE__ */ import_react.default.createElement(
140
185
  import_select.default,
@@ -157,6 +202,7 @@ var MobileNumberInput = ({ value: propsValue, onChange, disabled, ...props }) =>
157
202
  import_antd.Input,
158
203
  {
159
204
  ...props,
205
+ ref: props == null ? void 0 : props.inputRef,
160
206
  disabled,
161
207
  type: "tel",
162
208
  value: phoneNumber,
@@ -166,5 +212,8 @@ var MobileNumberInput = ({ value: propsValue, onChange, disabled, ...props }) =>
166
212
  }
167
213
  ));
168
214
  };
169
- var MobileNumberInputWithMode = (0, import_utils2.withMode)(MobileNumberInput, import_ReadPretty.default);
215
+ var MobileNumberInputWithMode = (0, import_utils2.withMode)(
216
+ MobileNumberInput,
217
+ import_ReadPretty.default
218
+ );
170
219
  var WithMode_default = MobileNumberInputWithMode;
@@ -6,8 +6,8 @@ export interface Country {
6
6
  id: number;
7
7
  name: {
8
8
  en: string;
9
- "zh-CN": string;
10
- "zh-HK": string;
9
+ 'zh-CN': string;
10
+ 'zh-HK': string;
11
11
  original: string;
12
12
  };
13
13
  code: string;
@@ -39,13 +39,17 @@ var import_utils = require("../../../table/utils");
39
39
  var import_usePlatform = require("../../hooks/usePlatform");
40
40
  var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
41
41
  var getCountryDataList = async () => {
42
- const { data } = await import_utils.request.getRequest().get(`/country:list`, {}, {
43
- isNocobase: true,
44
- fullResult: true,
45
- headers: {
46
- "x-data-source": "pisell2"
42
+ const { data } = await import_utils.request.getRequest().get(
43
+ `/country:list`,
44
+ {},
45
+ {
46
+ isNocobase: true,
47
+ fullResult: true,
48
+ headers: {
49
+ "x-data-source": "pisell2"
50
+ }
47
51
  }
48
- });
52
+ );
49
53
  return data.map((item) => ({
50
54
  ...item,
51
55
  prefix: `+${item.calling_code}`
@@ -53,6 +57,8 @@ var getCountryDataList = async () => {
53
57
  };
54
58
  var useCountries = () => {
55
59
  const isShop = (0, import_usePlatform.useIsShop)();
60
+ const isH5 = (0, import_usePlatform.useIsH5)();
61
+ const isPc = (0, import_usePlatform.useIsPc)();
56
62
  const { appHelper } = (0, import_useEngineContext.default)();
57
63
  const { data, run } = (0, import_ahooks.useRequest)(getCountryDataList, {
58
64
  cacheKey: "phone-countries",
@@ -68,7 +74,7 @@ var useCountries = () => {
68
74
  }
69
75
  }, [isShop]);
70
76
  const currentData = (0, import_react.useMemo)(() => {
71
- var _a, _b, _c, _d;
77
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
72
78
  if (isShop) {
73
79
  const codeList = (_d = (_c = (_b = (_a = appHelper == null ? void 0 : appHelper.utils) == null ? void 0 : _a.store) == null ? void 0 : _b.getState()) == null ? void 0 : _c.global) == null ? void 0 : _d.codeList;
74
80
  if (codeList) {
@@ -77,6 +83,22 @@ var useCountries = () => {
77
83
  prefix: `+${item.calling_code}`
78
84
  }));
79
85
  }
86
+ } else if (isPc) {
87
+ const codeList = (_h = (_g = (_f = (_e = appHelper == null ? void 0 : appHelper.utils) == null ? void 0 : _e.store) == null ? void 0 : _f.getState()) == null ? void 0 : _g.country) == null ? void 0 : _h.country;
88
+ if (codeList) {
89
+ return codeList.map((item) => ({
90
+ ...item,
91
+ prefix: `+${item.calling_code}`
92
+ }));
93
+ }
94
+ } else if (isH5) {
95
+ const codeList = (_l = (_k = (_j = (_i = appHelper == null ? void 0 : appHelper.utils) == null ? void 0 : _i.getStore()) == null ? void 0 : _j.getState()) == null ? void 0 : _k.country) == null ? void 0 : _l.country;
96
+ if (codeList) {
97
+ return codeList.map((item) => ({
98
+ ...item,
99
+ prefix: `+${item.calling_code}`
100
+ }));
101
+ }
80
102
  }
81
103
  return data;
82
104
  }, [isShop, data]);