@pisell/materials 6.3.17 → 6.3.18

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 (269) 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 +144 -144
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +23 -23
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +23 -23
  11. package/es/components/TimeResourceSelector/index.d.ts +21 -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.js +10 -3
  17. package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
  18. package/es/components/dataSourceComponents/fields/index.d.ts +16 -16
  19. package/es/components/iconfont/index.js +1 -1
  20. package/es/components/keyboard/index.d.ts +22 -0
  21. package/es/components/keyboard/index.js +159 -0
  22. package/es/components/keyboard/index.less +44 -0
  23. package/es/components/page/index.js +5 -2
  24. package/es/components/pisell-config-provider/context.d.ts +2 -0
  25. package/es/components/pisell-config-provider/index.d.ts +1 -0
  26. package/es/components/pisellAdjustPrice/index.js +5 -1
  27. package/es/components/pisellAdjustPrice/type.d.ts +2 -0
  28. package/es/components/pisellCardList/index.d.ts +32 -2
  29. package/es/components/pisellCardList/index.js +39 -2
  30. package/es/components/pisellCardList/index.less +9 -1
  31. package/es/components/pisellCheckboxGroup/index.d.ts +3 -0
  32. package/es/components/pisellCheckboxGroup/index.js +9 -4
  33. package/es/components/pisellCheckboxGroup/index.less +28 -1
  34. package/es/components/pisellCustomCheckboxGroup/index.d.ts +16 -0
  35. package/es/components/pisellGoodPassCard/index.d.ts +1 -0
  36. package/es/components/pisellGoodPassCard/index.js +17 -5
  37. package/es/components/pisellText/components/Amount/index.js +2 -1
  38. package/es/components/pisellToast/index.d.ts +1 -0
  39. package/es/components/pisellToast/index.js +4 -0
  40. package/es/components/pisellToast/squareToast/index.d.ts +15 -0
  41. package/es/components/pisellToast/squareToast/index.js +28 -0
  42. package/es/components/pisellToast/squareToast/index.less +60 -0
  43. package/es/components/pisellToast/squareToast/methods.d.ts +13 -0
  44. package/es/components/pisellToast/squareToast/methods.js +136 -0
  45. package/es/components/pisellToast/squareToast/renderImperatively.d.ts +28 -0
  46. package/es/components/pisellToast/squareToast/renderImperatively.js +190 -0
  47. package/es/components/pisellToast/squareToast/toast.d.ts +25 -0
  48. package/es/components/pisellToast/squareToast/toast.js +60 -0
  49. package/es/components/pisellWalletPassCard/index.d.ts +53 -1
  50. package/es/components/pisellWalletPassCard/index.js +333 -73
  51. package/es/components/pisellWalletPassCard/index.less +47 -9
  52. package/es/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +3 -0
  53. package/es/components/productCard/cartSkuCard/components/AmountFooter/index.js +80 -0
  54. package/es/components/productCard/cartSkuCard/components/AmountFooter/index.less +75 -0
  55. package/es/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +3 -0
  56. package/es/components/productCard/cartSkuCard/components/MultiDay/index.js +82 -0
  57. package/es/components/productCard/cartSkuCard/components/MultiDay/index.less +31 -0
  58. package/es/components/productCard/cartSkuCard/components/MultiDay/utils.d.ts +14 -0
  59. package/es/components/productCard/cartSkuCard/components/MultiDay/utils.js +56 -0
  60. package/es/components/productCard/cartSkuCard/components/Note/index.d.ts +3 -0
  61. package/es/components/productCard/cartSkuCard/components/Note/index.js +29 -0
  62. package/es/components/productCard/cartSkuCard/components/Note/index.less +27 -0
  63. package/es/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +28 -0
  64. package/es/components/productCard/cartSkuCard/components/basicInfo/index.js +94 -0
  65. package/es/components/productCard/cartSkuCard/components/basicInfo/index.less +117 -0
  66. package/es/components/productCard/cartSkuCard/components/discountReason/index.d.ts +2 -0
  67. package/es/components/productCard/cartSkuCard/components/discountReason/index.js +51 -0
  68. package/es/components/productCard/cartSkuCard/components/holders/index.d.ts +3 -0
  69. package/es/components/productCard/cartSkuCard/components/holders/index.js +49 -0
  70. package/es/components/productCard/cartSkuCard/components/holders/index.less +47 -0
  71. package/es/components/productCard/cartSkuCard/components/packages/index.d.ts +10 -0
  72. package/es/components/productCard/cartSkuCard/components/packages/index.js +52 -0
  73. package/es/components/productCard/cartSkuCard/components/packages/index.less +22 -0
  74. package/es/components/productCard/cartSkuCard/components/packages/utils.d.ts +20 -0
  75. package/es/components/productCard/cartSkuCard/components/packages/utils.js +40 -0
  76. package/es/components/productCard/cartSkuCard/components/resources/index.d.ts +3 -0
  77. package/es/components/productCard/cartSkuCard/components/resources/index.js +39 -0
  78. package/es/components/productCard/cartSkuCard/components/resources/index.less +19 -0
  79. package/es/components/productCard/cartSkuCard/components/sales/index.d.ts +12 -0
  80. package/es/components/productCard/cartSkuCard/components/sales/index.js +57 -0
  81. package/es/components/productCard/cartSkuCard/components/sales/index.less +22 -0
  82. package/es/components/productCard/cartSkuCard/components/specs/index.d.ts +3 -0
  83. package/es/components/productCard/cartSkuCard/components/specs/index.js +44 -0
  84. package/es/components/productCard/cartSkuCard/components/specs/index.less +34 -0
  85. package/es/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +46 -0
  86. package/es/components/productCard/cartSkuCard/components/swipeAction/index.js +360 -0
  87. package/es/components/productCard/cartSkuCard/components/swipeAction/index.less +74 -0
  88. package/es/components/productCard/cartSkuCard/components/timeRange/index.d.ts +6 -0
  89. package/es/components/productCard/cartSkuCard/components/timeRange/index.js +54 -0
  90. package/es/components/productCard/cartSkuCard/components/timeRange/index.less +38 -0
  91. package/es/components/productCard/cartSkuCard/index.d.ts +10 -0
  92. package/es/components/productCard/cartSkuCard/index.js +194 -0
  93. package/es/components/productCard/cartSkuCard/index.less +33 -0
  94. package/es/components/productCard/cartSkuCard/locales.d.ts +99 -0
  95. package/es/components/productCard/cartSkuCard/locales.js +33 -0
  96. package/es/components/productCard/components/Action/index.js +14 -1
  97. package/es/components/productCard/components/Action/index.less +3 -0
  98. package/es/components/productCard/components/Header/index.js +23 -8
  99. package/es/components/productCard/components/Header/index.less +16 -1
  100. package/es/components/productCard/components/Sales/index.js +2 -2
  101. package/es/components/productCard/components/Time/components/SelectHolderModal/index.js +3 -1
  102. package/es/components/productCard/components/Time/components/SelectHolderModal/index.less +3 -0
  103. package/es/components/productCard/index.d.ts +3 -1
  104. package/es/components/productCard/index.js +7 -2
  105. package/es/components/productCard/index.less +6 -0
  106. package/es/components/productCard/locales.js +3 -0
  107. package/es/components/productCard/status.js +1 -0
  108. package/es/components/productCard/types.d.ts +1 -0
  109. package/es/components/productCard/utils.js +8 -1
  110. package/es/components/select-time/index.d.ts +14 -0
  111. package/es/components/table/Table/AddFieldModal/index.d.ts +1 -0
  112. package/es/components/table/Table/AddFieldModal/index.js +13 -13
  113. package/es/components/table/Table/AddFieldModal/index.less +11 -11
  114. package/es/components/table/Table/utils.d.ts +1 -1
  115. package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +5 -1
  116. package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.js +21 -7
  117. package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.less +9 -5
  118. package/es/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +4 -0
  119. package/es/components/virtual-keyboard/BaseNumberKeyboard/index.js +44 -25
  120. package/es/components/virtual-keyboard/Number/index.js +4 -1
  121. package/es/components/virtual-keyboard/Number/types.d.ts +1 -0
  122. package/es/components/virtual-keyboard/index.d.ts +11 -0
  123. package/es/components/virtual-keyboard/index.js +88 -3
  124. package/es/components/virtual-keyboard/index.less +33 -1
  125. package/es/components/virtualInput/BaseVirtualInput/index.d.ts +40 -0
  126. package/es/components/virtualInput/BaseVirtualInput/index.js +163 -0
  127. package/es/components/virtualInput/BaseVirtualInput/index.less +77 -0
  128. package/es/components/virtualInput/index.d.ts +24 -0
  129. package/es/components/virtualInput/index.js +60 -0
  130. package/es/components/virtualInput/index.less +42 -0
  131. package/es/index.d.ts +5 -1
  132. package/es/index.js +5 -2
  133. package/es/locales/en-US.d.ts +19 -2
  134. package/es/locales/en-US.js +29 -6
  135. package/es/locales/zh-CN.d.ts +19 -2
  136. package/es/locales/zh-CN.js +29 -6
  137. package/es/locales/zh-TW.d.ts +19 -2
  138. package/es/locales/zh-TW.js +28 -6
  139. package/lib/components/TimeResourceSelector/index.d.ts +21 -0
  140. package/lib/components/auto-resize-text/auto-text-size-standalone.d.ts +20 -0
  141. package/lib/components/auto-resize-text/auto-text-size-standalone.js +273 -0
  142. package/lib/components/auto-resize-text/index.d.ts +6 -0
  143. package/lib/components/auto-resize-text/index.js +71 -0
  144. package/lib/components/cardPro/index.js +3 -2
  145. package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
  146. package/lib/components/dataSourceComponents/fields/index.d.ts +16 -16
  147. package/lib/components/iconfont/index.js +1 -1
  148. package/lib/components/keyboard/index.d.ts +22 -0
  149. package/lib/components/keyboard/index.js +223 -0
  150. package/lib/components/keyboard/index.less +44 -0
  151. package/lib/components/page/index.js +3 -2
  152. package/lib/components/pisell-config-provider/context.d.ts +2 -0
  153. package/lib/components/pisell-config-provider/index.d.ts +1 -0
  154. package/lib/components/pisellAdjustPrice/index.js +4 -0
  155. package/lib/components/pisellAdjustPrice/type.d.ts +2 -0
  156. package/lib/components/pisellCardList/index.d.ts +32 -2
  157. package/lib/components/pisellCardList/index.js +39 -2
  158. package/lib/components/pisellCardList/index.less +9 -1
  159. package/lib/components/pisellCheckboxGroup/index.d.ts +3 -0
  160. package/lib/components/pisellCheckboxGroup/index.js +6 -1
  161. package/lib/components/pisellCheckboxGroup/index.less +28 -1
  162. package/lib/components/pisellCustomCheckboxGroup/index.d.ts +16 -0
  163. package/lib/components/pisellGoodPassCard/index.d.ts +1 -0
  164. package/lib/components/pisellGoodPassCard/index.js +31 -4
  165. package/lib/components/pisellText/components/Amount/index.js +2 -1
  166. package/lib/components/pisellToast/index.d.ts +1 -0
  167. package/lib/components/pisellToast/index.js +10 -1
  168. package/lib/components/pisellToast/squareToast/index.d.ts +15 -0
  169. package/lib/components/pisellToast/squareToast/index.js +58 -0
  170. package/lib/components/pisellToast/squareToast/index.less +60 -0
  171. package/lib/components/pisellToast/squareToast/methods.d.ts +13 -0
  172. package/lib/components/pisellToast/squareToast/methods.js +150 -0
  173. package/lib/components/pisellToast/squareToast/renderImperatively.d.ts +28 -0
  174. package/lib/components/pisellToast/squareToast/renderImperatively.js +162 -0
  175. package/lib/components/pisellToast/squareToast/toast.d.ts +25 -0
  176. package/lib/components/pisellToast/squareToast/toast.js +88 -0
  177. package/lib/components/pisellWalletPassCard/index.d.ts +53 -1
  178. package/lib/components/pisellWalletPassCard/index.js +257 -59
  179. package/lib/components/pisellWalletPassCard/index.less +47 -9
  180. package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +3 -0
  181. package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.js +80 -0
  182. package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.less +75 -0
  183. package/lib/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +3 -0
  184. package/lib/components/productCard/cartSkuCard/components/MultiDay/index.js +71 -0
  185. package/lib/components/productCard/cartSkuCard/components/MultiDay/index.less +31 -0
  186. package/lib/components/productCard/cartSkuCard/components/MultiDay/utils.d.ts +14 -0
  187. package/lib/components/productCard/cartSkuCard/components/MultiDay/utils.js +77 -0
  188. package/lib/components/productCard/cartSkuCard/components/Note/index.d.ts +3 -0
  189. package/lib/components/productCard/cartSkuCard/components/Note/index.js +56 -0
  190. package/lib/components/productCard/cartSkuCard/components/Note/index.less +27 -0
  191. package/lib/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +28 -0
  192. package/lib/components/productCard/cartSkuCard/components/basicInfo/index.js +83 -0
  193. package/lib/components/productCard/cartSkuCard/components/basicInfo/index.less +117 -0
  194. package/lib/components/productCard/cartSkuCard/components/discountReason/index.d.ts +2 -0
  195. package/lib/components/productCard/cartSkuCard/components/discountReason/index.js +70 -0
  196. package/lib/components/productCard/cartSkuCard/components/holders/index.d.ts +3 -0
  197. package/lib/components/productCard/cartSkuCard/components/holders/index.js +64 -0
  198. package/lib/components/productCard/cartSkuCard/components/holders/index.less +47 -0
  199. package/lib/components/productCard/cartSkuCard/components/packages/index.d.ts +10 -0
  200. package/lib/components/productCard/cartSkuCard/components/packages/index.js +73 -0
  201. package/lib/components/productCard/cartSkuCard/components/packages/index.less +22 -0
  202. package/lib/components/productCard/cartSkuCard/components/packages/utils.d.ts +20 -0
  203. package/lib/components/productCard/cartSkuCard/components/packages/utils.js +44 -0
  204. package/lib/components/productCard/cartSkuCard/components/resources/index.d.ts +3 -0
  205. package/lib/components/productCard/cartSkuCard/components/resources/index.js +71 -0
  206. package/lib/components/productCard/cartSkuCard/components/resources/index.less +19 -0
  207. package/lib/components/productCard/cartSkuCard/components/sales/index.d.ts +12 -0
  208. package/lib/components/productCard/cartSkuCard/components/sales/index.js +77 -0
  209. package/lib/components/productCard/cartSkuCard/components/sales/index.less +22 -0
  210. package/lib/components/productCard/cartSkuCard/components/specs/index.d.ts +3 -0
  211. package/lib/components/productCard/cartSkuCard/components/specs/index.js +66 -0
  212. package/lib/components/productCard/cartSkuCard/components/specs/index.less +34 -0
  213. package/lib/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +46 -0
  214. package/lib/components/productCard/cartSkuCard/components/swipeAction/index.js +373 -0
  215. package/lib/components/productCard/cartSkuCard/components/swipeAction/index.less +74 -0
  216. package/lib/components/productCard/cartSkuCard/components/timeRange/index.d.ts +6 -0
  217. package/lib/components/productCard/cartSkuCard/components/timeRange/index.js +68 -0
  218. package/lib/components/productCard/cartSkuCard/components/timeRange/index.less +38 -0
  219. package/lib/components/productCard/cartSkuCard/index.d.ts +10 -0
  220. package/lib/components/productCard/cartSkuCard/index.js +229 -0
  221. package/lib/components/productCard/cartSkuCard/index.less +33 -0
  222. package/lib/components/productCard/cartSkuCard/locales.d.ts +99 -0
  223. package/lib/components/productCard/cartSkuCard/locales.js +64 -0
  224. package/lib/components/productCard/components/Action/index.js +9 -0
  225. package/lib/components/productCard/components/Action/index.less +3 -0
  226. package/lib/components/productCard/components/Header/index.js +21 -11
  227. package/lib/components/productCard/components/Header/index.less +16 -1
  228. package/lib/components/productCard/components/Sales/index.js +2 -2
  229. package/lib/components/productCard/components/Time/components/SelectHolderModal/index.js +1 -1
  230. package/lib/components/productCard/components/Time/components/SelectHolderModal/index.less +3 -0
  231. package/lib/components/productCard/index.d.ts +3 -1
  232. package/lib/components/productCard/index.js +7 -2
  233. package/lib/components/productCard/index.less +6 -0
  234. package/lib/components/productCard/locales.js +12 -3
  235. package/lib/components/productCard/status.js +1 -0
  236. package/lib/components/productCard/types.d.ts +1 -0
  237. package/lib/components/productCard/utils.js +8 -1
  238. package/lib/components/select-time/index.d.ts +14 -0
  239. package/lib/components/table/Table/AddFieldModal/index.d.ts +1 -0
  240. package/lib/components/table/Table/AddFieldModal/index.js +9 -9
  241. package/lib/components/table/Table/AddFieldModal/index.less +11 -11
  242. package/lib/components/table/Table/utils.d.ts +1 -1
  243. package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +5 -1
  244. package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.js +19 -2
  245. package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.less +9 -5
  246. package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +4 -0
  247. package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.js +45 -27
  248. package/lib/components/virtual-keyboard/Number/index.js +3 -0
  249. package/lib/components/virtual-keyboard/Number/types.d.ts +1 -0
  250. package/lib/components/virtual-keyboard/index.d.ts +11 -0
  251. package/lib/components/virtual-keyboard/index.js +60 -2
  252. package/lib/components/virtual-keyboard/index.less +33 -1
  253. package/lib/components/virtualInput/BaseVirtualInput/index.d.ts +40 -0
  254. package/lib/components/virtualInput/BaseVirtualInput/index.js +179 -0
  255. package/lib/components/virtualInput/BaseVirtualInput/index.less +77 -0
  256. package/lib/components/virtualInput/index.d.ts +24 -0
  257. package/lib/components/virtualInput/index.js +102 -0
  258. package/lib/components/virtualInput/index.less +42 -0
  259. package/lib/index.d.ts +5 -1
  260. package/lib/index.js +11 -0
  261. package/lib/locales/en-US.d.ts +19 -2
  262. package/lib/locales/en-US.js +24 -5
  263. package/lib/locales/zh-CN.d.ts +19 -2
  264. package/lib/locales/zh-CN.js +24 -5
  265. package/lib/locales/zh-TW.d.ts +19 -2
  266. package/lib/locales/zh-TW.js +23 -5
  267. package/package.json +4 -4
  268. package/es/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +0 -12
  269. package/lib/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +0 -12
@@ -37,6 +37,8 @@ var import_Keyboard = __toESM(require("./Keyboard"));
37
37
  var import_VirtualKeyInput = __toESM(require("./VirtualKeyInput"));
38
38
  var import_index = require("./index.less");
39
39
  var import_classnames = __toESM(require("classnames"));
40
+ var import_utils = require("@pisell/utils");
41
+ var import_usePisellConfig = __toESM(require("../pisell-config-provider/hooks/usePisellConfig"));
40
42
  var items = [
41
43
  {
42
44
  value: 1,
@@ -105,6 +107,32 @@ var items = [
105
107
  type: "primary"
106
108
  }
107
109
  ];
110
+ var virtualKeyboardThemeConfig = {
111
+ dark: {
112
+ backgroundColor: "rgba(0, 0, 0, 0.70)",
113
+ containerBackgroundColor: "rgba(0, 0, 0, 0.40)",
114
+ buttonBackgroundColor: "#ffffff",
115
+ textColor: "#000000",
116
+ keyboardBackgroundColor: "rgba(0, 0, 0, 0.40)",
117
+ keyboardButtonBackgroundColor: "#ffffff",
118
+ keyboardButtonTextColor: "#000000",
119
+ keyboardButtonHoverColor: "#f5f5f5",
120
+ primaryButtonBackgroundColor: "#4ca30d",
121
+ primaryButtonTextColor: "#ffffff"
122
+ },
123
+ light: {
124
+ backgroundColor: "#ffffff",
125
+ containerBackgroundColor: "#d0d5dd",
126
+ buttonBackgroundColor: "#ffffff",
127
+ textColor: "#000000",
128
+ keyboardBackgroundColor: "#f9f9f9",
129
+ keyboardButtonBackgroundColor: "#ffffff",
130
+ keyboardButtonTextColor: "#000000",
131
+ keyboardButtonHoverColor: "#f5f5f5",
132
+ primaryButtonBackgroundColor: "#4ca30d",
133
+ primaryButtonTextColor: "#ffffff"
134
+ }
135
+ };
108
136
  var VirtualKeyboard = (props) => {
109
137
  const {
110
138
  virtualKeyInputProps,
@@ -113,15 +141,45 @@ var VirtualKeyboard = (props) => {
113
141
  keyboardProps,
114
142
  onChange,
115
143
  value,
116
- rightPanel
144
+ rightPanel,
145
+ selectType = "light",
146
+ ...others
117
147
  } = props;
148
+ const config = (0, import_usePisellConfig.default)();
118
149
  (0, import_react.useEffect)(() => {
119
150
  document.body.id = "body";
120
151
  }, []);
152
+ const configColor = (0, import_react.useMemo)(() => {
153
+ const currentConfig = virtualKeyboardThemeConfig[selectType];
154
+ const validProps = Object.entries(props).reduce((acc, [key, value2]) => {
155
+ if (value2 !== void 0 && key in currentConfig) {
156
+ acc[key] = value2;
157
+ }
158
+ return acc;
159
+ }, {});
160
+ return { ...currentConfig, ...validProps };
161
+ }, [selectType, props]);
162
+ (0, import_react.useEffect)(() => {
163
+ (0, import_utils.setTheme)({
164
+ "--virtual-keyboard-background-color": configColor.backgroundColor,
165
+ "--virtual-keyboard-container-background-color": configColor.containerBackgroundColor,
166
+ "--virtual-keyboard-button-background-color": configColor.buttonBackgroundColor,
167
+ "--virtual-keyboard-text-color": configColor.textColor,
168
+ "--virtual-keyboard-keyboard-background-color": configColor.keyboardBackgroundColor,
169
+ "--virtual-keyboard-keyboard-button-background-color": configColor.keyboardButtonBackgroundColor,
170
+ "--virtual-keyboard-keyboard-button-text-color": configColor.keyboardButtonTextColor,
171
+ "--virtual-keyboard-keyboard-button-hover-color": configColor.keyboardButtonHoverColor,
172
+ "--virtual-keyboard-primary-button-background-color": configColor.primaryButtonBackgroundColor,
173
+ "--virtual-keyboard-primary-button-text-color": configColor.primaryButtonTextColor
174
+ });
175
+ }, [configColor]);
121
176
  return /* @__PURE__ */ import_react.default.createElement(
122
177
  "div",
123
178
  {
124
- className: (0, import_classnames.default)("virtual-keyboard-component", className),
179
+ className: (0, import_classnames.default)("virtual-keyboard-component", className, {
180
+ "virtual-keyboard-component-dark": selectType === "dark",
181
+ "virtual-keyboard-component-light": selectType === "light"
182
+ }),
125
183
  style
126
184
  },
127
185
  /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("virtual-keyboard-component-left") }, /* @__PURE__ */ import_react.default.createElement(import_VirtualKeyInput.default, { ...virtualKeyInputProps }), /* @__PURE__ */ import_react.default.createElement(import_Keyboard.default, { items, ...keyboardProps })),
@@ -2,14 +2,46 @@
2
2
  display: flex;
3
3
  align-items: center;
4
4
  gap: 20px;
5
+ background-color: var(--virtual-keyboard-background-color, #ffffff);
6
+
7
+ &.virtual-keyboard-component-dark {
8
+ background-color: var(--virtual-keyboard-background-color, rgba(0, 0, 0, 0.70));
9
+ }
10
+
11
+ &.virtual-keyboard-component-light {
12
+ background-color: var(--virtual-keyboard-background-color, #ffffff);
13
+ }
5
14
  }
6
15
 
7
16
  .virtual-keyboard-component-left {
8
17
  padding: 10px;
9
18
  width: 380px;
10
19
  border-radius: 10px;
11
- background: var(--Gray-300, #D0D5DD);
20
+ background: var(--virtual-keyboard-container-background-color, #D0D5DD);
12
21
  backdrop-filter: blur(50px);
22
+
23
+ .pisell-virtual-keyboard-input {
24
+ background-color: var(--virtual-keyboard-button-background-color, #ffffff);
25
+ color: var(--virtual-keyboard-text-color, #000000);
26
+ }
27
+
28
+ .pisell-keyboard {
29
+ background-color: var(--virtual-keyboard-keyboard-background-color, #f9f9f9);
30
+
31
+ .pisell-keyboard-item {
32
+ background-color: var(--virtual-keyboard-keyboard-button-background-color, #ffffff);
33
+ color: var(--virtual-keyboard-keyboard-button-text-color, #000000);
34
+
35
+ &:hover {
36
+ background-color: var(--virtual-keyboard-keyboard-button-hover-color, #f5f5f5);
37
+ }
38
+
39
+ &.pisell-keyboard-item-primary {
40
+ background-color: var(--virtual-keyboard-primary-button-background-color, #4ca30d);
41
+ color: var(--virtual-keyboard-primary-button-text-color, #ffffff);
42
+ }
43
+ }
44
+ }
13
45
  }
14
46
 
15
47
  .virtual-keyboard-component-right {
@@ -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
+ }
package/lib/index.d.ts CHANGED
@@ -92,11 +92,12 @@ export { default as PisellScan } from './components/pisellScan';
92
92
  export { default as PisellStatisticList } from './components/pisellStatisticList';
93
93
  export { default as PisellTags } from './components/pisellTags';
94
94
  export { default as PisellText } from './components/pisellText';
95
- export { default as PisellToast } from './components/pisellToast';
95
+ export { default as PisellToast, useToast } from './components/pisellToast';
96
96
  export { default as PisellTooltip } from './components/pisellTooltip';
97
97
  export { default as PisellUpload } from './components/pisellUpload';
98
98
  export { default as PisellViewGrid } from './components/pisellViewGrid';
99
99
  export { default as PisellWalletPassCard } from './components/pisellWalletPassCard';
100
+ export type { PisellWalletPassCardProps } from './components/pisellWalletPassCard';
100
101
  export { default as ProfileMenu } from './components/profileMenu';
101
102
  export { default as QRCode } from './components/qrcode';
102
103
  export { default as Radio } from './components/radio';
@@ -140,3 +141,6 @@ export { default as SectionFooters } from './components/section-footers';
140
141
  export { default as ProductCard } from './components/productCard';
141
142
  export { default as Collapse } from './components/collapse';
142
143
  export { default as PisellGoodPassCard } from './components/pisellGoodPassCard';
144
+ export { default as Keyboard } from './components/keyboard';
145
+ export { default as VirtualInput } from './components/virtualInput';
146
+ export { default as AutoResizeText } from './components/auto-resize-text';