@pisell/materials 2.2.108 → 2.2.110

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 (276) 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 +7 -7
  6. package/build/lowcode/preview.js +164 -148
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +53 -23
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +58 -28
  11. package/es/components/appVersionControl/index.d.ts +4 -0
  12. package/es/components/auto-resize-text/auto-text-size-standalone.d.ts +20 -0
  13. package/es/components/auto-resize-text/auto-text-size-standalone.js +258 -0
  14. package/es/components/auto-resize-text/index.d.ts +6 -0
  15. package/es/components/auto-resize-text/index.js +40 -0
  16. package/es/components/cardPro/index.d.ts +3 -0
  17. package/es/components/cardPro/index.js +10 -3
  18. package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +56 -0
  19. package/es/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.d.ts +1 -0
  20. package/es/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +1 -0
  21. package/es/components/dataSourceComponents/dataSourceTable/BaseTable.js +11 -4
  22. package/es/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +1 -0
  23. package/es/components/dataSourceComponents/dataSourceTable/filter/index.js +7 -2
  24. package/es/components/dataSourceComponents/dataSourceTable/filter/utils.d.ts +0 -1
  25. package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +38 -0
  26. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +100 -0
  27. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +35 -15
  28. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +2 -1
  29. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +92 -6
  30. package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +84 -0
  31. package/es/components/dataSourceComponents/fields/Input.Mobile/WithMode.d.ts +10 -0
  32. package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +10 -0
  33. package/es/components/dataSourceComponents/fields/Input.Phone/serve.d.ts +24 -0
  34. package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
  35. package/es/components/dataSourceComponents/fields/Select/index.d.ts +2 -1
  36. package/es/components/dataSourceComponents/fields/Upload/BaseUpload.d.ts +5 -0
  37. package/es/components/dataSourceComponents/fields/Upload/BaseUpload.js +199 -19
  38. package/es/components/dataSourceComponents/fields/Upload/CameraPopover.d.ts +6 -0
  39. package/es/components/dataSourceComponents/fields/Upload/CameraPopover.js +66 -0
  40. package/es/components/dataSourceComponents/fields/Upload/index.js +4 -3
  41. package/es/components/dataSourceComponents/fields/Upload/index.less +35 -3
  42. package/es/components/dataSourceComponents/fields/Upload/type.d.ts +38 -0
  43. package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
  44. package/es/components/dataSourceComponents/fields/index.d.ts +11 -11
  45. package/es/components/date-picker/index.d.ts +1 -0
  46. package/es/components/drag-sort-tree/index.d.ts +4 -0
  47. package/es/components/filter/index.d.ts +0 -1
  48. package/es/components/filter/types.d.ts +3 -0
  49. package/es/components/iconfont/index.d.ts +8 -0
  50. package/es/components/iconfont/index.js +1 -1
  51. package/es/components/keyboard/index.d.ts +22 -0
  52. package/es/components/keyboard/index.js +159 -0
  53. package/es/components/keyboard/index.less +44 -0
  54. package/es/components/list/index.d.ts +0 -1
  55. package/es/components/login-and-register/index.d.ts +82 -0
  56. package/es/components/page/index.d.ts +1 -0
  57. package/es/components/pisell-config-provider/index.d.ts +13 -0
  58. package/es/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +1 -0
  59. package/es/components/pisellCamera/index.d.ts +4 -0
  60. package/es/components/pisellCamera/index.js +228 -0
  61. package/es/components/pisellCamera/index.less +131 -0
  62. package/es/components/pisellEmpty/index.d.ts +19 -0
  63. package/es/components/pisellInput/index.d.ts +1 -0
  64. package/es/components/pisellModal/components/IpadModal/index.d.ts +1 -0
  65. package/es/components/pisellModal/components/MobileModal/index.d.ts +1 -0
  66. package/es/components/pisellModal/components/index.d.ts +1 -0
  67. package/es/components/pisellQRScanner/index.d.ts +0 -13
  68. package/es/components/pisellQRScanner/index.js +0 -8
  69. package/es/components/pisellToast/squareToast/renderImperatively.d.ts +29 -0
  70. package/es/components/pisellWalletPassCard/index.d.ts +136 -0
  71. package/es/components/pisellWalletPassCard/index.js +6 -3
  72. package/es/components/productCard/cartSkuCard/components/holders/index.d.ts +1 -0
  73. package/es/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
  74. package/es/components/productCard/cartSkuCard/components/resources/index.d.ts +1 -0
  75. package/es/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +1 -0
  76. package/es/components/productCard/cartSkuCard/components/swipeAction/index.js +73 -5
  77. package/es/components/productCard/cartSkuCard/components/swipeAction/index.less +39 -0
  78. package/es/components/productCard/cartSkuCard/components/timeRange/index.d.ts +1 -0
  79. package/es/components/productCard/cartSkuCard/index.js +2 -11
  80. package/es/components/productCard/components/Header/DeleteButton/index.d.ts +3 -0
  81. package/es/components/productCard/components/Packages/utils.d.ts +1 -1
  82. package/es/components/productCard/components/Time/components/SelectHolder/index.d.ts +3 -0
  83. package/es/components/productCard/components/Time/components/SelectResource/index.d.ts +18 -0
  84. package/es/components/productCard/components/Time/index.d.ts +3 -0
  85. package/es/components/select-time/index.d.ts +1 -0
  86. package/es/components/table/Actions/component/ColumnsSetting/index.d.ts +1 -0
  87. package/es/components/table/Actions/component/ExportImport/index.d.ts +7 -0
  88. package/es/components/table/Actions/component/GallerySetting/index.d.ts +1 -0
  89. package/es/components/table/Actions/component/Group/index.d.ts +1 -0
  90. package/es/components/table/Actions/index.d.ts +1 -0
  91. package/es/components/table/Actions/index.js +4 -1
  92. package/es/components/table/Gallery/components/GalleryItem/components/Cover/index.d.ts +1 -0
  93. package/es/components/table/Gallery/components/GalleryItem/components/Title/index.d.ts +1 -0
  94. package/es/components/table/Gallery/components/GalleryItem/index.d.ts +14 -0
  95. package/es/components/table/Gallery/index.d.ts +5 -0
  96. package/es/components/table/Table/fields/date/index.d.ts +1 -0
  97. package/es/components/table/Table/fields/image/Show/index.d.ts +1 -0
  98. package/es/components/table/Table/fields/image/index.d.ts +1 -0
  99. package/es/components/table/Table/fields/link/index.d.ts +1 -0
  100. package/es/components/table/Table/fields/number/Show/index.d.ts +1 -0
  101. package/es/components/table/Table/fields/number/index.d.ts +1 -0
  102. package/es/components/table/Table/fields/numberRange/Show/index.d.ts +1 -0
  103. package/es/components/table/Table/fields/numberRange/index.d.ts +1 -0
  104. package/es/components/table/Table/fields/oldRangePicker/index.d.ts +1 -0
  105. package/es/components/table/Table/fields/pSwitch/Show/index.d.ts +1 -0
  106. package/es/components/table/Table/fields/pSwitch/index.d.ts +1 -0
  107. package/es/components/table/Table/fields/rangePicker/index.d.ts +1 -0
  108. package/es/components/table/Table/fields/search/Show/index.d.ts +1 -0
  109. package/es/components/table/Table/fields/search/index.d.ts +1 -0
  110. package/es/components/table/Table/index.d.ts +4 -0
  111. package/es/components/table/Table/utils.d.ts +161 -0
  112. package/es/components/table/Table/utils.js +22 -1
  113. package/es/components/table/hooks/useTableSetting.d.ts +21 -0
  114. package/es/components/table/hooks/useTableSetting.js +113 -5
  115. package/es/components/table/hooks/useTransDataSource.d.ts +11 -0
  116. package/es/components/table/index.js +14 -3
  117. package/es/components/table/types.d.ts +268 -0
  118. package/es/components/translation/index.d.ts +14 -0
  119. package/es/components/versionModal/index.d.ts +23 -0
  120. package/es/components/versionSelect/index.d.ts +1 -0
  121. package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +5 -1
  122. package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.js +21 -7
  123. package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.less +9 -5
  124. package/es/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +4 -0
  125. package/es/components/virtual-keyboard/BaseNumberKeyboard/index.js +44 -25
  126. package/es/components/virtualInput/BaseVirtualInput/index.d.ts +40 -0
  127. package/es/components/virtualInput/BaseVirtualInput/index.js +163 -0
  128. package/es/components/virtualInput/BaseVirtualInput/index.less +77 -0
  129. package/es/components/virtualInput/index.d.ts +24 -0
  130. package/es/components/virtualInput/index.js +60 -0
  131. package/es/components/virtualInput/index.less +42 -0
  132. package/es/components/walletCard/index.d.ts +71 -0
  133. package/es/index.d.ts +144 -0
  134. package/es/index.js +4 -1
  135. package/es/locales/en-US.d.ts +307 -0
  136. package/es/locales/en-US.js +29 -1
  137. package/es/locales/zh-CN.d.ts +302 -0
  138. package/es/locales/zh-CN.js +29 -1
  139. package/es/locales/zh-TW.d.ts +302 -0
  140. package/es/locales/zh-TW.js +29 -1
  141. package/es/utils/platform.d.ts +1 -1
  142. package/lib/components/appVersionControl/index.d.ts +4 -0
  143. package/lib/components/auto-resize-text/auto-text-size-standalone.d.ts +20 -0
  144. package/lib/components/auto-resize-text/auto-text-size-standalone.js +273 -0
  145. package/lib/components/auto-resize-text/index.d.ts +6 -0
  146. package/lib/components/auto-resize-text/index.js +71 -0
  147. package/lib/components/cardPro/index.d.ts +3 -0
  148. package/lib/components/cardPro/index.js +3 -2
  149. package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +56 -0
  150. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.d.ts +1 -0
  151. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +1 -0
  152. package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.js +8 -2
  153. package/lib/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +1 -0
  154. package/lib/components/dataSourceComponents/dataSourceTable/filter/index.js +7 -2
  155. package/lib/components/dataSourceComponents/dataSourceTable/filter/utils.d.ts +0 -1
  156. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +38 -0
  157. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +100 -0
  158. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +22 -7
  159. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +2 -1
  160. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +78 -7
  161. package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +84 -0
  162. package/lib/components/dataSourceComponents/fields/Input.Mobile/WithMode.d.ts +10 -0
  163. package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +10 -0
  164. package/lib/components/dataSourceComponents/fields/Input.Phone/serve.d.ts +24 -0
  165. package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
  166. package/lib/components/dataSourceComponents/fields/Select/index.d.ts +2 -1
  167. package/lib/components/dataSourceComponents/fields/Upload/BaseUpload.d.ts +5 -0
  168. package/lib/components/dataSourceComponents/fields/Upload/BaseUpload.js +168 -5
  169. package/lib/components/dataSourceComponents/fields/Upload/CameraPopover.d.ts +6 -0
  170. package/lib/components/dataSourceComponents/fields/Upload/CameraPopover.js +95 -0
  171. package/lib/components/dataSourceComponents/fields/Upload/index.js +2 -1
  172. package/lib/components/dataSourceComponents/fields/Upload/index.less +35 -3
  173. package/lib/components/dataSourceComponents/fields/Upload/type.d.ts +38 -0
  174. package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
  175. package/lib/components/dataSourceComponents/fields/index.d.ts +11 -11
  176. package/lib/components/date-picker/index.d.ts +1 -0
  177. package/lib/components/drag-sort-tree/index.d.ts +4 -0
  178. package/lib/components/filter/index.d.ts +0 -1
  179. package/lib/components/filter/types.d.ts +3 -0
  180. package/lib/components/iconfont/index.d.ts +8 -0
  181. package/lib/components/iconfont/index.js +1 -1
  182. package/lib/components/keyboard/index.d.ts +22 -0
  183. package/lib/components/keyboard/index.js +223 -0
  184. package/lib/components/keyboard/index.less +44 -0
  185. package/lib/components/list/index.d.ts +0 -1
  186. package/lib/components/login-and-register/index.d.ts +82 -0
  187. package/lib/components/page/index.d.ts +1 -0
  188. package/lib/components/pisell-config-provider/index.d.ts +13 -0
  189. package/lib/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +1 -0
  190. package/lib/components/pisellCamera/index.d.ts +4 -0
  191. package/lib/components/pisellCamera/index.js +222 -0
  192. package/lib/components/pisellCamera/index.less +131 -0
  193. package/lib/components/pisellEmpty/index.d.ts +19 -0
  194. package/lib/components/pisellInput/index.d.ts +1 -0
  195. package/lib/components/pisellModal/components/IpadModal/index.d.ts +1 -0
  196. package/lib/components/pisellModal/components/MobileModal/index.d.ts +1 -0
  197. package/lib/components/pisellModal/components/index.d.ts +1 -0
  198. package/lib/components/pisellQRScanner/index.d.ts +0 -13
  199. package/lib/components/pisellToast/squareToast/renderImperatively.d.ts +29 -0
  200. package/lib/components/pisellWalletPassCard/index.d.ts +136 -0
  201. package/lib/components/pisellWalletPassCard/index.js +7 -2
  202. package/lib/components/productCard/cartSkuCard/components/holders/index.d.ts +1 -0
  203. package/lib/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
  204. package/lib/components/productCard/cartSkuCard/components/resources/index.d.ts +1 -0
  205. package/lib/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +1 -0
  206. package/lib/components/productCard/cartSkuCard/components/swipeAction/index.js +45 -11
  207. package/lib/components/productCard/cartSkuCard/components/swipeAction/index.less +39 -0
  208. package/lib/components/productCard/cartSkuCard/components/timeRange/index.d.ts +1 -0
  209. package/lib/components/productCard/cartSkuCard/index.js +2 -13
  210. package/lib/components/productCard/components/Header/DeleteButton/index.d.ts +3 -0
  211. package/lib/components/productCard/components/Packages/utils.d.ts +1 -1
  212. package/lib/components/productCard/components/Time/components/SelectHolder/index.d.ts +3 -0
  213. package/lib/components/productCard/components/Time/components/SelectResource/index.d.ts +18 -0
  214. package/lib/components/productCard/components/Time/index.d.ts +3 -0
  215. package/lib/components/select-time/index.d.ts +1 -0
  216. package/lib/components/table/Actions/component/ColumnsSetting/index.d.ts +1 -0
  217. package/lib/components/table/Actions/component/ExportImport/index.d.ts +7 -0
  218. package/lib/components/table/Actions/component/GallerySetting/index.d.ts +1 -0
  219. package/lib/components/table/Actions/component/Group/index.d.ts +1 -0
  220. package/lib/components/table/Actions/index.d.ts +1 -0
  221. package/lib/components/table/Actions/index.js +4 -1
  222. package/lib/components/table/Gallery/components/GalleryItem/components/Cover/index.d.ts +1 -0
  223. package/lib/components/table/Gallery/components/GalleryItem/components/Title/index.d.ts +1 -0
  224. package/lib/components/table/Gallery/components/GalleryItem/index.d.ts +14 -0
  225. package/lib/components/table/Gallery/index.d.ts +5 -0
  226. package/lib/components/table/Table/fields/date/index.d.ts +1 -0
  227. package/lib/components/table/Table/fields/image/Show/index.d.ts +1 -0
  228. package/lib/components/table/Table/fields/image/index.d.ts +1 -0
  229. package/lib/components/table/Table/fields/link/index.d.ts +1 -0
  230. package/lib/components/table/Table/fields/number/Show/index.d.ts +1 -0
  231. package/lib/components/table/Table/fields/number/index.d.ts +1 -0
  232. package/lib/components/table/Table/fields/numberRange/Show/index.d.ts +1 -0
  233. package/lib/components/table/Table/fields/numberRange/index.d.ts +1 -0
  234. package/lib/components/table/Table/fields/oldRangePicker/index.d.ts +1 -0
  235. package/lib/components/table/Table/fields/pSwitch/Show/index.d.ts +1 -0
  236. package/lib/components/table/Table/fields/pSwitch/index.d.ts +1 -0
  237. package/lib/components/table/Table/fields/rangePicker/index.d.ts +1 -0
  238. package/lib/components/table/Table/fields/search/Show/index.d.ts +1 -0
  239. package/lib/components/table/Table/fields/search/index.d.ts +1 -0
  240. package/lib/components/table/Table/index.d.ts +4 -0
  241. package/lib/components/table/Table/utils.d.ts +161 -0
  242. package/lib/components/table/Table/utils.js +18 -1
  243. package/lib/components/table/hooks/useTableSetting.d.ts +21 -0
  244. package/lib/components/table/hooks/useTableSetting.js +114 -4
  245. package/lib/components/table/hooks/useTransDataSource.d.ts +11 -0
  246. package/lib/components/table/index.js +12 -1
  247. package/lib/components/table/types.d.ts +268 -0
  248. package/lib/components/translation/index.d.ts +14 -0
  249. package/lib/components/versionModal/index.d.ts +23 -0
  250. package/lib/components/versionSelect/index.d.ts +1 -0
  251. package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +5 -1
  252. package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.js +19 -2
  253. package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.less +9 -5
  254. package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +4 -0
  255. package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.js +45 -27
  256. package/lib/components/virtualInput/BaseVirtualInput/index.d.ts +40 -0
  257. package/lib/components/virtualInput/BaseVirtualInput/index.js +179 -0
  258. package/lib/components/virtualInput/BaseVirtualInput/index.less +77 -0
  259. package/lib/components/virtualInput/index.d.ts +24 -0
  260. package/lib/components/virtualInput/index.js +102 -0
  261. package/lib/components/virtualInput/index.less +42 -0
  262. package/lib/components/walletCard/index.d.ts +71 -0
  263. package/lib/index.d.ts +144 -0
  264. package/lib/index.js +9 -0
  265. package/lib/locales/en-US.d.ts +307 -0
  266. package/lib/locales/en-US.js +25 -1
  267. package/lib/locales/zh-CN.d.ts +302 -0
  268. package/lib/locales/zh-CN.js +25 -1
  269. package/lib/locales/zh-TW.d.ts +302 -0
  270. package/lib/locales/zh-TW.js +25 -1
  271. package/lib/utils/platform.d.ts +1 -1
  272. package/lowcode/auto-resize-text/meta.ts +47 -0
  273. package/lowcode/data-source-table/meta.ts +358 -66
  274. package/lowcode/form-item-upload/meta.ts +20 -5
  275. package/lowcode/table/meta.ts +104 -0
  276. package/package.json +3 -2
@@ -128,7 +128,9 @@ var BaseNumberKeyboard = (props) => {
128
128
  onEnter,
129
129
  presets,
130
130
  defaultSelect,
131
- rightItemsStyle
131
+ rightItemsStyle,
132
+ customDisplay,
133
+ style
132
134
  } = props;
133
135
  const [value, setValue] = (0, import_ahooks.useControllableValue)(props, {
134
136
  defaultValue
@@ -200,6 +202,8 @@ var BaseNumberKeyboard = (props) => {
200
202
  }
201
203
  };
202
204
  const handleChangeValue = (val) => {
205
+ var _a;
206
+ val = typeof val === "string" ? val : ((_a = val == null ? void 0 : val.target) == null ? void 0 : _a.value) || "";
203
207
  const detail = checkValue(val);
204
208
  if (detail) return;
205
209
  setValue(val);
@@ -228,38 +232,52 @@ var BaseNumberKeyboard = (props) => {
228
232
  const handleKeyboardChange = (0, import_ahooks.useMemoizedFn)((val) => {
229
233
  return (actions[val] || actions.default)(val);
230
234
  });
231
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-virtual-keyboard-base" }, /* @__PURE__ */ import_react.default.createElement(
232
- import_VirtualKeyInput.default,
233
- {
234
- value,
235
- onChange: (e) => handleChangeValue(e.target.value),
236
- renderInput: (props2) => {
237
- if ((0, import_utils.isUndefined)(props2.value) || props2.value === "") {
238
- return /* @__PURE__ */ import_react.default.createElement(
239
- import_VirtualInput.default,
240
- {
241
- autoFocus: true,
242
- placeholder,
243
- value: props2.value
244
- }
245
- );
246
- }
247
- return (format == null ? void 0 : format(props2.value)) || props2.value;
248
- },
249
- showDelete: false,
250
- onValueSelect: setSelect,
251
- defaultSelect,
252
- style: {
253
- backgroundColor: (rightItemsStyle == null ? void 0 : rightItemsStyle.buttonBackgroundColor) || "#fff",
254
- color: (rightItemsStyle == null ? void 0 : rightItemsStyle.textColor) || "#000000"
235
+ const renderDisplayField = () => {
236
+ if (customDisplay) {
237
+ if (typeof customDisplay === "function") {
238
+ return customDisplay({
239
+ value,
240
+ onChange: handleChangeValue,
241
+ onValueSelect: setSelect
242
+ });
255
243
  }
244
+ return customDisplay;
256
245
  }
257
- ), /* @__PURE__ */ import_react.default.createElement(import_Presets.default, { presets, onChange: handleChangeValue }), /* @__PURE__ */ import_react.default.createElement(
246
+ return /* @__PURE__ */ import_react.default.createElement(
247
+ import_VirtualKeyInput.default,
248
+ {
249
+ value,
250
+ onChange: (e) => handleChangeValue(e.target.value),
251
+ renderInput: (props2) => {
252
+ if ((0, import_utils.isUndefined)(props2.value) || props2.value === "") {
253
+ return /* @__PURE__ */ import_react.default.createElement(
254
+ import_VirtualInput.default,
255
+ {
256
+ autoFocus: true,
257
+ placeholder,
258
+ value: props2.value
259
+ }
260
+ );
261
+ }
262
+ return (format == null ? void 0 : format(props2.value)) || props2.value;
263
+ },
264
+ showDelete: false,
265
+ onValueSelect: setSelect,
266
+ defaultSelect,
267
+ style: {
268
+ backgroundColor: (rightItemsStyle == null ? void 0 : rightItemsStyle.buttonBackgroundColor) || "#fff",
269
+ color: (rightItemsStyle == null ? void 0 : rightItemsStyle.textColor) || "#000000"
270
+ }
271
+ }
272
+ );
273
+ };
274
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-virtual-keyboard-base", style }, renderDisplayField(), /* @__PURE__ */ import_react.default.createElement(import_Presets.default, { presets, onChange: handleChangeValue }), /* @__PURE__ */ import_react.default.createElement(
258
275
  import_Keyboard.default,
259
276
  {
260
277
  items: itemsWithStyle,
261
278
  rightItems,
262
- onChange: handleKeyboardChange
279
+ onChange: handleKeyboardChange,
280
+ ...props.keyboardProps || {}
263
281
  }
264
282
  ));
265
283
  };
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ export interface BaseVirtualInputProps {
4
+ /** 输入值 */
5
+ value?: string | React.ReactNode;
6
+ /** 占位符 */
7
+ placeholder?: string;
8
+ /** 是否自动聚焦 */
9
+ autoFocus?: boolean;
10
+ /** 是否禁用 */
11
+ disabled?: boolean;
12
+ /** 组件高度,默认60px */
13
+ height?: number | string;
14
+ /** 字体大小,默认48px,如果不设置会根据高度自动计算 */
15
+ fontSize?: number | string;
16
+ /** 聚焦回调 */
17
+ onFocus?: () => void;
18
+ /** 失焦回调 */
19
+ onBlur?: () => void;
20
+ /** 文字位置 */
21
+ textAlign?: 'start' | 'center' | 'end';
22
+ /** 自定义样式 */
23
+ style?: React.CSSProperties;
24
+ /** 自定义类名 */
25
+ className?: string;
26
+ /** showCursor */
27
+ showCursor?: boolean;
28
+ /** 防止失焦的元素选择器或ref */
29
+ preventBlurElements?: Array<string | React.RefObject<HTMLElement>>;
30
+ /** 是否聚焦(受控模式) */
31
+ focused?: boolean;
32
+ }
33
+ export interface BaseVirtualInputRef {
34
+ /** 手动聚焦 */
35
+ focus: () => void;
36
+ /** 手动失焦 */
37
+ blur: () => void;
38
+ }
39
+ declare const BaseVirtualInput: React.ForwardRefExoticComponent<BaseVirtualInputProps & React.RefAttributes<BaseVirtualInputRef>>;
40
+ export default BaseVirtualInput;
@@ -0,0 +1,179 @@
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/virtualInput/BaseVirtualInput/index.tsx
30
+ var BaseVirtualInput_exports = {};
31
+ __export(BaseVirtualInput_exports, {
32
+ default: () => BaseVirtualInput_default
33
+ });
34
+ module.exports = __toCommonJS(BaseVirtualInput_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_classnames = __toESM(require("classnames"));
37
+ var import_auto_resize_text = __toESM(require("../../auto-resize-text"));
38
+ var import_index = require("./index.less");
39
+ var BaseVirtualInput = (0, import_react.forwardRef)(
40
+ (props, ref) => {
41
+ const {
42
+ value = "",
43
+ placeholder = "",
44
+ autoFocus = false,
45
+ disabled = false,
46
+ height = 60,
47
+ fontSize,
48
+ onFocus,
49
+ onBlur,
50
+ style,
51
+ className,
52
+ preventBlurElements = [],
53
+ focused,
54
+ showCursor = true
55
+ } = props;
56
+ const [localFocused, setLocalFocused] = (0, import_react.useState)(focused ?? autoFocus);
57
+ const internalFocused = "focused" in props ? props.focused : localFocused;
58
+ const containerRef = (0, import_react.useRef)(null);
59
+ const handleFocus = (0, import_react.useCallback)(() => {
60
+ if (disabled) return;
61
+ setLocalFocused(true);
62
+ onFocus == null ? void 0 : onFocus();
63
+ }, [disabled, onFocus]);
64
+ const handleBlur = (0, import_react.useCallback)(() => {
65
+ setLocalFocused(false);
66
+ onBlur == null ? void 0 : onBlur();
67
+ }, [onBlur]);
68
+ const shouldPreventBlur = (0, import_react.useCallback)(
69
+ (target) => {
70
+ if (!target || !(target instanceof Element)) return false;
71
+ return preventBlurElements.some((element) => {
72
+ if (typeof element === "string") {
73
+ const matchedElements = document.querySelectorAll(element);
74
+ return Array.from(matchedElements).some(
75
+ (el) => el.contains(target) || el === target
76
+ );
77
+ } else if (element && "current" in element && element.current) {
78
+ return element.current.contains(target);
79
+ }
80
+ return false;
81
+ });
82
+ },
83
+ [preventBlurElements]
84
+ );
85
+ (0, import_react.useEffect)(() => {
86
+ const handleGlobalClick = (event) => {
87
+ if (!internalFocused) return;
88
+ const target = event.target;
89
+ if (containerRef.current && containerRef.current.contains(target)) {
90
+ return;
91
+ }
92
+ if (shouldPreventBlur(target)) {
93
+ return;
94
+ }
95
+ handleBlur();
96
+ };
97
+ if (internalFocused) {
98
+ document.addEventListener("mousedown", handleGlobalClick);
99
+ }
100
+ return () => {
101
+ document.removeEventListener("mousedown", handleGlobalClick);
102
+ };
103
+ }, [internalFocused, handleBlur, shouldPreventBlur]);
104
+ const handleClick = (0, import_react.useCallback)(
105
+ (event) => {
106
+ handleFocus();
107
+ },
108
+ [handleFocus]
109
+ );
110
+ (0, import_react.useImperativeHandle)(
111
+ ref,
112
+ () => ({
113
+ focus: handleFocus,
114
+ blur: handleBlur
115
+ }),
116
+ [handleFocus, handleBlur]
117
+ );
118
+ const componentHeight = typeof height === "number" ? `${height}px` : height;
119
+ const getBaseFontSize = (0, import_react.useCallback)(() => {
120
+ if (fontSize) {
121
+ return typeof fontSize === "number" ? fontSize : parseFloat(fontSize);
122
+ }
123
+ return typeof height === "number" ? height * 0.8 : 48;
124
+ }, [fontSize, height]);
125
+ const baseFontSize = getBaseFontSize();
126
+ const minFontSize = Math.max(10, baseFontSize * 0.2);
127
+ const maxFontSize = baseFontSize;
128
+ const caretHeight = `calc(${componentHeight} * 0.67)`;
129
+ const mergedStyle = {
130
+ ...style,
131
+ "--virtual-input-height": componentHeight,
132
+ "--virtual-input-caret-height": caretHeight,
133
+ "--virtual-input-font-size": `${baseFontSize}px`
134
+ };
135
+ const showPlaceholder = value === void 0 || value === "";
136
+ return /* @__PURE__ */ import_react.default.createElement(
137
+ "div",
138
+ {
139
+ ref: containerRef,
140
+ className: (0, import_classnames.default)(
141
+ "pisell-base-virtual-input",
142
+ {
143
+ "pisell-base-virtual-input--focused": internalFocused,
144
+ "pisell-base-virtual-input--disabled": disabled
145
+ },
146
+ className
147
+ ),
148
+ style: mergedStyle,
149
+ onClick: handleClick
150
+ },
151
+ showPlaceholder && /* @__PURE__ */ import_react.default.createElement(
152
+ import_auto_resize_text.default,
153
+ {
154
+ className: "pisell-base-virtual-input-placeholder",
155
+ mode: "oneline",
156
+ minFontSizePx: minFontSize,
157
+ maxFontSizePx: maxFontSize,
158
+ fontSizePrecisionPx: 0.5
159
+ },
160
+ placeholder
161
+ ),
162
+ !!value && /* @__PURE__ */ import_react.default.createElement(
163
+ import_auto_resize_text.default,
164
+ {
165
+ className: "pisell-base-virtual-input-value",
166
+ mode: "oneline",
167
+ minFontSizePx: minFontSize,
168
+ maxFontSizePx: maxFontSize,
169
+ fontSizePrecisionPx: 0.5,
170
+ scrollToEnd: true
171
+ },
172
+ value
173
+ ),
174
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-base-virtual-input-caret-container" }, internalFocused && !disabled && showCursor && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-base-virtual-input-caret" }))
175
+ );
176
+ }
177
+ );
178
+ BaseVirtualInput.displayName = "BaseVirtualInput";
179
+ var BaseVirtualInput_default = BaseVirtualInput;
@@ -0,0 +1,77 @@
1
+ .pisell-base-virtual-input {
2
+ width: 100%;
3
+ display: flex;
4
+ align-items: center;
5
+ background-color: transparent;
6
+ cursor: pointer;
7
+ transition: all 0.2s ease;
8
+ outline: none;
9
+ position: relative;
10
+ height: var(--virtual-input-height);
11
+
12
+ &--disabled {
13
+ cursor: not-allowed;
14
+ opacity: 0.6;
15
+ }
16
+ }
17
+
18
+ .pisell-base-virtual-input-placeholder {
19
+ color: #98a2b3;
20
+ font-weight: 400;
21
+ user-select: none;
22
+ position: absolute;
23
+ left: 0;
24
+ top: 0;
25
+ width: 100%;
26
+ max-width: 100%;
27
+ overflow: hidden;
28
+ pointer-events: none;
29
+ font-size: var(--virtual-input-font-size);
30
+ height: var(--virtual-input-height);
31
+ line-height: var(--virtual-input-height);
32
+ }
33
+
34
+ .pisell-base-virtual-input-value {
35
+ font-weight: 600;
36
+ white-space: nowrap;
37
+ flex-shrink: 0;
38
+ // width: 100%;
39
+ max-width: 100%;
40
+ overflow-y: hidden;
41
+ overflow-x: auto;
42
+ font-size: var(--virtual-input-font-size);
43
+ line-height: var(--virtual-input-height);
44
+ height: var(--virtual-input-height);
45
+
46
+ -ms-overflow-style: none; /* IE 和 Edge */
47
+ scrollbar-width: none; /* Firefox */
48
+ &::-webkit-scrollbar {
49
+ display: none; /* Chrome, Safari 和 Opera */
50
+ }
51
+ }
52
+
53
+ .pisell-base-virtual-input-caret-container {
54
+ height: 100%;
55
+ display: flex;
56
+ align-items: center;
57
+ flex-shrink: 0;
58
+ }
59
+
60
+ .pisell-base-virtual-input-caret {
61
+ width: 2px;
62
+ height: var(--virtual-input-caret-height);
63
+ background-color: #1570ef;
64
+ border-radius: 1px;
65
+ animation: pisell-base-virtual-input-caret-blink 1s infinite;
66
+ }
67
+
68
+ @keyframes pisell-base-virtual-input-caret-blink {
69
+ 0%,
70
+ 50% {
71
+ opacity: 1;
72
+ }
73
+ 51%,
74
+ 100% {
75
+ opacity: 0;
76
+ }
77
+ }
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import { BaseVirtualInputProps, BaseVirtualInputRef } from './BaseVirtualInput';
3
+ import './index.less';
4
+ export { BaseVirtualInputProps, BaseVirtualInputRef } from './BaseVirtualInput';
5
+ export interface VirtualInputProps extends BaseVirtualInputProps {
6
+ /** 在VirtualInput上方显示的额外内容 */
7
+ topContent?: React.ReactNode;
8
+ /** 在VirtualInput下方显示的额外内容 */
9
+ bottomContent?: React.ReactNode;
10
+ /** wrapper class */
11
+ wrapperClassName?: string;
12
+ /** 虚拟输入框包装器的样式 */
13
+ wrapperStyle?: React.CSSProperties;
14
+ /** 是否允许清除输入框中的内容 */
15
+ allowClear?: boolean;
16
+ /** 清除输入框内容的回调函数 */
17
+ onClear?: () => void;
18
+ /** 自定义清除按钮的样式 */
19
+ clearButtonStyle?: React.CSSProperties;
20
+ }
21
+ export interface VirtualInputRef extends BaseVirtualInputRef {
22
+ }
23
+ declare const VirtualInput: React.ForwardRefExoticComponent<VirtualInputProps & React.RefAttributes<VirtualInputRef>>;
24
+ export default VirtualInput;
@@ -0,0 +1,102 @@
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/virtualInput/index.tsx
30
+ var virtualInput_exports = {};
31
+ __export(virtualInput_exports, {
32
+ BaseVirtualInputProps: () => import_BaseVirtualInput2.BaseVirtualInputProps,
33
+ BaseVirtualInputRef: () => import_BaseVirtualInput2.BaseVirtualInputRef,
34
+ default: () => virtualInput_default
35
+ });
36
+ module.exports = __toCommonJS(virtualInput_exports);
37
+ var import_react = __toESM(require("react"));
38
+ var import_classnames = __toESM(require("classnames"));
39
+ var import_icon = __toESM(require("../icon"));
40
+ var import_BaseVirtualInput = __toESM(require("./BaseVirtualInput"));
41
+ var import_index = require("./index.less");
42
+ var import_BaseVirtualInput2 = require("./BaseVirtualInput");
43
+ var VirtualInput = (0, import_react.forwardRef)(
44
+ ({
45
+ topContent,
46
+ bottomContent,
47
+ wrapperStyle,
48
+ wrapperClassName,
49
+ allowClear = false,
50
+ onClear,
51
+ value,
52
+ clearButtonStyle,
53
+ ...virtualInputProps
54
+ }, ref) => {
55
+ const baseInputRef = (0, import_react.useRef)(null);
56
+ const handleClear = () => {
57
+ onClear == null ? void 0 : onClear();
58
+ };
59
+ (0, import_react.useImperativeHandle)(ref, () => ({
60
+ focus: () => {
61
+ var _a;
62
+ return (_a = baseInputRef.current) == null ? void 0 : _a.focus();
63
+ },
64
+ blur: () => {
65
+ var _a;
66
+ return (_a = baseInputRef.current) == null ? void 0 : _a.blur();
67
+ }
68
+ }));
69
+ return /* @__PURE__ */ import_react.default.createElement(
70
+ "div",
71
+ {
72
+ className: (0, import_classnames.default)("pisell-virtual-input-wrapper", wrapperClassName),
73
+ style: wrapperStyle
74
+ },
75
+ topContent,
76
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-virtual-input-container" }, /* @__PURE__ */ import_react.default.createElement(
77
+ import_BaseVirtualInput.default,
78
+ {
79
+ ref: baseInputRef,
80
+ value,
81
+ ...virtualInputProps
82
+ }
83
+ ), allowClear && /* @__PURE__ */ import_react.default.createElement(
84
+ "div",
85
+ {
86
+ className: "pisell-virtual-input-clear-button",
87
+ onClick: handleClear,
88
+ style: clearButtonStyle
89
+ },
90
+ /* @__PURE__ */ import_react.default.createElement(import_icon.default, { type: "pisell2-delete" })
91
+ )),
92
+ bottomContent
93
+ );
94
+ }
95
+ );
96
+ VirtualInput.displayName = "VirtualInput";
97
+ var virtualInput_default = VirtualInput;
98
+ // Annotate the CommonJS export names for ESM import in node:
99
+ 0 && (module.exports = {
100
+ BaseVirtualInputProps,
101
+ BaseVirtualInputRef
102
+ });
@@ -0,0 +1,42 @@
1
+ .pisell-virtual-input-wrapper {
2
+ overflow: hidden;
3
+ }
4
+
5
+ .pisell-virtual-input-container {
6
+ position: relative;
7
+ display: flex;
8
+ align-items: center;
9
+ width: 100%;
10
+ }
11
+
12
+ .pisell-virtual-input-clear-button {
13
+ position: absolute;
14
+ right: 8px;
15
+ top: 50%;
16
+ transform: translateY(-50%);
17
+ display: flex;
18
+ align-items: center;
19
+ justify-content: center;
20
+ width: 24px;
21
+ height: 24px;
22
+ cursor: pointer;
23
+ border-radius: 4px;
24
+ transition: all 0.2s ease;
25
+ color: #667085;
26
+ background-color: transparent;
27
+ z-index: 1;
28
+
29
+ &:hover {
30
+ background-color: #f2f4f7;
31
+ color: #344054;
32
+ }
33
+
34
+ &:active {
35
+ background-color: #e4e7ec;
36
+ }
37
+
38
+ svg {
39
+ width: 16px;
40
+ height: 16px;
41
+ }
42
+ }
@@ -0,0 +1,71 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ declare global {
4
+ namespace JSX {
5
+ interface IntrinsicElements {
6
+ [elemName: string]: any;
7
+ }
8
+ }
9
+ }
10
+ export interface WalletCardItem {
11
+ key: string;
12
+ label?: string;
13
+ hidden?: boolean;
14
+ value?: number;
15
+ }
16
+ export interface WalletCardProps {
17
+ /** 二维码弹窗适配平台 */
18
+ platform?: 'pc' | 'h5' | 'ipad';
19
+ /** 卡片主题 */
20
+ mode?: 'dark' | 'light';
21
+ /** 默认还是完整显示code */
22
+ cardStyle?: 'normal' | 'full';
23
+ /** 条形码还是二维码 */
24
+ codeType?: 'barCode' | 'orCode';
25
+ /** 二维码方向 */
26
+ codeDirection?: 'bottom' | 'top';
27
+ /** 自定义背景图 */
28
+ customBackgroundImage?: string;
29
+ /** 图标:可以是React组件或图片URL */
30
+ showIcon?: boolean;
31
+ showWalletName?: boolean;
32
+ iconImg?: string;
33
+ /** 钱包名称 */
34
+ walletName?: string;
35
+ /** 店铺名称 */
36
+ shopName?: string;
37
+ /** 是否显示店铺名称 */
38
+ showShopName?: boolean;
39
+ /** 卡号 */
40
+ cardNo?: string;
41
+ /** 是否显示卡号 */
42
+ showCardNo?: boolean;
43
+ /** 是否显示二维码 */
44
+ showCode?: boolean;
45
+ /** 点击二维码/条形码的回调 */
46
+ onCodeClick?: () => void;
47
+ /** 货币符号 */
48
+ symbol: string;
49
+ /** 点击卡片的回调 */
50
+ onClick?: () => void;
51
+ /** 自定义类名 */
52
+ className?: string;
53
+ items: WalletCardItem[];
54
+ /** 自定义样式 */
55
+ style?: React.CSSProperties;
56
+ title?: string;
57
+ subTitle?: string;
58
+ align?: 'left' | 'center';
59
+ buttonText?: string;
60
+ [key: string]: any;
61
+ /** 是否已登录 */
62
+ isLogin?: boolean;
63
+ /** 是否是引导页 */
64
+ isGuide?: boolean;
65
+ /** 是否显示查看PIN */
66
+ showViewPin?: boolean;
67
+ /** 查看PIN的回调 */
68
+ onViewPinClick?: () => void;
69
+ }
70
+ declare const WalletCard: React.FC<WalletCardProps>;
71
+ export default WalletCard;