@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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +5 -5
- package/build/lowcode/preview.js +144 -144
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +23 -23
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +23 -23
- package/es/components/TimeResourceSelector/index.d.ts +21 -0
- package/es/components/auto-resize-text/auto-text-size-standalone.d.ts +20 -0
- package/es/components/auto-resize-text/auto-text-size-standalone.js +258 -0
- package/es/components/auto-resize-text/index.d.ts +6 -0
- package/es/components/auto-resize-text/index.js +40 -0
- package/es/components/cardPro/index.js +10 -3
- package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +16 -16
- package/es/components/iconfont/index.js +1 -1
- package/es/components/keyboard/index.d.ts +22 -0
- package/es/components/keyboard/index.js +159 -0
- package/es/components/keyboard/index.less +44 -0
- package/es/components/page/index.js +5 -2
- package/es/components/pisell-config-provider/context.d.ts +2 -0
- package/es/components/pisell-config-provider/index.d.ts +1 -0
- package/es/components/pisellAdjustPrice/index.js +5 -1
- package/es/components/pisellAdjustPrice/type.d.ts +2 -0
- package/es/components/pisellCardList/index.d.ts +32 -2
- package/es/components/pisellCardList/index.js +39 -2
- package/es/components/pisellCardList/index.less +9 -1
- package/es/components/pisellCheckboxGroup/index.d.ts +3 -0
- package/es/components/pisellCheckboxGroup/index.js +9 -4
- package/es/components/pisellCheckboxGroup/index.less +28 -1
- package/es/components/pisellCustomCheckboxGroup/index.d.ts +16 -0
- package/es/components/pisellGoodPassCard/index.d.ts +1 -0
- package/es/components/pisellGoodPassCard/index.js +17 -5
- package/es/components/pisellText/components/Amount/index.js +2 -1
- package/es/components/pisellToast/index.d.ts +1 -0
- package/es/components/pisellToast/index.js +4 -0
- package/es/components/pisellToast/squareToast/index.d.ts +15 -0
- package/es/components/pisellToast/squareToast/index.js +28 -0
- package/es/components/pisellToast/squareToast/index.less +60 -0
- package/es/components/pisellToast/squareToast/methods.d.ts +13 -0
- package/es/components/pisellToast/squareToast/methods.js +136 -0
- package/es/components/pisellToast/squareToast/renderImperatively.d.ts +28 -0
- package/es/components/pisellToast/squareToast/renderImperatively.js +190 -0
- package/es/components/pisellToast/squareToast/toast.d.ts +25 -0
- package/es/components/pisellToast/squareToast/toast.js +60 -0
- package/es/components/pisellWalletPassCard/index.d.ts +53 -1
- package/es/components/pisellWalletPassCard/index.js +333 -73
- package/es/components/pisellWalletPassCard/index.less +47 -9
- package/es/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/AmountFooter/index.js +80 -0
- package/es/components/productCard/cartSkuCard/components/AmountFooter/index.less +75 -0
- package/es/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/MultiDay/index.js +82 -0
- package/es/components/productCard/cartSkuCard/components/MultiDay/index.less +31 -0
- package/es/components/productCard/cartSkuCard/components/MultiDay/utils.d.ts +14 -0
- package/es/components/productCard/cartSkuCard/components/MultiDay/utils.js +56 -0
- package/es/components/productCard/cartSkuCard/components/Note/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/Note/index.js +29 -0
- package/es/components/productCard/cartSkuCard/components/Note/index.less +27 -0
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +28 -0
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.js +94 -0
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.less +117 -0
- package/es/components/productCard/cartSkuCard/components/discountReason/index.d.ts +2 -0
- package/es/components/productCard/cartSkuCard/components/discountReason/index.js +51 -0
- package/es/components/productCard/cartSkuCard/components/holders/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/holders/index.js +49 -0
- package/es/components/productCard/cartSkuCard/components/holders/index.less +47 -0
- package/es/components/productCard/cartSkuCard/components/packages/index.d.ts +10 -0
- package/es/components/productCard/cartSkuCard/components/packages/index.js +52 -0
- package/es/components/productCard/cartSkuCard/components/packages/index.less +22 -0
- package/es/components/productCard/cartSkuCard/components/packages/utils.d.ts +20 -0
- package/es/components/productCard/cartSkuCard/components/packages/utils.js +40 -0
- package/es/components/productCard/cartSkuCard/components/resources/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/resources/index.js +39 -0
- package/es/components/productCard/cartSkuCard/components/resources/index.less +19 -0
- package/es/components/productCard/cartSkuCard/components/sales/index.d.ts +12 -0
- package/es/components/productCard/cartSkuCard/components/sales/index.js +57 -0
- package/es/components/productCard/cartSkuCard/components/sales/index.less +22 -0
- package/es/components/productCard/cartSkuCard/components/specs/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/specs/index.js +44 -0
- package/es/components/productCard/cartSkuCard/components/specs/index.less +34 -0
- package/es/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +46 -0
- package/es/components/productCard/cartSkuCard/components/swipeAction/index.js +360 -0
- package/es/components/productCard/cartSkuCard/components/swipeAction/index.less +74 -0
- package/es/components/productCard/cartSkuCard/components/timeRange/index.d.ts +6 -0
- package/es/components/productCard/cartSkuCard/components/timeRange/index.js +54 -0
- package/es/components/productCard/cartSkuCard/components/timeRange/index.less +38 -0
- package/es/components/productCard/cartSkuCard/index.d.ts +10 -0
- package/es/components/productCard/cartSkuCard/index.js +194 -0
- package/es/components/productCard/cartSkuCard/index.less +33 -0
- package/es/components/productCard/cartSkuCard/locales.d.ts +99 -0
- package/es/components/productCard/cartSkuCard/locales.js +33 -0
- package/es/components/productCard/components/Action/index.js +14 -1
- package/es/components/productCard/components/Action/index.less +3 -0
- package/es/components/productCard/components/Header/index.js +23 -8
- package/es/components/productCard/components/Header/index.less +16 -1
- package/es/components/productCard/components/Sales/index.js +2 -2
- package/es/components/productCard/components/Time/components/SelectHolderModal/index.js +3 -1
- package/es/components/productCard/components/Time/components/SelectHolderModal/index.less +3 -0
- package/es/components/productCard/index.d.ts +3 -1
- package/es/components/productCard/index.js +7 -2
- package/es/components/productCard/index.less +6 -0
- package/es/components/productCard/locales.js +3 -0
- package/es/components/productCard/status.js +1 -0
- package/es/components/productCard/types.d.ts +1 -0
- package/es/components/productCard/utils.js +8 -1
- package/es/components/select-time/index.d.ts +14 -0
- package/es/components/table/Table/AddFieldModal/index.d.ts +1 -0
- package/es/components/table/Table/AddFieldModal/index.js +13 -13
- package/es/components/table/Table/AddFieldModal/index.less +11 -11
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +5 -1
- package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.js +21 -7
- package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.less +9 -5
- package/es/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +4 -0
- package/es/components/virtual-keyboard/BaseNumberKeyboard/index.js +44 -25
- package/es/components/virtual-keyboard/Number/index.js +4 -1
- package/es/components/virtual-keyboard/Number/types.d.ts +1 -0
- package/es/components/virtual-keyboard/index.d.ts +11 -0
- package/es/components/virtual-keyboard/index.js +88 -3
- package/es/components/virtual-keyboard/index.less +33 -1
- package/es/components/virtualInput/BaseVirtualInput/index.d.ts +40 -0
- package/es/components/virtualInput/BaseVirtualInput/index.js +163 -0
- package/es/components/virtualInput/BaseVirtualInput/index.less +77 -0
- package/es/components/virtualInput/index.d.ts +24 -0
- package/es/components/virtualInput/index.js +60 -0
- package/es/components/virtualInput/index.less +42 -0
- package/es/index.d.ts +5 -1
- package/es/index.js +5 -2
- package/es/locales/en-US.d.ts +19 -2
- package/es/locales/en-US.js +29 -6
- package/es/locales/zh-CN.d.ts +19 -2
- package/es/locales/zh-CN.js +29 -6
- package/es/locales/zh-TW.d.ts +19 -2
- package/es/locales/zh-TW.js +28 -6
- package/lib/components/TimeResourceSelector/index.d.ts +21 -0
- package/lib/components/auto-resize-text/auto-text-size-standalone.d.ts +20 -0
- package/lib/components/auto-resize-text/auto-text-size-standalone.js +273 -0
- package/lib/components/auto-resize-text/index.d.ts +6 -0
- package/lib/components/auto-resize-text/index.js +71 -0
- package/lib/components/cardPro/index.js +3 -2
- package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +16 -16
- package/lib/components/iconfont/index.js +1 -1
- package/lib/components/keyboard/index.d.ts +22 -0
- package/lib/components/keyboard/index.js +223 -0
- package/lib/components/keyboard/index.less +44 -0
- package/lib/components/page/index.js +3 -2
- package/lib/components/pisell-config-provider/context.d.ts +2 -0
- package/lib/components/pisell-config-provider/index.d.ts +1 -0
- package/lib/components/pisellAdjustPrice/index.js +4 -0
- package/lib/components/pisellAdjustPrice/type.d.ts +2 -0
- package/lib/components/pisellCardList/index.d.ts +32 -2
- package/lib/components/pisellCardList/index.js +39 -2
- package/lib/components/pisellCardList/index.less +9 -1
- package/lib/components/pisellCheckboxGroup/index.d.ts +3 -0
- package/lib/components/pisellCheckboxGroup/index.js +6 -1
- package/lib/components/pisellCheckboxGroup/index.less +28 -1
- package/lib/components/pisellCustomCheckboxGroup/index.d.ts +16 -0
- package/lib/components/pisellGoodPassCard/index.d.ts +1 -0
- package/lib/components/pisellGoodPassCard/index.js +31 -4
- package/lib/components/pisellText/components/Amount/index.js +2 -1
- package/lib/components/pisellToast/index.d.ts +1 -0
- package/lib/components/pisellToast/index.js +10 -1
- package/lib/components/pisellToast/squareToast/index.d.ts +15 -0
- package/lib/components/pisellToast/squareToast/index.js +58 -0
- package/lib/components/pisellToast/squareToast/index.less +60 -0
- package/lib/components/pisellToast/squareToast/methods.d.ts +13 -0
- package/lib/components/pisellToast/squareToast/methods.js +150 -0
- package/lib/components/pisellToast/squareToast/renderImperatively.d.ts +28 -0
- package/lib/components/pisellToast/squareToast/renderImperatively.js +162 -0
- package/lib/components/pisellToast/squareToast/toast.d.ts +25 -0
- package/lib/components/pisellToast/squareToast/toast.js +88 -0
- package/lib/components/pisellWalletPassCard/index.d.ts +53 -1
- package/lib/components/pisellWalletPassCard/index.js +257 -59
- package/lib/components/pisellWalletPassCard/index.less +47 -9
- package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.js +80 -0
- package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.less +75 -0
- package/lib/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/MultiDay/index.js +71 -0
- package/lib/components/productCard/cartSkuCard/components/MultiDay/index.less +31 -0
- package/lib/components/productCard/cartSkuCard/components/MultiDay/utils.d.ts +14 -0
- package/lib/components/productCard/cartSkuCard/components/MultiDay/utils.js +77 -0
- package/lib/components/productCard/cartSkuCard/components/Note/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/Note/index.js +56 -0
- package/lib/components/productCard/cartSkuCard/components/Note/index.less +27 -0
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +28 -0
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.js +83 -0
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.less +117 -0
- package/lib/components/productCard/cartSkuCard/components/discountReason/index.d.ts +2 -0
- package/lib/components/productCard/cartSkuCard/components/discountReason/index.js +70 -0
- package/lib/components/productCard/cartSkuCard/components/holders/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/holders/index.js +64 -0
- package/lib/components/productCard/cartSkuCard/components/holders/index.less +47 -0
- package/lib/components/productCard/cartSkuCard/components/packages/index.d.ts +10 -0
- package/lib/components/productCard/cartSkuCard/components/packages/index.js +73 -0
- package/lib/components/productCard/cartSkuCard/components/packages/index.less +22 -0
- package/lib/components/productCard/cartSkuCard/components/packages/utils.d.ts +20 -0
- package/lib/components/productCard/cartSkuCard/components/packages/utils.js +44 -0
- package/lib/components/productCard/cartSkuCard/components/resources/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/resources/index.js +71 -0
- package/lib/components/productCard/cartSkuCard/components/resources/index.less +19 -0
- package/lib/components/productCard/cartSkuCard/components/sales/index.d.ts +12 -0
- package/lib/components/productCard/cartSkuCard/components/sales/index.js +77 -0
- package/lib/components/productCard/cartSkuCard/components/sales/index.less +22 -0
- package/lib/components/productCard/cartSkuCard/components/specs/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/specs/index.js +66 -0
- package/lib/components/productCard/cartSkuCard/components/specs/index.less +34 -0
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +46 -0
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.js +373 -0
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.less +74 -0
- package/lib/components/productCard/cartSkuCard/components/timeRange/index.d.ts +6 -0
- package/lib/components/productCard/cartSkuCard/components/timeRange/index.js +68 -0
- package/lib/components/productCard/cartSkuCard/components/timeRange/index.less +38 -0
- package/lib/components/productCard/cartSkuCard/index.d.ts +10 -0
- package/lib/components/productCard/cartSkuCard/index.js +229 -0
- package/lib/components/productCard/cartSkuCard/index.less +33 -0
- package/lib/components/productCard/cartSkuCard/locales.d.ts +99 -0
- package/lib/components/productCard/cartSkuCard/locales.js +64 -0
- package/lib/components/productCard/components/Action/index.js +9 -0
- package/lib/components/productCard/components/Action/index.less +3 -0
- package/lib/components/productCard/components/Header/index.js +21 -11
- package/lib/components/productCard/components/Header/index.less +16 -1
- package/lib/components/productCard/components/Sales/index.js +2 -2
- package/lib/components/productCard/components/Time/components/SelectHolderModal/index.js +1 -1
- package/lib/components/productCard/components/Time/components/SelectHolderModal/index.less +3 -0
- package/lib/components/productCard/index.d.ts +3 -1
- package/lib/components/productCard/index.js +7 -2
- package/lib/components/productCard/index.less +6 -0
- package/lib/components/productCard/locales.js +12 -3
- package/lib/components/productCard/status.js +1 -0
- package/lib/components/productCard/types.d.ts +1 -0
- package/lib/components/productCard/utils.js +8 -1
- package/lib/components/select-time/index.d.ts +14 -0
- package/lib/components/table/Table/AddFieldModal/index.d.ts +1 -0
- package/lib/components/table/Table/AddFieldModal/index.js +9 -9
- package/lib/components/table/Table/AddFieldModal/index.less +11 -11
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +5 -1
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.js +19 -2
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.less +9 -5
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +4 -0
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.js +45 -27
- package/lib/components/virtual-keyboard/Number/index.js +3 -0
- package/lib/components/virtual-keyboard/Number/types.d.ts +1 -0
- package/lib/components/virtual-keyboard/index.d.ts +11 -0
- package/lib/components/virtual-keyboard/index.js +60 -2
- package/lib/components/virtual-keyboard/index.less +33 -1
- package/lib/components/virtualInput/BaseVirtualInput/index.d.ts +40 -0
- package/lib/components/virtualInput/BaseVirtualInput/index.js +179 -0
- package/lib/components/virtualInput/BaseVirtualInput/index.less +77 -0
- package/lib/components/virtualInput/index.d.ts +24 -0
- package/lib/components/virtualInput/index.js +102 -0
- package/lib/components/virtualInput/index.less +42 -0
- package/lib/index.d.ts +5 -1
- package/lib/index.js +11 -0
- package/lib/locales/en-US.d.ts +19 -2
- package/lib/locales/en-US.js +24 -5
- package/lib/locales/zh-CN.d.ts +19 -2
- package/lib/locales/zh-CN.js +24 -5
- package/lib/locales/zh-TW.d.ts +19 -2
- package/lib/locales/zh-TW.js +23 -5
- package/package.json +4 -4
- package/es/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +0 -12
- 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;
|