@fecp/mobile 1.0.1 → 1.0.3
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/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/dialog/function-call.mjs +30 -0
- package/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/toast/function-call.mjs +35 -1
- package/es/packages/mobile/index.mjs +8 -1
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/dialog/function-call.js +31 -0
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/toast/function-call.js +35 -1
- package/lib/packages/mobile/index.js +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import "vue";
|
|
2
|
+
import { extend } from "../utils/basic.mjs";
|
|
3
|
+
const DEFAULT_OPTIONS = {
|
|
4
|
+
title: "",
|
|
5
|
+
width: "",
|
|
6
|
+
theme: null,
|
|
7
|
+
message: "",
|
|
8
|
+
overlay: true,
|
|
9
|
+
callback: null,
|
|
10
|
+
teleport: "body",
|
|
11
|
+
className: "",
|
|
12
|
+
allowHtml: false,
|
|
13
|
+
lockScroll: true,
|
|
14
|
+
transition: void 0,
|
|
15
|
+
beforeClose: null,
|
|
16
|
+
overlayClass: "",
|
|
17
|
+
overlayStyle: void 0,
|
|
18
|
+
messageAlign: "",
|
|
19
|
+
cancelButtonText: "",
|
|
20
|
+
cancelButtonColor: null,
|
|
21
|
+
cancelButtonDisabled: false,
|
|
22
|
+
confirmButtonText: "",
|
|
23
|
+
confirmButtonColor: null,
|
|
24
|
+
confirmButtonDisabled: false,
|
|
25
|
+
showConfirmButton: true,
|
|
26
|
+
showCancelButton: false,
|
|
27
|
+
closeOnPopstate: true,
|
|
28
|
+
closeOnClickOverlay: false
|
|
29
|
+
};
|
|
30
|
+
extend({}, DEFAULT_OPTIONS);
|
|
@@ -37,7 +37,8 @@ function parseOptions(message) {
|
|
|
37
37
|
}
|
|
38
38
|
function createInstance() {
|
|
39
39
|
const {
|
|
40
|
-
instance
|
|
40
|
+
instance,
|
|
41
|
+
unmount
|
|
41
42
|
} = mountComponent({
|
|
42
43
|
setup() {
|
|
43
44
|
const message = ref("");
|
|
@@ -48,6 +49,10 @@ function createInstance() {
|
|
|
48
49
|
toggle
|
|
49
50
|
} = usePopupState();
|
|
50
51
|
const onClosed = () => {
|
|
52
|
+
if (allowMultiple) {
|
|
53
|
+
queue = queue.filter((item) => item !== instance);
|
|
54
|
+
unmount();
|
|
55
|
+
}
|
|
51
56
|
};
|
|
52
57
|
const render = () => {
|
|
53
58
|
const attrs = {
|
|
@@ -85,6 +90,35 @@ function showToast(options = {}) {
|
|
|
85
90
|
toast.open(extend({}, currentOptions, defaultOptionsMap.get(parsedOptions.type || currentOptions.type), parsedOptions));
|
|
86
91
|
return toast;
|
|
87
92
|
}
|
|
93
|
+
const createMethod = (type) => (options) => showToast(extend({
|
|
94
|
+
type
|
|
95
|
+
}, parseOptions(options)));
|
|
96
|
+
const showLoadingToast = createMethod("loading");
|
|
97
|
+
const showSuccessToast = createMethod("success");
|
|
98
|
+
const showFailToast = createMethod("fail");
|
|
99
|
+
const closeToast = (all) => {
|
|
100
|
+
var _a;
|
|
101
|
+
if (queue.length) {
|
|
102
|
+
if (all) {
|
|
103
|
+
queue.forEach((toast) => {
|
|
104
|
+
toast.close();
|
|
105
|
+
});
|
|
106
|
+
queue = [];
|
|
107
|
+
} else if (!allowMultiple) {
|
|
108
|
+
queue[0].close();
|
|
109
|
+
} else {
|
|
110
|
+
(_a = queue.shift()) == null ? void 0 : _a.close();
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
const allowMultipleToast = (value = true) => {
|
|
115
|
+
allowMultiple = value;
|
|
116
|
+
};
|
|
88
117
|
export {
|
|
118
|
+
allowMultipleToast,
|
|
119
|
+
closeToast,
|
|
120
|
+
showFailToast,
|
|
121
|
+
showLoadingToast,
|
|
122
|
+
showSuccessToast,
|
|
89
123
|
showToast
|
|
90
124
|
};
|
|
@@ -52,6 +52,7 @@ import { MobileTabs } from "./src/components/navigation/tabs/index.mjs";
|
|
|
52
52
|
import { MobileTabbar } from "./src/components/navigation/tabbar/index.mjs";
|
|
53
53
|
import { MobileTabbarItem } from "./src/components/navigation/tabbarItem/index.mjs";
|
|
54
54
|
import { MobileTreeSelect } from "./src/components/navigation/treeSelect/index.mjs";
|
|
55
|
+
import { allowMultipleToast, closeToast, showFailToast, showLoadingToast, showSuccessToast, showToast } from "../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/toast/function-call.mjs";
|
|
55
56
|
const index = {
|
|
56
57
|
install: (app) => {
|
|
57
58
|
for (let c in all) {
|
|
@@ -113,5 +114,11 @@ export {
|
|
|
113
114
|
MobileTimePicker,
|
|
114
115
|
MobileTreeSelect,
|
|
115
116
|
MobileUploader,
|
|
116
|
-
|
|
117
|
+
allowMultipleToast,
|
|
118
|
+
closeToast,
|
|
119
|
+
index as default,
|
|
120
|
+
showFailToast,
|
|
121
|
+
showLoadingToast,
|
|
122
|
+
showSuccessToast,
|
|
123
|
+
showToast
|
|
117
124
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
require("vue");
|
|
3
|
+
const basic = require("../utils/basic.js");
|
|
4
|
+
const DEFAULT_OPTIONS = {
|
|
5
|
+
title: "",
|
|
6
|
+
width: "",
|
|
7
|
+
theme: null,
|
|
8
|
+
message: "",
|
|
9
|
+
overlay: true,
|
|
10
|
+
callback: null,
|
|
11
|
+
teleport: "body",
|
|
12
|
+
className: "",
|
|
13
|
+
allowHtml: false,
|
|
14
|
+
lockScroll: true,
|
|
15
|
+
transition: void 0,
|
|
16
|
+
beforeClose: null,
|
|
17
|
+
overlayClass: "",
|
|
18
|
+
overlayStyle: void 0,
|
|
19
|
+
messageAlign: "",
|
|
20
|
+
cancelButtonText: "",
|
|
21
|
+
cancelButtonColor: null,
|
|
22
|
+
cancelButtonDisabled: false,
|
|
23
|
+
confirmButtonText: "",
|
|
24
|
+
confirmButtonColor: null,
|
|
25
|
+
confirmButtonDisabled: false,
|
|
26
|
+
showConfirmButton: true,
|
|
27
|
+
showCancelButton: false,
|
|
28
|
+
closeOnPopstate: true,
|
|
29
|
+
closeOnClickOverlay: false
|
|
30
|
+
};
|
|
31
|
+
basic.extend({}, DEFAULT_OPTIONS);
|
|
@@ -39,7 +39,8 @@ function parseOptions(message) {
|
|
|
39
39
|
}
|
|
40
40
|
function createInstance() {
|
|
41
41
|
const {
|
|
42
|
-
instance
|
|
42
|
+
instance,
|
|
43
|
+
unmount
|
|
43
44
|
} = mountComponent.mountComponent({
|
|
44
45
|
setup() {
|
|
45
46
|
const message = vue.ref("");
|
|
@@ -50,6 +51,10 @@ function createInstance() {
|
|
|
50
51
|
toggle
|
|
51
52
|
} = mountComponent.usePopupState();
|
|
52
53
|
const onClosed = () => {
|
|
54
|
+
if (allowMultiple) {
|
|
55
|
+
queue = queue.filter((item) => item !== instance);
|
|
56
|
+
unmount();
|
|
57
|
+
}
|
|
53
58
|
};
|
|
54
59
|
const render = () => {
|
|
55
60
|
const attrs = {
|
|
@@ -87,4 +92,33 @@ function showToast(options = {}) {
|
|
|
87
92
|
toast.open(basic.extend({}, currentOptions, defaultOptionsMap.get(parsedOptions.type || currentOptions.type), parsedOptions));
|
|
88
93
|
return toast;
|
|
89
94
|
}
|
|
95
|
+
const createMethod = (type) => (options) => showToast(basic.extend({
|
|
96
|
+
type
|
|
97
|
+
}, parseOptions(options)));
|
|
98
|
+
const showLoadingToast = createMethod("loading");
|
|
99
|
+
const showSuccessToast = createMethod("success");
|
|
100
|
+
const showFailToast = createMethod("fail");
|
|
101
|
+
const closeToast = (all) => {
|
|
102
|
+
var _a;
|
|
103
|
+
if (queue.length) {
|
|
104
|
+
if (all) {
|
|
105
|
+
queue.forEach((toast) => {
|
|
106
|
+
toast.close();
|
|
107
|
+
});
|
|
108
|
+
queue = [];
|
|
109
|
+
} else if (!allowMultiple) {
|
|
110
|
+
queue[0].close();
|
|
111
|
+
} else {
|
|
112
|
+
(_a = queue.shift()) == null ? void 0 : _a.close();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
const allowMultipleToast = (value = true) => {
|
|
117
|
+
allowMultiple = value;
|
|
118
|
+
};
|
|
119
|
+
exports.allowMultipleToast = allowMultipleToast;
|
|
120
|
+
exports.closeToast = closeToast;
|
|
121
|
+
exports.showFailToast = showFailToast;
|
|
122
|
+
exports.showLoadingToast = showLoadingToast;
|
|
123
|
+
exports.showSuccessToast = showSuccessToast;
|
|
90
124
|
exports.showToast = showToast;
|
|
@@ -54,6 +54,7 @@ const index$O = require("./src/components/navigation/tabs/index.js");
|
|
|
54
54
|
const index$P = require("./src/components/navigation/tabbar/index.js");
|
|
55
55
|
const index$Q = require("./src/components/navigation/tabbarItem/index.js");
|
|
56
56
|
const index$R = require("./src/components/navigation/treeSelect/index.js");
|
|
57
|
+
const functionCall = require("../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/toast/function-call.js");
|
|
57
58
|
const index = {
|
|
58
59
|
install: (app) => {
|
|
59
60
|
for (let c in all) {
|
|
@@ -114,4 +115,10 @@ exports.MobileTabs = index$O.MobileTabs;
|
|
|
114
115
|
exports.MobileTabbar = index$P.MobileTabbar;
|
|
115
116
|
exports.MobileTabbarItem = index$Q.MobileTabbarItem;
|
|
116
117
|
exports.MobileTreeSelect = index$R.MobileTreeSelect;
|
|
118
|
+
exports.allowMultipleToast = functionCall.allowMultipleToast;
|
|
119
|
+
exports.closeToast = functionCall.closeToast;
|
|
120
|
+
exports.showFailToast = functionCall.showFailToast;
|
|
121
|
+
exports.showLoadingToast = functionCall.showLoadingToast;
|
|
122
|
+
exports.showSuccessToast = functionCall.showSuccessToast;
|
|
123
|
+
exports.showToast = functionCall.showToast;
|
|
117
124
|
exports.default = index;
|