@fecp/mobile 1.0.3 → 1.0.5
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/@vue_shared@3.5.13/node_modules/@vue/shared/dist/shared.esm-bundler.mjs +0 -2
- package/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/action-bar-button/ActionBarButton.mjs +74 -0
- package/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/action-bar-button/index.mjs +8 -0
- package/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/back-top/BackTop.mjs +0 -3
- package/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/collapse/Collapse.mjs +0 -14
- package/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/collapse-item/CollapseItem.mjs +0 -3
- package/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/composables/use-id.mjs +0 -3
- package/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/date-picker/DatePicker.mjs +0 -3
- package/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/dialog/Dialog.mjs +226 -0
- 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 +50 -3
- package/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/dropdown-item/DropdownItem.mjs +0 -3
- package/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/grid-item/GridItem.mjs +0 -3
- package/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/index-anchor/IndexAnchor.mjs +0 -3
- package/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/notify/Notify.mjs +44 -0
- package/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/notify/function-call.mjs +62 -0
- package/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/sidebar-item/SidebarItem.mjs +0 -3
- package/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/step/Step.mjs +0 -3
- package/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/swipe-item/SwipeItem.mjs +0 -3
- package/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/tab/Tab.mjs +0 -3
- package/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/tabbar-item/TabbarItem.mjs +0 -3
- package/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/time-picker/TimePicker.mjs +0 -3
- package/es/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/utils/constant.mjs +2 -0
- package/es/packages/mobile/index.mjs +7 -0
- package/lib/node_modules/.pnpm/@vue_shared@3.5.13/node_modules/@vue/shared/dist/shared.esm-bundler.js +0 -2
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/action-bar-button/ActionBarButton.js +74 -0
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/action-bar-button/index.js +7 -0
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/back-top/BackTop.js +0 -3
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/collapse/Collapse.js +0 -14
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/collapse-item/CollapseItem.js +0 -3
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/composables/use-id.js +0 -3
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/date-picker/DatePicker.js +0 -3
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/dialog/Dialog.js +226 -0
- 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 +48 -2
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/dropdown-item/DropdownItem.js +0 -3
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/grid-item/GridItem.js +0 -3
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/index-anchor/IndexAnchor.js +0 -3
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/notify/Notify.js +44 -0
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/notify/function-call.js +62 -0
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/sidebar-item/SidebarItem.js +0 -3
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/step/Step.js +0 -3
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/swipe-item/SwipeItem.js +0 -3
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/tab/Tab.js +0 -3
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/tabbar-item/TabbarItem.js +0 -3
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/time-picker/TimePicker.js +0 -3
- package/lib/node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/utils/constant.js +2 -0
- package/lib/packages/mobile/index.js +14 -7
- package/package.json +1 -1
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
|
-
!!(process.env.NODE_ENV !== "production") ? Object.freeze({}) : {};
|
|
7
|
-
!!(process.env.NODE_ENV !== "production") ? Object.freeze([]) : [];
|
|
8
6
|
const isArray = Array.isArray;
|
|
9
7
|
const isString = (val) => typeof val === "string";
|
|
10
8
|
const isObject = (val) => val !== null && typeof val === "object";
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { defineComponent, computed, createVNode } from "vue";
|
|
2
|
+
import { ACTION_BAR_KEY } from "../action-bar/ActionBar.mjs";
|
|
3
|
+
import { useParent } from "../../../../../@vant_use@1.6.0_vue@3.5.13_typescript@5.7.3_/node_modules/@vant/use/dist/index.esm.mjs";
|
|
4
|
+
import { useExpose } from "../composables/use-expose.mjs";
|
|
5
|
+
import { useRoute, routeProps } from "../composables/use-route.mjs";
|
|
6
|
+
import { Button } from "../button/index.mjs";
|
|
7
|
+
import { extend } from "../utils/basic.mjs";
|
|
8
|
+
import { createNamespace } from "../utils/create.mjs";
|
|
9
|
+
const [name, bem] = createNamespace("action-bar-button");
|
|
10
|
+
const actionBarButtonProps = extend({}, routeProps, {
|
|
11
|
+
type: String,
|
|
12
|
+
text: String,
|
|
13
|
+
icon: String,
|
|
14
|
+
color: String,
|
|
15
|
+
loading: Boolean,
|
|
16
|
+
disabled: Boolean
|
|
17
|
+
});
|
|
18
|
+
var stdin_default = defineComponent({
|
|
19
|
+
name,
|
|
20
|
+
props: actionBarButtonProps,
|
|
21
|
+
setup(props, {
|
|
22
|
+
slots
|
|
23
|
+
}) {
|
|
24
|
+
const route = useRoute();
|
|
25
|
+
const {
|
|
26
|
+
parent,
|
|
27
|
+
index
|
|
28
|
+
} = useParent(ACTION_BAR_KEY);
|
|
29
|
+
const isFirst = computed(() => {
|
|
30
|
+
if (parent) {
|
|
31
|
+
const prev = parent.children[index.value - 1];
|
|
32
|
+
return !(prev && "isButton" in prev);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
const isLast = computed(() => {
|
|
36
|
+
if (parent) {
|
|
37
|
+
const next = parent.children[index.value + 1];
|
|
38
|
+
return !(next && "isButton" in next);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
useExpose({
|
|
42
|
+
isButton: true
|
|
43
|
+
});
|
|
44
|
+
return () => {
|
|
45
|
+
const {
|
|
46
|
+
type,
|
|
47
|
+
icon,
|
|
48
|
+
text,
|
|
49
|
+
color,
|
|
50
|
+
loading,
|
|
51
|
+
disabled
|
|
52
|
+
} = props;
|
|
53
|
+
return createVNode(Button, {
|
|
54
|
+
"class": bem([type, {
|
|
55
|
+
last: isLast.value,
|
|
56
|
+
first: isFirst.value
|
|
57
|
+
}]),
|
|
58
|
+
"size": "large",
|
|
59
|
+
"type": type,
|
|
60
|
+
"icon": icon,
|
|
61
|
+
"color": color,
|
|
62
|
+
"loading": loading,
|
|
63
|
+
"disabled": disabled,
|
|
64
|
+
"onClick": route
|
|
65
|
+
}, {
|
|
66
|
+
default: () => [slots.default ? slots.default() : text]
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
export {
|
|
72
|
+
actionBarButtonProps,
|
|
73
|
+
stdin_default as default
|
|
74
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import stdin_default from "./ActionBarButton.mjs";
|
|
2
|
+
import { actionBarButtonProps } from "./ActionBarButton.mjs";
|
|
3
|
+
import { withInstall } from "../utils/with-install.mjs";
|
|
4
|
+
const ActionBarButton = withInstall(stdin_default);
|
|
5
|
+
export {
|
|
6
|
+
ActionBarButton,
|
|
7
|
+
actionBarButtonProps
|
|
8
|
+
};
|
|
@@ -58,9 +58,6 @@ var stdin_default = defineComponent({
|
|
|
58
58
|
if (el) {
|
|
59
59
|
return el;
|
|
60
60
|
}
|
|
61
|
-
if (process.env.NODE_ENV !== "production") {
|
|
62
|
-
console.error(`[Vant] BackTop: target element "${target}" was not found, the BackTop component will not be rendered.`);
|
|
63
|
-
}
|
|
64
61
|
} else {
|
|
65
62
|
return target;
|
|
66
63
|
}
|
|
@@ -14,17 +14,6 @@ const collapseProps = {
|
|
|
14
14
|
default: ""
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
function validateModelValue(modelValue, accordion) {
|
|
18
|
-
if (accordion && Array.isArray(modelValue)) {
|
|
19
|
-
console.error('[Vant] Collapse: "v-model" should not be Array in accordion mode');
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
if (!accordion && !Array.isArray(modelValue)) {
|
|
23
|
-
console.error('[Vant] Collapse: "v-model" should be Array in non-accordion mode');
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
28
17
|
var stdin_default = defineComponent({
|
|
29
18
|
name,
|
|
30
19
|
props: collapseProps,
|
|
@@ -81,9 +70,6 @@ var stdin_default = defineComponent({
|
|
|
81
70
|
accordion,
|
|
82
71
|
modelValue
|
|
83
72
|
} = props;
|
|
84
|
-
if (process.env.NODE_ENV !== "production" && !validateModelValue(modelValue, accordion)) {
|
|
85
|
-
return false;
|
|
86
|
-
}
|
|
87
73
|
return accordion ? modelValue === name2 : modelValue.includes(name2);
|
|
88
74
|
};
|
|
89
75
|
useExpose({
|
|
@@ -30,9 +30,6 @@ var stdin_default = defineComponent({
|
|
|
30
30
|
index
|
|
31
31
|
} = useParent(COLLAPSE_KEY);
|
|
32
32
|
if (!parent) {
|
|
33
|
-
if (process.env.NODE_ENV !== "production") {
|
|
34
|
-
console.error("[Vant] <CollapseItem> must be a child component of <Collapse>.");
|
|
35
|
-
}
|
|
36
33
|
return;
|
|
37
34
|
}
|
|
38
35
|
const name2 = computed(() => {
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { defineComponent, ref, reactive, withKeys, createVNode, mergeProps } from "vue";
|
|
2
|
+
import { popupSharedPropKeys, popupSharedProps } from "../popup/shared.mjs";
|
|
3
|
+
import { Popup } from "../popup/index.mjs";
|
|
4
|
+
import { Button } from "../button/index.mjs";
|
|
5
|
+
import { ActionBar } from "../action-bar/index.mjs";
|
|
6
|
+
import { ActionBarButton } from "../action-bar-button/index.mjs";
|
|
7
|
+
import { extend, noop, pick, isFunction } from "../utils/basic.mjs";
|
|
8
|
+
import { BORDER_TOP, BORDER_LEFT } from "../utils/constant.mjs";
|
|
9
|
+
import { createNamespace } from "../utils/create.mjs";
|
|
10
|
+
import { addUnit } from "../utils/format.mjs";
|
|
11
|
+
import { truthProp, makeStringProp, unknownProp, numericProp } from "../utils/props.mjs";
|
|
12
|
+
import { callInterceptor } from "../utils/interceptor.mjs";
|
|
13
|
+
const [name, bem, t] = createNamespace("dialog");
|
|
14
|
+
const dialogProps = extend({}, popupSharedProps, {
|
|
15
|
+
title: String,
|
|
16
|
+
theme: String,
|
|
17
|
+
width: numericProp,
|
|
18
|
+
message: [String, Function],
|
|
19
|
+
callback: Function,
|
|
20
|
+
allowHtml: Boolean,
|
|
21
|
+
className: unknownProp,
|
|
22
|
+
transition: makeStringProp("van-dialog-bounce"),
|
|
23
|
+
messageAlign: String,
|
|
24
|
+
closeOnPopstate: truthProp,
|
|
25
|
+
showCancelButton: Boolean,
|
|
26
|
+
cancelButtonText: String,
|
|
27
|
+
cancelButtonColor: String,
|
|
28
|
+
cancelButtonDisabled: Boolean,
|
|
29
|
+
confirmButtonText: String,
|
|
30
|
+
confirmButtonColor: String,
|
|
31
|
+
confirmButtonDisabled: Boolean,
|
|
32
|
+
showConfirmButton: truthProp,
|
|
33
|
+
closeOnClickOverlay: Boolean,
|
|
34
|
+
keyboardEnabled: truthProp
|
|
35
|
+
});
|
|
36
|
+
const popupInheritKeys = [...popupSharedPropKeys, "transition", "closeOnPopstate"];
|
|
37
|
+
var stdin_default = defineComponent({
|
|
38
|
+
name,
|
|
39
|
+
props: dialogProps,
|
|
40
|
+
emits: ["confirm", "cancel", "keydown", "update:show"],
|
|
41
|
+
setup(props, {
|
|
42
|
+
emit,
|
|
43
|
+
slots
|
|
44
|
+
}) {
|
|
45
|
+
const root = ref();
|
|
46
|
+
const loading = reactive({
|
|
47
|
+
confirm: false,
|
|
48
|
+
cancel: false
|
|
49
|
+
});
|
|
50
|
+
const updateShow = (value) => emit("update:show", value);
|
|
51
|
+
const close = (action) => {
|
|
52
|
+
var _a;
|
|
53
|
+
updateShow(false);
|
|
54
|
+
(_a = props.callback) == null ? void 0 : _a.call(props, action);
|
|
55
|
+
};
|
|
56
|
+
const getActionHandler = (action) => () => {
|
|
57
|
+
if (!props.show) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
emit(action);
|
|
61
|
+
if (props.beforeClose) {
|
|
62
|
+
loading[action] = true;
|
|
63
|
+
callInterceptor(props.beforeClose, {
|
|
64
|
+
args: [action],
|
|
65
|
+
done() {
|
|
66
|
+
close(action);
|
|
67
|
+
loading[action] = false;
|
|
68
|
+
},
|
|
69
|
+
canceled() {
|
|
70
|
+
loading[action] = false;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
} else {
|
|
74
|
+
close(action);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const onCancel = getActionHandler("cancel");
|
|
78
|
+
const onConfirm = getActionHandler("confirm");
|
|
79
|
+
const onKeydown = withKeys((event) => {
|
|
80
|
+
var _a, _b;
|
|
81
|
+
if (!props.keyboardEnabled) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (event.target !== ((_b = (_a = root.value) == null ? void 0 : _a.popupRef) == null ? void 0 : _b.value)) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const onEventType = {
|
|
88
|
+
Enter: props.showConfirmButton ? onConfirm : noop,
|
|
89
|
+
Escape: props.showCancelButton ? onCancel : noop
|
|
90
|
+
};
|
|
91
|
+
onEventType[event.key]();
|
|
92
|
+
emit("keydown", event);
|
|
93
|
+
}, ["enter", "esc"]);
|
|
94
|
+
const renderTitle = () => {
|
|
95
|
+
const title = slots.title ? slots.title() : props.title;
|
|
96
|
+
if (title) {
|
|
97
|
+
return createVNode("div", {
|
|
98
|
+
"class": bem("header", {
|
|
99
|
+
isolated: !props.message && !slots.default
|
|
100
|
+
})
|
|
101
|
+
}, [title]);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
const renderMessage = (hasTitle) => {
|
|
105
|
+
const {
|
|
106
|
+
message,
|
|
107
|
+
allowHtml,
|
|
108
|
+
messageAlign
|
|
109
|
+
} = props;
|
|
110
|
+
const classNames = bem("message", {
|
|
111
|
+
"has-title": hasTitle,
|
|
112
|
+
[messageAlign]: messageAlign
|
|
113
|
+
});
|
|
114
|
+
const content = isFunction(message) ? message() : message;
|
|
115
|
+
if (allowHtml && typeof content === "string") {
|
|
116
|
+
return createVNode("div", {
|
|
117
|
+
"class": classNames,
|
|
118
|
+
"innerHTML": content
|
|
119
|
+
}, null);
|
|
120
|
+
}
|
|
121
|
+
return createVNode("div", {
|
|
122
|
+
"class": classNames
|
|
123
|
+
}, [content]);
|
|
124
|
+
};
|
|
125
|
+
const renderContent = () => {
|
|
126
|
+
if (slots.default) {
|
|
127
|
+
return createVNode("div", {
|
|
128
|
+
"class": bem("content")
|
|
129
|
+
}, [slots.default()]);
|
|
130
|
+
}
|
|
131
|
+
const {
|
|
132
|
+
title,
|
|
133
|
+
message,
|
|
134
|
+
allowHtml
|
|
135
|
+
} = props;
|
|
136
|
+
if (message) {
|
|
137
|
+
const hasTitle = !!(title || slots.title);
|
|
138
|
+
return createVNode("div", {
|
|
139
|
+
"key": allowHtml ? 1 : 0,
|
|
140
|
+
"class": bem("content", {
|
|
141
|
+
isolated: !hasTitle
|
|
142
|
+
})
|
|
143
|
+
}, [renderMessage(hasTitle)]);
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
const renderButtons = () => createVNode("div", {
|
|
147
|
+
"class": [BORDER_TOP, bem("footer")]
|
|
148
|
+
}, [props.showCancelButton && createVNode(Button, {
|
|
149
|
+
"size": "large",
|
|
150
|
+
"text": props.cancelButtonText || t("cancel"),
|
|
151
|
+
"class": bem("cancel"),
|
|
152
|
+
"style": {
|
|
153
|
+
color: props.cancelButtonColor
|
|
154
|
+
},
|
|
155
|
+
"loading": loading.cancel,
|
|
156
|
+
"disabled": props.cancelButtonDisabled,
|
|
157
|
+
"onClick": onCancel
|
|
158
|
+
}, null), props.showConfirmButton && createVNode(Button, {
|
|
159
|
+
"size": "large",
|
|
160
|
+
"text": props.confirmButtonText || t("confirm"),
|
|
161
|
+
"class": [bem("confirm"), {
|
|
162
|
+
[BORDER_LEFT]: props.showCancelButton
|
|
163
|
+
}],
|
|
164
|
+
"style": {
|
|
165
|
+
color: props.confirmButtonColor
|
|
166
|
+
},
|
|
167
|
+
"loading": loading.confirm,
|
|
168
|
+
"disabled": props.confirmButtonDisabled,
|
|
169
|
+
"onClick": onConfirm
|
|
170
|
+
}, null)]);
|
|
171
|
+
const renderRoundButtons = () => createVNode(ActionBar, {
|
|
172
|
+
"class": bem("footer")
|
|
173
|
+
}, {
|
|
174
|
+
default: () => [props.showCancelButton && createVNode(ActionBarButton, {
|
|
175
|
+
"type": "warning",
|
|
176
|
+
"text": props.cancelButtonText || t("cancel"),
|
|
177
|
+
"class": bem("cancel"),
|
|
178
|
+
"color": props.cancelButtonColor,
|
|
179
|
+
"loading": loading.cancel,
|
|
180
|
+
"disabled": props.cancelButtonDisabled,
|
|
181
|
+
"onClick": onCancel
|
|
182
|
+
}, null), props.showConfirmButton && createVNode(ActionBarButton, {
|
|
183
|
+
"type": "danger",
|
|
184
|
+
"text": props.confirmButtonText || t("confirm"),
|
|
185
|
+
"class": bem("confirm"),
|
|
186
|
+
"color": props.confirmButtonColor,
|
|
187
|
+
"loading": loading.confirm,
|
|
188
|
+
"disabled": props.confirmButtonDisabled,
|
|
189
|
+
"onClick": onConfirm
|
|
190
|
+
}, null)]
|
|
191
|
+
});
|
|
192
|
+
const renderFooter = () => {
|
|
193
|
+
if (slots.footer) {
|
|
194
|
+
return slots.footer();
|
|
195
|
+
}
|
|
196
|
+
return props.theme === "round-button" ? renderRoundButtons() : renderButtons();
|
|
197
|
+
};
|
|
198
|
+
return () => {
|
|
199
|
+
const {
|
|
200
|
+
width,
|
|
201
|
+
title,
|
|
202
|
+
theme,
|
|
203
|
+
message,
|
|
204
|
+
className
|
|
205
|
+
} = props;
|
|
206
|
+
return createVNode(Popup, mergeProps({
|
|
207
|
+
"ref": root,
|
|
208
|
+
"role": "dialog",
|
|
209
|
+
"class": [bem([theme]), className],
|
|
210
|
+
"style": {
|
|
211
|
+
width: addUnit(width)
|
|
212
|
+
},
|
|
213
|
+
"tabindex": 0,
|
|
214
|
+
"aria-labelledby": title || message,
|
|
215
|
+
"onKeydown": onKeydown,
|
|
216
|
+
"onUpdate:show": updateShow
|
|
217
|
+
}, pick(props, popupInheritKeys)), {
|
|
218
|
+
default: () => [renderTitle(), renderContent(), renderFooter()]
|
|
219
|
+
});
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
export {
|
|
224
|
+
stdin_default as default,
|
|
225
|
+
dialogProps
|
|
226
|
+
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import "vue";
|
|
2
|
-
import {
|
|
1
|
+
import { createVNode, mergeProps } from "vue";
|
|
2
|
+
import { mountComponent, usePopupState } from "../utils/mount-component.mjs";
|
|
3
|
+
import stdin_default from "./Dialog.mjs";
|
|
4
|
+
import { inBrowser, extend } from "../utils/basic.mjs";
|
|
5
|
+
let instance;
|
|
3
6
|
const DEFAULT_OPTIONS = {
|
|
4
7
|
title: "",
|
|
5
8
|
width: "",
|
|
@@ -27,4 +30,48 @@ const DEFAULT_OPTIONS = {
|
|
|
27
30
|
closeOnPopstate: true,
|
|
28
31
|
closeOnClickOverlay: false
|
|
29
32
|
};
|
|
30
|
-
extend({}, DEFAULT_OPTIONS);
|
|
33
|
+
let currentOptions = extend({}, DEFAULT_OPTIONS);
|
|
34
|
+
function initInstance() {
|
|
35
|
+
const Wrapper = {
|
|
36
|
+
setup() {
|
|
37
|
+
const {
|
|
38
|
+
state,
|
|
39
|
+
toggle
|
|
40
|
+
} = usePopupState();
|
|
41
|
+
return () => createVNode(stdin_default, mergeProps(state, {
|
|
42
|
+
"onUpdate:show": toggle
|
|
43
|
+
}), null);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
({
|
|
47
|
+
instance
|
|
48
|
+
} = mountComponent(Wrapper));
|
|
49
|
+
}
|
|
50
|
+
function showDialog(options) {
|
|
51
|
+
if (!inBrowser) {
|
|
52
|
+
return Promise.resolve(void 0);
|
|
53
|
+
}
|
|
54
|
+
return new Promise((resolve, reject) => {
|
|
55
|
+
if (!instance) {
|
|
56
|
+
initInstance();
|
|
57
|
+
}
|
|
58
|
+
instance.open(extend({}, currentOptions, options, {
|
|
59
|
+
callback: (action) => {
|
|
60
|
+
(action === "confirm" ? resolve : reject)(action);
|
|
61
|
+
}
|
|
62
|
+
}));
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
const showConfirmDialog = (options) => showDialog(extend({
|
|
66
|
+
showCancelButton: true
|
|
67
|
+
}, options));
|
|
68
|
+
const closeDialog = () => {
|
|
69
|
+
if (instance) {
|
|
70
|
+
instance.toggle(false);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
export {
|
|
74
|
+
closeDialog,
|
|
75
|
+
showConfirmDialog,
|
|
76
|
+
showDialog
|
|
77
|
+
};
|
|
@@ -40,9 +40,6 @@ var stdin_default = defineComponent({
|
|
|
40
40
|
index
|
|
41
41
|
} = useParent(DROPDOWN_KEY);
|
|
42
42
|
if (!parent) {
|
|
43
|
-
if (process.env.NODE_ENV !== "production") {
|
|
44
|
-
console.error("[Vant] <DropdownItem> must be a child component of <DropdownMenu>.");
|
|
45
|
-
}
|
|
46
43
|
return;
|
|
47
44
|
}
|
|
48
45
|
const getEmitter = (name2) => () => emit(name2);
|
|
@@ -31,9 +31,6 @@ var stdin_default = defineComponent({
|
|
|
31
31
|
} = useParent(GRID_KEY);
|
|
32
32
|
const route = useRoute();
|
|
33
33
|
if (!parent) {
|
|
34
|
-
if (process.env.NODE_ENV !== "production") {
|
|
35
|
-
console.error("[Vant] <GridItem> must be a child component of <Grid>.");
|
|
36
|
-
}
|
|
37
34
|
return;
|
|
38
35
|
}
|
|
39
36
|
const rootStyle = computed(() => {
|
|
@@ -33,9 +33,6 @@ var stdin_default = defineComponent({
|
|
|
33
33
|
parent
|
|
34
34
|
} = useParent(INDEX_BAR_KEY);
|
|
35
35
|
if (!parent) {
|
|
36
|
-
if (process.env.NODE_ENV !== "production") {
|
|
37
|
-
console.error("[Vant] <IndexAnchor> must be a child component of <IndexBar>.");
|
|
38
|
-
}
|
|
39
36
|
return;
|
|
40
37
|
}
|
|
41
38
|
const isSticky = () => state.active && parent.props.sticky;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { defineComponent, createVNode, mergeProps } from "vue";
|
|
2
|
+
import { Popup } from "../popup/index.mjs";
|
|
3
|
+
import { popupSharedProps } from "../popup/shared.mjs";
|
|
4
|
+
import { extend, pick } from "../utils/basic.mjs";
|
|
5
|
+
import { createNamespace } from "../utils/create.mjs";
|
|
6
|
+
import { unknownProp, makeStringProp, numericProp } from "../utils/props.mjs";
|
|
7
|
+
const [name, bem] = createNamespace("notify");
|
|
8
|
+
const popupInheritProps = ["lockScroll", "position", "show", "teleport", "zIndex"];
|
|
9
|
+
const notifyProps = extend({}, popupSharedProps, {
|
|
10
|
+
type: makeStringProp("danger"),
|
|
11
|
+
color: String,
|
|
12
|
+
message: numericProp,
|
|
13
|
+
position: makeStringProp("top"),
|
|
14
|
+
className: unknownProp,
|
|
15
|
+
background: String,
|
|
16
|
+
lockScroll: Boolean
|
|
17
|
+
});
|
|
18
|
+
var stdin_default = defineComponent({
|
|
19
|
+
name,
|
|
20
|
+
props: notifyProps,
|
|
21
|
+
emits: ["update:show"],
|
|
22
|
+
setup(props, {
|
|
23
|
+
emit,
|
|
24
|
+
slots
|
|
25
|
+
}) {
|
|
26
|
+
const updateShow = (show) => emit("update:show", show);
|
|
27
|
+
return () => createVNode(Popup, mergeProps({
|
|
28
|
+
"class": [bem([props.type]), props.className],
|
|
29
|
+
"style": {
|
|
30
|
+
color: props.color,
|
|
31
|
+
background: props.background
|
|
32
|
+
},
|
|
33
|
+
"overlay": false,
|
|
34
|
+
"duration": 0.2,
|
|
35
|
+
"onUpdate:show": updateShow
|
|
36
|
+
}, pick(props, popupInheritProps)), {
|
|
37
|
+
default: () => [slots.default ? slots.default() : props.message]
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
export {
|
|
42
|
+
stdin_default as default,
|
|
43
|
+
notifyProps
|
|
44
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { createVNode, mergeProps } from "vue";
|
|
2
|
+
import { mountComponent, usePopupState } from "../utils/mount-component.mjs";
|
|
3
|
+
import stdin_default from "./Notify.mjs";
|
|
4
|
+
import { inBrowser, extend, isObject } from "../utils/basic.mjs";
|
|
5
|
+
let timer;
|
|
6
|
+
let instance;
|
|
7
|
+
const parseOptions = (message) => isObject(message) ? message : {
|
|
8
|
+
message
|
|
9
|
+
};
|
|
10
|
+
function initInstance() {
|
|
11
|
+
({
|
|
12
|
+
instance
|
|
13
|
+
} = mountComponent({
|
|
14
|
+
setup() {
|
|
15
|
+
const {
|
|
16
|
+
state,
|
|
17
|
+
toggle
|
|
18
|
+
} = usePopupState();
|
|
19
|
+
return () => createVNode(stdin_default, mergeProps(state, {
|
|
20
|
+
"onUpdate:show": toggle
|
|
21
|
+
}), null);
|
|
22
|
+
}
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
const getDefaultOptions = () => ({
|
|
26
|
+
type: "danger",
|
|
27
|
+
color: void 0,
|
|
28
|
+
message: "",
|
|
29
|
+
onClose: void 0,
|
|
30
|
+
onClick: void 0,
|
|
31
|
+
onOpened: void 0,
|
|
32
|
+
duration: 3e3,
|
|
33
|
+
position: void 0,
|
|
34
|
+
className: "",
|
|
35
|
+
lockScroll: false,
|
|
36
|
+
background: void 0
|
|
37
|
+
});
|
|
38
|
+
let currentOptions = getDefaultOptions();
|
|
39
|
+
const closeNotify = () => {
|
|
40
|
+
if (instance) {
|
|
41
|
+
instance.toggle(false);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
function showNotify(options) {
|
|
45
|
+
if (!inBrowser) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (!instance) {
|
|
49
|
+
initInstance();
|
|
50
|
+
}
|
|
51
|
+
options = extend({}, currentOptions, parseOptions(options));
|
|
52
|
+
instance.open(options);
|
|
53
|
+
clearTimeout(timer);
|
|
54
|
+
if (options.duration > 0) {
|
|
55
|
+
timer = setTimeout(closeNotify, options.duration);
|
|
56
|
+
}
|
|
57
|
+
return instance;
|
|
58
|
+
}
|
|
59
|
+
export {
|
|
60
|
+
closeNotify,
|
|
61
|
+
showNotify
|
|
62
|
+
};
|
|
@@ -28,9 +28,6 @@ var stdin_default = defineComponent({
|
|
|
28
28
|
index
|
|
29
29
|
} = useParent(SIDEBAR_KEY);
|
|
30
30
|
if (!parent) {
|
|
31
|
-
if (process.env.NODE_ENV !== "production") {
|
|
32
|
-
console.error("[Vant] <SidebarItem> must be a child component of <Sidebar>.");
|
|
33
|
-
}
|
|
34
31
|
return;
|
|
35
32
|
}
|
|
36
33
|
const onClick = () => {
|
|
@@ -15,9 +15,6 @@ var stdin_default = defineComponent({
|
|
|
15
15
|
index
|
|
16
16
|
} = useParent(STEPS_KEY);
|
|
17
17
|
if (!parent) {
|
|
18
|
-
if (process.env.NODE_ENV !== "production") {
|
|
19
|
-
console.error("[Vant] <Step> must be a child component of <Steps>.");
|
|
20
|
-
}
|
|
21
18
|
return;
|
|
22
19
|
}
|
|
23
20
|
const parentProps = parent.props;
|
|
@@ -20,9 +20,6 @@ var stdin_default = defineComponent({
|
|
|
20
20
|
index
|
|
21
21
|
} = useParent(SWIPE_KEY);
|
|
22
22
|
if (!parent) {
|
|
23
|
-
if (process.env.NODE_ENV !== "production") {
|
|
24
|
-
console.error("[Vant] <SwipeItem> must be a child component of <Swipe>.");
|
|
25
|
-
}
|
|
26
23
|
return;
|
|
27
24
|
}
|
|
28
25
|
const style = computed(() => {
|
|
@@ -36,9 +36,6 @@ var stdin_default = defineComponent({
|
|
|
36
36
|
index
|
|
37
37
|
} = useParent(TABS_KEY);
|
|
38
38
|
if (!parent) {
|
|
39
|
-
if (process.env.NODE_ENV !== "production") {
|
|
40
|
-
console.error("[Vant] <Tab> must be a child component of <Tabs>.");
|
|
41
|
-
}
|
|
42
39
|
return;
|
|
43
40
|
}
|
|
44
41
|
const getName = () => {
|
|
@@ -31,9 +31,6 @@ var stdin_default = defineComponent({
|
|
|
31
31
|
index
|
|
32
32
|
} = useParent(TABBAR_KEY);
|
|
33
33
|
if (!parent) {
|
|
34
|
-
if (process.env.NODE_ENV !== "production") {
|
|
35
|
-
console.error("[Vant] <TabbarItem> must be a child component of <Tabbar>.");
|
|
36
|
-
}
|
|
37
34
|
return;
|
|
38
35
|
}
|
|
39
36
|
const active = computed(() => {
|
|
@@ -96,9 +96,6 @@ var stdin_default = defineComponent({
|
|
|
96
96
|
case "second":
|
|
97
97
|
return genOptions(+minSecond, +maxSecond, type, formatter, filter, currentValues.value);
|
|
98
98
|
default:
|
|
99
|
-
if (process.env.NODE_ENV !== "production") {
|
|
100
|
-
throw new Error(`[Vant] DatePicker: unsupported columns type: ${type}`);
|
|
101
|
-
}
|
|
102
99
|
return [];
|
|
103
100
|
}
|
|
104
101
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const BORDER = "van-hairline";
|
|
2
2
|
const BORDER_TOP = `${BORDER}--top`;
|
|
3
|
+
const BORDER_LEFT = `${BORDER}--left`;
|
|
3
4
|
const BORDER_BOTTOM = `${BORDER}--bottom`;
|
|
4
5
|
const BORDER_SURROUND = `${BORDER}--surround`;
|
|
5
6
|
const BORDER_TOP_BOTTOM = `${BORDER}--top-bottom`;
|
|
@@ -11,6 +12,7 @@ const TAP_OFFSET = 5;
|
|
|
11
12
|
export {
|
|
12
13
|
BORDER,
|
|
13
14
|
BORDER_BOTTOM,
|
|
15
|
+
BORDER_LEFT,
|
|
14
16
|
BORDER_SURROUND,
|
|
15
17
|
BORDER_TOP,
|
|
16
18
|
BORDER_TOP_BOTTOM,
|