@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
@@ -29,7 +29,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  // src/components/pisellToast/index.tsx
30
30
  var pisellToast_exports = {};
31
31
  __export(pisellToast_exports, {
32
- default: () => pisellToast_default
32
+ default: () => pisellToast_default,
33
+ useToast: () => import_squareToast.useToast
33
34
  });
34
35
  module.exports = __toCommonJS(pisellToast_exports);
35
36
  var import_react = __toESM(require("react"));
@@ -37,9 +38,13 @@ var import_utils = require("@pisell/utils");
37
38
  var import_pisellMessage = require("../pisellMessage");
38
39
  var import_iconfont = __toESM(require("../iconfont"));
39
40
  var import_index = require("./index.less");
41
+ var import_squareToast = require("./squareToast");
40
42
  var PisellToast = (props) => {
41
43
  const { content, duration, showAction, actionText, onClose } = props;
42
44
  const key = (0, import_utils.getUniqueId)();
45
+ if (!import_pisellMessage.message) {
46
+ return alert(content);
47
+ }
43
48
  import_pisellMessage.message.open({
44
49
  key,
45
50
  content: /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-toast-content" }, /* @__PURE__ */ import_react.default.createElement("span", null, content), showAction && /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-toast-action" }, actionText), /* @__PURE__ */ import_react.default.createElement(
@@ -57,3 +62,7 @@ var PisellToast = (props) => {
57
62
  });
58
63
  };
59
64
  var pisellToast_default = PisellToast;
65
+ // Annotate the CommonJS export names for ESM import in node:
66
+ 0 && (module.exports = {
67
+ useToast
68
+ });
@@ -0,0 +1,15 @@
1
+ import { clear, show, success, info, loading, fail, hide } from './methods';
2
+ import './index.less';
3
+ interface ToastInstance {
4
+ show: typeof show;
5
+ clear: typeof clear;
6
+ success: typeof success;
7
+ info: typeof info;
8
+ loading: typeof loading;
9
+ fail: typeof fail;
10
+ error: typeof fail;
11
+ hide: typeof hide;
12
+ }
13
+ declare const Toast: ToastInstance;
14
+ export declare const useToast: () => ToastInstance;
15
+ export default Toast;
@@ -0,0 +1,58 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/components/pisellToast/squareToast/index.tsx
20
+ var squareToast_exports = {};
21
+ __export(squareToast_exports, {
22
+ default: () => squareToast_default,
23
+ useToast: () => useToast
24
+ });
25
+ module.exports = __toCommonJS(squareToast_exports);
26
+ var import_react = require("react");
27
+ var import_methods = require("./methods");
28
+ var import_index = require("./index.less");
29
+ var Toast = {
30
+ show: import_methods.show,
31
+ clear: import_methods.clear,
32
+ success: import_methods.success,
33
+ info: import_methods.info,
34
+ loading: import_methods.loading,
35
+ fail: import_methods.fail,
36
+ error: import_methods.fail,
37
+ hide: import_methods.hide
38
+ };
39
+ var useToast = () => {
40
+ return (0, import_react.useMemo)(
41
+ () => ({
42
+ show: import_methods.show,
43
+ clear: import_methods.clear,
44
+ success: import_methods.success,
45
+ info: import_methods.info,
46
+ loading: import_methods.loading,
47
+ fail: import_methods.fail,
48
+ error: import_methods.fail,
49
+ hide: import_methods.hide
50
+ }),
51
+ []
52
+ );
53
+ };
54
+ var squareToast_default = Toast;
55
+ // Annotate the CommonJS export names for ESM import in node:
56
+ 0 && (module.exports = {
57
+ useToast
58
+ });
@@ -0,0 +1,60 @@
1
+ .pisell-square-toast-wrap {
2
+ pointer-events: none;
3
+ }
4
+
5
+ .pisell-square-toast-modal {
6
+ pointer-events: none;
7
+ user-select: none;
8
+ min-width: 190px;
9
+ min-height: 74px;
10
+
11
+ // Toast 容器
12
+ .pisell-square-toast {
13
+ min-width: 190px;
14
+ max-width: 201px;
15
+ display: flex;
16
+ align-items: center;
17
+ justify-content: center;
18
+ flex-direction: column;
19
+ padding: 32px 12px;
20
+ border-radius: 8px;
21
+ overflow: hidden;
22
+ background: rgba(0, 0, 0, 0.8);
23
+
24
+ .pisell-square-toast-icon-wrapper {
25
+ display: flex;
26
+ align-items: center;
27
+ justify-content: center;
28
+ margin-bottom: 11px;
29
+
30
+ .pisell-square-toast-icon {
31
+ font-size: 50px;
32
+ color: #ffffff;
33
+ width: 50px;
34
+ height: 50px;
35
+ display: flex;
36
+ align-items: center;
37
+ justify-content: center;
38
+
39
+ &-loading {
40
+ animation: fadenum 1s infinite linear;
41
+ }
42
+ }
43
+ }
44
+
45
+ // 内容区域
46
+ .pisell-square-toast-content {
47
+ font-size: 20px;
48
+ line-height: 1.5;
49
+ color: #ffffff;
50
+ text-align: center;
51
+ }
52
+ }
53
+ }
54
+
55
+ // loading 旋转动画
56
+ @keyframes fadenum {
57
+ to {
58
+ transform: rotate(360deg);
59
+ }
60
+ }
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { ToastProps } from './toast';
3
+ interface ToastInstance {
4
+ close: () => void;
5
+ }
6
+ declare const show: (configOrContent: Partial<ToastProps> | React.ReactNode, duration?: number, afterClose?: () => void) => ToastInstance;
7
+ declare const clear: () => void;
8
+ declare const success: (content: React.ReactNode, duration?: number, afterClose?: () => void) => ToastInstance;
9
+ declare const info: (content: React.ReactNode, duration?: number, afterClose?: () => void) => ToastInstance;
10
+ declare const loading: (content: React.ReactNode, duration?: number, afterClose?: () => void) => ToastInstance;
11
+ declare const fail: (content: React.ReactNode, duration?: number, afterClose?: () => void) => ToastInstance;
12
+ declare const hide: () => void;
13
+ export { show, clear, success, info, loading, fail, hide };
@@ -0,0 +1,150 @@
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/pisellToast/squareToast/methods.tsx
30
+ var methods_exports = {};
31
+ __export(methods_exports, {
32
+ clear: () => clear,
33
+ fail: () => fail,
34
+ hide: () => hide,
35
+ info: () => info,
36
+ loading: () => loading,
37
+ show: () => show,
38
+ success: () => success
39
+ });
40
+ module.exports = __toCommonJS(methods_exports);
41
+ var import_react = __toESM(require("react"));
42
+ var import_toast = __toESM(require("./toast"));
43
+ var import_renderImperatively = require("./renderImperatively");
44
+ var currentHandler = null;
45
+ var currentTimeout = null;
46
+ var defaultProps = {
47
+ duration: 2e3,
48
+ mask: false,
49
+ icon: "info"
50
+ };
51
+ function mergeProps(a, b) {
52
+ const filteredB = Object.keys(b).reduce((acc, key) => {
53
+ if (b[key] !== void 0) {
54
+ acc[key] = b[key];
55
+ }
56
+ return acc;
57
+ }, {});
58
+ return {
59
+ ...a,
60
+ ...filteredB
61
+ };
62
+ }
63
+ var show = (configOrContent, duration, afterClose) => {
64
+ var _a;
65
+ let props;
66
+ if (typeof configOrContent === "string" || import_react.default.isValidElement(configOrContent)) {
67
+ props = mergeProps(defaultProps, {
68
+ content: configOrContent,
69
+ ...duration !== void 0 && { duration },
70
+ ...afterClose !== void 0 && { afterClose }
71
+ });
72
+ } else {
73
+ props = mergeProps(defaultProps, configOrContent || {});
74
+ }
75
+ const element = /* @__PURE__ */ import_react.default.createElement(
76
+ import_toast.default,
77
+ {
78
+ ...props,
79
+ onCancel: () => {
80
+ currentHandler = null;
81
+ }
82
+ }
83
+ );
84
+ if (currentHandler) {
85
+ if ((_a = currentHandler.isRendered) == null ? void 0 : _a.call(currentHandler)) {
86
+ currentHandler.replace(element);
87
+ } else {
88
+ currentHandler.close();
89
+ currentHandler = (0, import_renderImperatively.renderImperatively)(element);
90
+ }
91
+ } else {
92
+ currentHandler = (0, import_renderImperatively.renderImperatively)(element);
93
+ }
94
+ if (currentTimeout) {
95
+ window.clearTimeout(currentTimeout);
96
+ }
97
+ if (props.duration !== 0) {
98
+ currentTimeout = window.setTimeout(() => {
99
+ clear();
100
+ }, props.duration);
101
+ }
102
+ const instance = {
103
+ close: () => {
104
+ if (currentHandler) {
105
+ currentHandler.close();
106
+ currentHandler = null;
107
+ }
108
+ if (currentTimeout) {
109
+ window.clearTimeout(currentTimeout);
110
+ currentTimeout = null;
111
+ }
112
+ }
113
+ };
114
+ return instance;
115
+ };
116
+ var clear = () => {
117
+ if (currentHandler) {
118
+ currentHandler.close();
119
+ currentHandler = null;
120
+ }
121
+ if (currentTimeout) {
122
+ window.clearTimeout(currentTimeout);
123
+ currentTimeout = null;
124
+ }
125
+ };
126
+ var success = (content, duration, afterClose) => {
127
+ return show({ content, icon: "success", duration, afterClose });
128
+ };
129
+ var info = (content, duration, afterClose) => {
130
+ return show({ content, icon: "info", duration, afterClose });
131
+ };
132
+ var loading = (content, duration, afterClose) => {
133
+ return show({ content, icon: "loading", duration, afterClose });
134
+ };
135
+ var fail = (content, duration, afterClose) => {
136
+ return show({ content, icon: "error", duration, afterClose });
137
+ };
138
+ var hide = () => {
139
+ clear();
140
+ };
141
+ // Annotate the CommonJS export names for ESM import in node:
142
+ 0 && (module.exports = {
143
+ clear,
144
+ fail,
145
+ hide,
146
+ info,
147
+ loading,
148
+ show,
149
+ success
150
+ });
@@ -0,0 +1,28 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { Root } from 'react-dom/client';
3
+ import React from 'react';
4
+ declare type ImperativeProps = {
5
+ open?: boolean;
6
+ onCancel?: () => void;
7
+ afterClose?: () => void;
8
+ };
9
+ declare type TargetElement = ReactElement<ImperativeProps>;
10
+ export declare type ImperativeHandler = {
11
+ close: () => void;
12
+ replace: (element: TargetElement) => void;
13
+ isRendered?: () => boolean;
14
+ };
15
+ export declare type UnmountType = () => Promise<void>;
16
+ export declare type RenderType = (node: React.ReactElement, container: Element | DocumentFragment) => UnmountType;
17
+ declare const MARK = "__pisell_react_root__";
18
+ declare type ContainerType = (Element | DocumentFragment) & {
19
+ [MARK]?: Root;
20
+ };
21
+ export declare function render(node: React.ReactElement, container: ContainerType): void;
22
+ export declare function unmount(container: ContainerType): Promise<void>;
23
+ /**
24
+ * @deprecated 设置 React 渲染函数以兼容使用。
25
+ */
26
+ export declare function unstableSetRender(render?: RenderType): RenderType;
27
+ export declare function renderImperatively(element: TargetElement): ImperativeHandler;
28
+ export {};
@@ -0,0 +1,162 @@
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/pisellToast/squareToast/renderImperatively.tsx
30
+ var renderImperatively_exports = {};
31
+ __export(renderImperatively_exports, {
32
+ render: () => render2,
33
+ renderImperatively: () => renderImperatively,
34
+ unmount: () => unmount,
35
+ unstableSetRender: () => unstableSetRender
36
+ });
37
+ module.exports = __toCommonJS(renderImperatively_exports);
38
+ var ReactDOM = __toESM(require("react-dom"));
39
+ var import_react = __toESM(require("react"));
40
+ var MARK = "__pisell_react_root__";
41
+ function render2(node, container) {
42
+ const root = container[MARK];
43
+ if (root) {
44
+ root.render(node);
45
+ return;
46
+ }
47
+ const ReactMajorVersion = parseInt(import_react.default.version.split(".")[0], 10);
48
+ const isReact18OrNewer = ReactMajorVersion >= 18;
49
+ const fallbackCreateRoot = ReactDOM.createRoot;
50
+ if (isReact18OrNewer && fallbackCreateRoot) {
51
+ const root2 = fallbackCreateRoot(container);
52
+ root2.render(node);
53
+ container[MARK] = root2;
54
+ return;
55
+ }
56
+ if (ReactMajorVersion >= 19) {
57
+ console.error(
58
+ "[pisellToast] React 19+ requires `createRoot`. Please call `setCreateRoot(createRoot)` at your app entry."
59
+ );
60
+ }
61
+ ReactDOM.render(node, container);
62
+ }
63
+ async function unmount(container) {
64
+ return Promise.resolve().then(() => {
65
+ var _a;
66
+ if (container[MARK]) {
67
+ (_a = container[MARK]) == null ? void 0 : _a.unmount();
68
+ delete container[MARK];
69
+ } else {
70
+ ReactDOM.unmountComponentAtNode(container);
71
+ }
72
+ });
73
+ }
74
+ var defaultReactRender = (node, container) => {
75
+ render2(node, container);
76
+ return () => {
77
+ return unmount(container);
78
+ };
79
+ };
80
+ var unstableRender = defaultReactRender;
81
+ function unstableSetRender(render3) {
82
+ if (render3) {
83
+ unstableRender = render3;
84
+ }
85
+ return unstableRender;
86
+ }
87
+ var sharedContainer = null;
88
+ function renderToBody(element) {
89
+ if (!sharedContainer) {
90
+ sharedContainer = document.createElement("div");
91
+ document.body.appendChild(sharedContainer);
92
+ }
93
+ const container = sharedContainer;
94
+ return unstableSetRender()(element, container);
95
+ }
96
+ function renderImperatively(element) {
97
+ const Wrapper = import_react.default.forwardRef((_, ref) => {
98
+ const [open, setOpen] = (0, import_react.useState)(false);
99
+ const closedRef = (0, import_react.useRef)(false);
100
+ const [elementToRender, setElementToRender] = (0, import_react.useState)(element);
101
+ const keyRef = (0, import_react.useRef)(0);
102
+ (0, import_react.useEffect)(() => {
103
+ if (!closedRef.current) {
104
+ setOpen(true);
105
+ } else {
106
+ afterClose();
107
+ }
108
+ }, []);
109
+ function onCancel() {
110
+ var _a, _b;
111
+ closedRef.current = true;
112
+ setOpen(false);
113
+ (_b = (_a = elementToRender.props).onCancel) == null ? void 0 : _b.call(_a);
114
+ }
115
+ function afterClose() {
116
+ var _a, _b;
117
+ unmount2();
118
+ (_b = (_a = elementToRender.props).afterClose) == null ? void 0 : _b.call(_a);
119
+ }
120
+ (0, import_react.useImperativeHandle)(ref, () => ({
121
+ close: onCancel,
122
+ replace: (element2) => {
123
+ var _a, _b;
124
+ keyRef.current++;
125
+ (_b = (_a = elementToRender.props).afterClose) == null ? void 0 : _b.call(_a);
126
+ setElementToRender(element2);
127
+ }
128
+ }));
129
+ return import_react.default.cloneElement(elementToRender, {
130
+ ...elementToRender.props,
131
+ key: keyRef.current,
132
+ open,
133
+ onCancel,
134
+ afterClose
135
+ });
136
+ });
137
+ const wrapperRef = import_react.default.createRef();
138
+ const unmount2 = renderToBody(/* @__PURE__ */ import_react.default.createElement(Wrapper, { ref: wrapperRef }));
139
+ return {
140
+ close: async () => {
141
+ var _a, _b, _c;
142
+ if (!wrapperRef.current) {
143
+ unmount2();
144
+ (_b = (_a = element.props).afterClose) == null ? void 0 : _b.call(_a);
145
+ } else {
146
+ (_c = wrapperRef.current) == null ? void 0 : _c.close();
147
+ }
148
+ },
149
+ replace: (element2) => {
150
+ var _a;
151
+ (_a = wrapperRef.current) == null ? void 0 : _a.replace(element2);
152
+ },
153
+ isRendered: () => !!wrapperRef.current
154
+ };
155
+ }
156
+ // Annotate the CommonJS export names for ESM import in node:
157
+ 0 && (module.exports = {
158
+ render,
159
+ renderImperatively,
160
+ unmount,
161
+ unstableSetRender
162
+ });
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ export declare type ToastType = 'success' | 'error' | 'warning' | 'info' | 'loading';
4
+ export interface ToastProps {
5
+ /** Toast 类型 */
6
+ icon?: ToastType | React.ReactNode;
7
+ /** 显示的内容,支持文本或 React 节点 */
8
+ content: React.ReactNode;
9
+ /** 是否显示 */
10
+ open?: boolean;
11
+ /** 自动关闭时间,单位毫秒,0 表示不自动关闭 */
12
+ duration?: number;
13
+ /** 关闭 */
14
+ onCancel?: () => void;
15
+ /** 关闭后回调 */
16
+ afterClose?: () => void;
17
+ /** 自定义样式类名 */
18
+ className?: string;
19
+ /** 自定义样式 */
20
+ style?: React.CSSProperties;
21
+ /** 是否显示遮罩 */
22
+ mask?: boolean;
23
+ }
24
+ declare const Toast: React.FC<ToastProps>;
25
+ export default Toast;
@@ -0,0 +1,88 @@
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/pisellToast/squareToast/toast.tsx
30
+ var toast_exports = {};
31
+ __export(toast_exports, {
32
+ default: () => toast_default
33
+ });
34
+ module.exports = __toCommonJS(toast_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_modal = __toESM(require("../../modal"));
37
+ var import_icon = __toESM(require("../../icon"));
38
+ var import_classnames = __toESM(require("classnames"));
39
+ var import_index = require("./index.less");
40
+ var icons = {
41
+ info: "",
42
+ success: "iconchenggong-1-01",
43
+ error: "icon-warning",
44
+ warning: "icon-warning",
45
+ loading: "icon-loading",
46
+ fail: "icon-warning"
47
+ };
48
+ var Toast = ({
49
+ content,
50
+ open,
51
+ icon,
52
+ className,
53
+ ...rest
54
+ }) => {
55
+ const iconElement = (0, import_react.useMemo)(() => {
56
+ if (icon === null || icon === void 0) return null;
57
+ if (typeof icon === "string" && icon in icons) {
58
+ if (!icons[icon]) return null;
59
+ return /* @__PURE__ */ import_react.default.createElement(
60
+ import_icon.default,
61
+ {
62
+ type: icons[icon],
63
+ className: `pisell-square-toast-icon pisell-square-toast-icon-${icon}`
64
+ }
65
+ );
66
+ }
67
+ return icon;
68
+ }, [icon]);
69
+ return /* @__PURE__ */ import_react.default.createElement(
70
+ import_modal.default,
71
+ {
72
+ open,
73
+ footer: null,
74
+ closable: false,
75
+ centered: true,
76
+ maskTransitionName: "",
77
+ transitionName: "",
78
+ width: "unset",
79
+ wrapClassName: "pisell-square-toast-wrap",
80
+ className: (0, import_classnames.default)("pisell-square-toast-modal", className),
81
+ bodyStyle: { padding: 0 },
82
+ destroyOnClose: true,
83
+ modalRender: () => /* @__PURE__ */ import_react.default.createElement("div", { className: `pisell-square-toast` }, iconElement && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-square-toast-icon-wrapper" }, iconElement), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-square-toast-content" }, content)),
84
+ ...rest
85
+ }
86
+ );
87
+ };
88
+ var toast_default = Toast;