@fecp/mobile 1.0.2 → 1.0.4

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 (17) hide show
  1. 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
  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/index.mjs +8 -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
  4. 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 +77 -0
  5. 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
  6. 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
  7. 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
  8. package/es/packages/mobile/index.mjs +9 -0
  9. 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
  10. 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
  11. 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
  12. 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 +77 -0
  13. 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
  14. 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
  15. 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
  16. package/lib/packages/mobile/index.js +16 -7
  17. package/package.json +1 -1
@@ -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
+ };
@@ -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
+ };
@@ -0,0 +1,77 @@
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;
6
+ const DEFAULT_OPTIONS = {
7
+ title: "",
8
+ width: "",
9
+ theme: null,
10
+ message: "",
11
+ overlay: true,
12
+ callback: null,
13
+ teleport: "body",
14
+ className: "",
15
+ allowHtml: false,
16
+ lockScroll: true,
17
+ transition: void 0,
18
+ beforeClose: null,
19
+ overlayClass: "",
20
+ overlayStyle: void 0,
21
+ messageAlign: "",
22
+ cancelButtonText: "",
23
+ cancelButtonColor: null,
24
+ cancelButtonDisabled: false,
25
+ confirmButtonText: "",
26
+ confirmButtonColor: null,
27
+ confirmButtonDisabled: false,
28
+ showConfirmButton: true,
29
+ showCancelButton: false,
30
+ closeOnPopstate: true,
31
+ closeOnClickOverlay: false
32
+ };
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
+ };
@@ -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
+ };
@@ -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,
@@ -52,6 +52,9 @@ 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 { closeDialog, showConfirmDialog, showDialog } from "../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/dialog/function-call.mjs";
56
+ import { showImagePreview } from "../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/image-preview/function-call.mjs";
57
+ import { closeNotify, showNotify } from "../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/notify/function-call.mjs";
55
58
  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";
56
59
  const index = {
57
60
  install: (app) => {
@@ -115,10 +118,16 @@ export {
115
118
  MobileTreeSelect,
116
119
  MobileUploader,
117
120
  allowMultipleToast,
121
+ closeDialog,
122
+ closeNotify,
118
123
  closeToast,
119
124
  index as default,
125
+ showConfirmDialog,
126
+ showDialog,
120
127
  showFailToast,
128
+ showImagePreview,
121
129
  showLoadingToast,
130
+ showNotify,
122
131
  showSuccessToast,
123
132
  showToast
124
133
  };
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const vue = require("vue");
4
+ const ActionBar = require("../action-bar/ActionBar.js");
5
+ const index_esm = require("../../../../../@vant_use@1.6.0_vue@3.5.13_typescript@5.7.3_/node_modules/@vant/use/dist/index.esm.js");
6
+ const useExpose = require("../composables/use-expose.js");
7
+ const useRoute = require("../composables/use-route.js");
8
+ const index = require("../button/index.js");
9
+ const basic = require("../utils/basic.js");
10
+ const create = require("../utils/create.js");
11
+ const [name, bem] = create.createNamespace("action-bar-button");
12
+ const actionBarButtonProps = basic.extend({}, useRoute.routeProps, {
13
+ type: String,
14
+ text: String,
15
+ icon: String,
16
+ color: String,
17
+ loading: Boolean,
18
+ disabled: Boolean
19
+ });
20
+ var stdin_default = vue.defineComponent({
21
+ name,
22
+ props: actionBarButtonProps,
23
+ setup(props, {
24
+ slots
25
+ }) {
26
+ const route = useRoute.useRoute();
27
+ const {
28
+ parent,
29
+ index: index$1
30
+ } = index_esm.useParent(ActionBar.ACTION_BAR_KEY);
31
+ const isFirst = vue.computed(() => {
32
+ if (parent) {
33
+ const prev = parent.children[index$1.value - 1];
34
+ return !(prev && "isButton" in prev);
35
+ }
36
+ });
37
+ const isLast = vue.computed(() => {
38
+ if (parent) {
39
+ const next = parent.children[index$1.value + 1];
40
+ return !(next && "isButton" in next);
41
+ }
42
+ });
43
+ useExpose.useExpose({
44
+ isButton: true
45
+ });
46
+ return () => {
47
+ const {
48
+ type,
49
+ icon,
50
+ text,
51
+ color,
52
+ loading,
53
+ disabled
54
+ } = props;
55
+ return vue.createVNode(index.Button, {
56
+ "class": bem([type, {
57
+ last: isLast.value,
58
+ first: isFirst.value
59
+ }]),
60
+ "size": "large",
61
+ "type": type,
62
+ "icon": icon,
63
+ "color": color,
64
+ "loading": loading,
65
+ "disabled": disabled,
66
+ "onClick": route
67
+ }, {
68
+ default: () => [slots.default ? slots.default() : text]
69
+ });
70
+ };
71
+ }
72
+ });
73
+ exports.actionBarButtonProps = actionBarButtonProps;
74
+ exports.default = stdin_default;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const ActionBarButton$1 = require("./ActionBarButton.js");
4
+ const withInstall = require("../utils/with-install.js");
5
+ const ActionBarButton = withInstall.withInstall(ActionBarButton$1.default);
6
+ exports.actionBarButtonProps = ActionBarButton$1.actionBarButtonProps;
7
+ exports.ActionBarButton = ActionBarButton;
@@ -0,0 +1,226 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const vue = require("vue");
4
+ const shared = require("../popup/shared.js");
5
+ const index = require("../popup/index.js");
6
+ const index$3 = require("../button/index.js");
7
+ const index$1 = require("../action-bar/index.js");
8
+ const index$2 = require("../action-bar-button/index.js");
9
+ const basic = require("../utils/basic.js");
10
+ const constant = require("../utils/constant.js");
11
+ const create = require("../utils/create.js");
12
+ const format = require("../utils/format.js");
13
+ const props = require("../utils/props.js");
14
+ const interceptor = require("../utils/interceptor.js");
15
+ const [name, bem, t] = create.createNamespace("dialog");
16
+ const dialogProps = basic.extend({}, shared.popupSharedProps, {
17
+ title: String,
18
+ theme: String,
19
+ width: props.numericProp,
20
+ message: [String, Function],
21
+ callback: Function,
22
+ allowHtml: Boolean,
23
+ className: props.unknownProp,
24
+ transition: props.makeStringProp("van-dialog-bounce"),
25
+ messageAlign: String,
26
+ closeOnPopstate: props.truthProp,
27
+ showCancelButton: Boolean,
28
+ cancelButtonText: String,
29
+ cancelButtonColor: String,
30
+ cancelButtonDisabled: Boolean,
31
+ confirmButtonText: String,
32
+ confirmButtonColor: String,
33
+ confirmButtonDisabled: Boolean,
34
+ showConfirmButton: props.truthProp,
35
+ closeOnClickOverlay: Boolean,
36
+ keyboardEnabled: props.truthProp
37
+ });
38
+ const popupInheritKeys = [...shared.popupSharedPropKeys, "transition", "closeOnPopstate"];
39
+ var stdin_default = vue.defineComponent({
40
+ name,
41
+ props: dialogProps,
42
+ emits: ["confirm", "cancel", "keydown", "update:show"],
43
+ setup(props2, {
44
+ emit,
45
+ slots
46
+ }) {
47
+ const root = vue.ref();
48
+ const loading = vue.reactive({
49
+ confirm: false,
50
+ cancel: false
51
+ });
52
+ const updateShow = (value) => emit("update:show", value);
53
+ const close = (action) => {
54
+ var _a;
55
+ updateShow(false);
56
+ (_a = props2.callback) == null ? void 0 : _a.call(props2, action);
57
+ };
58
+ const getActionHandler = (action) => () => {
59
+ if (!props2.show) {
60
+ return;
61
+ }
62
+ emit(action);
63
+ if (props2.beforeClose) {
64
+ loading[action] = true;
65
+ interceptor.callInterceptor(props2.beforeClose, {
66
+ args: [action],
67
+ done() {
68
+ close(action);
69
+ loading[action] = false;
70
+ },
71
+ canceled() {
72
+ loading[action] = false;
73
+ }
74
+ });
75
+ } else {
76
+ close(action);
77
+ }
78
+ };
79
+ const onCancel = getActionHandler("cancel");
80
+ const onConfirm = getActionHandler("confirm");
81
+ const onKeydown = vue.withKeys((event) => {
82
+ var _a, _b;
83
+ if (!props2.keyboardEnabled) {
84
+ return;
85
+ }
86
+ if (event.target !== ((_b = (_a = root.value) == null ? void 0 : _a.popupRef) == null ? void 0 : _b.value)) {
87
+ return;
88
+ }
89
+ const onEventType = {
90
+ Enter: props2.showConfirmButton ? onConfirm : basic.noop,
91
+ Escape: props2.showCancelButton ? onCancel : basic.noop
92
+ };
93
+ onEventType[event.key]();
94
+ emit("keydown", event);
95
+ }, ["enter", "esc"]);
96
+ const renderTitle = () => {
97
+ const title = slots.title ? slots.title() : props2.title;
98
+ if (title) {
99
+ return vue.createVNode("div", {
100
+ "class": bem("header", {
101
+ isolated: !props2.message && !slots.default
102
+ })
103
+ }, [title]);
104
+ }
105
+ };
106
+ const renderMessage = (hasTitle) => {
107
+ const {
108
+ message,
109
+ allowHtml,
110
+ messageAlign
111
+ } = props2;
112
+ const classNames = bem("message", {
113
+ "has-title": hasTitle,
114
+ [messageAlign]: messageAlign
115
+ });
116
+ const content = basic.isFunction(message) ? message() : message;
117
+ if (allowHtml && typeof content === "string") {
118
+ return vue.createVNode("div", {
119
+ "class": classNames,
120
+ "innerHTML": content
121
+ }, null);
122
+ }
123
+ return vue.createVNode("div", {
124
+ "class": classNames
125
+ }, [content]);
126
+ };
127
+ const renderContent = () => {
128
+ if (slots.default) {
129
+ return vue.createVNode("div", {
130
+ "class": bem("content")
131
+ }, [slots.default()]);
132
+ }
133
+ const {
134
+ title,
135
+ message,
136
+ allowHtml
137
+ } = props2;
138
+ if (message) {
139
+ const hasTitle = !!(title || slots.title);
140
+ return vue.createVNode("div", {
141
+ "key": allowHtml ? 1 : 0,
142
+ "class": bem("content", {
143
+ isolated: !hasTitle
144
+ })
145
+ }, [renderMessage(hasTitle)]);
146
+ }
147
+ };
148
+ const renderButtons = () => vue.createVNode("div", {
149
+ "class": [constant.BORDER_TOP, bem("footer")]
150
+ }, [props2.showCancelButton && vue.createVNode(index$3.Button, {
151
+ "size": "large",
152
+ "text": props2.cancelButtonText || t("cancel"),
153
+ "class": bem("cancel"),
154
+ "style": {
155
+ color: props2.cancelButtonColor
156
+ },
157
+ "loading": loading.cancel,
158
+ "disabled": props2.cancelButtonDisabled,
159
+ "onClick": onCancel
160
+ }, null), props2.showConfirmButton && vue.createVNode(index$3.Button, {
161
+ "size": "large",
162
+ "text": props2.confirmButtonText || t("confirm"),
163
+ "class": [bem("confirm"), {
164
+ [constant.BORDER_LEFT]: props2.showCancelButton
165
+ }],
166
+ "style": {
167
+ color: props2.confirmButtonColor
168
+ },
169
+ "loading": loading.confirm,
170
+ "disabled": props2.confirmButtonDisabled,
171
+ "onClick": onConfirm
172
+ }, null)]);
173
+ const renderRoundButtons = () => vue.createVNode(index$1.ActionBar, {
174
+ "class": bem("footer")
175
+ }, {
176
+ default: () => [props2.showCancelButton && vue.createVNode(index$2.ActionBarButton, {
177
+ "type": "warning",
178
+ "text": props2.cancelButtonText || t("cancel"),
179
+ "class": bem("cancel"),
180
+ "color": props2.cancelButtonColor,
181
+ "loading": loading.cancel,
182
+ "disabled": props2.cancelButtonDisabled,
183
+ "onClick": onCancel
184
+ }, null), props2.showConfirmButton && vue.createVNode(index$2.ActionBarButton, {
185
+ "type": "danger",
186
+ "text": props2.confirmButtonText || t("confirm"),
187
+ "class": bem("confirm"),
188
+ "color": props2.confirmButtonColor,
189
+ "loading": loading.confirm,
190
+ "disabled": props2.confirmButtonDisabled,
191
+ "onClick": onConfirm
192
+ }, null)]
193
+ });
194
+ const renderFooter = () => {
195
+ if (slots.footer) {
196
+ return slots.footer();
197
+ }
198
+ return props2.theme === "round-button" ? renderRoundButtons() : renderButtons();
199
+ };
200
+ return () => {
201
+ const {
202
+ width,
203
+ title,
204
+ theme,
205
+ message,
206
+ className
207
+ } = props2;
208
+ return vue.createVNode(index.Popup, vue.mergeProps({
209
+ "ref": root,
210
+ "role": "dialog",
211
+ "class": [bem([theme]), className],
212
+ "style": {
213
+ width: format.addUnit(width)
214
+ },
215
+ "tabindex": 0,
216
+ "aria-labelledby": title || message,
217
+ "onKeydown": onKeydown,
218
+ "onUpdate:show": updateShow
219
+ }, basic.pick(props2, popupInheritKeys)), {
220
+ default: () => [renderTitle(), renderContent(), renderFooter()]
221
+ });
222
+ };
223
+ }
224
+ });
225
+ exports.default = stdin_default;
226
+ exports.dialogProps = dialogProps;
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const vue = require("vue");
4
+ const mountComponent = require("../utils/mount-component.js");
5
+ const Dialog = require("./Dialog.js");
6
+ const basic = require("../utils/basic.js");
7
+ let instance;
8
+ const DEFAULT_OPTIONS = {
9
+ title: "",
10
+ width: "",
11
+ theme: null,
12
+ message: "",
13
+ overlay: true,
14
+ callback: null,
15
+ teleport: "body",
16
+ className: "",
17
+ allowHtml: false,
18
+ lockScroll: true,
19
+ transition: void 0,
20
+ beforeClose: null,
21
+ overlayClass: "",
22
+ overlayStyle: void 0,
23
+ messageAlign: "",
24
+ cancelButtonText: "",
25
+ cancelButtonColor: null,
26
+ cancelButtonDisabled: false,
27
+ confirmButtonText: "",
28
+ confirmButtonColor: null,
29
+ confirmButtonDisabled: false,
30
+ showConfirmButton: true,
31
+ showCancelButton: false,
32
+ closeOnPopstate: true,
33
+ closeOnClickOverlay: false
34
+ };
35
+ let currentOptions = basic.extend({}, DEFAULT_OPTIONS);
36
+ function initInstance() {
37
+ const Wrapper = {
38
+ setup() {
39
+ const {
40
+ state,
41
+ toggle
42
+ } = mountComponent.usePopupState();
43
+ return () => vue.createVNode(Dialog.default, vue.mergeProps(state, {
44
+ "onUpdate:show": toggle
45
+ }), null);
46
+ }
47
+ };
48
+ ({
49
+ instance
50
+ } = mountComponent.mountComponent(Wrapper));
51
+ }
52
+ function showDialog(options) {
53
+ if (!basic.inBrowser) {
54
+ return Promise.resolve(void 0);
55
+ }
56
+ return new Promise((resolve, reject) => {
57
+ if (!instance) {
58
+ initInstance();
59
+ }
60
+ instance.open(basic.extend({}, currentOptions, options, {
61
+ callback: (action) => {
62
+ (action === "confirm" ? resolve : reject)(action);
63
+ }
64
+ }));
65
+ });
66
+ }
67
+ const showConfirmDialog = (options) => showDialog(basic.extend({
68
+ showCancelButton: true
69
+ }, options));
70
+ const closeDialog = () => {
71
+ if (instance) {
72
+ instance.toggle(false);
73
+ }
74
+ };
75
+ exports.closeDialog = closeDialog;
76
+ exports.showConfirmDialog = showConfirmDialog;
77
+ exports.showDialog = showDialog;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const vue = require("vue");
4
+ const index = require("../popup/index.js");
5
+ const shared = require("../popup/shared.js");
6
+ const basic = require("../utils/basic.js");
7
+ const create = require("../utils/create.js");
8
+ const props = require("../utils/props.js");
9
+ const [name, bem] = create.createNamespace("notify");
10
+ const popupInheritProps = ["lockScroll", "position", "show", "teleport", "zIndex"];
11
+ const notifyProps = basic.extend({}, shared.popupSharedProps, {
12
+ type: props.makeStringProp("danger"),
13
+ color: String,
14
+ message: props.numericProp,
15
+ position: props.makeStringProp("top"),
16
+ className: props.unknownProp,
17
+ background: String,
18
+ lockScroll: Boolean
19
+ });
20
+ var stdin_default = vue.defineComponent({
21
+ name,
22
+ props: notifyProps,
23
+ emits: ["update:show"],
24
+ setup(props2, {
25
+ emit,
26
+ slots
27
+ }) {
28
+ const updateShow = (show) => emit("update:show", show);
29
+ return () => vue.createVNode(index.Popup, vue.mergeProps({
30
+ "class": [bem([props2.type]), props2.className],
31
+ "style": {
32
+ color: props2.color,
33
+ background: props2.background
34
+ },
35
+ "overlay": false,
36
+ "duration": 0.2,
37
+ "onUpdate:show": updateShow
38
+ }, basic.pick(props2, popupInheritProps)), {
39
+ default: () => [slots.default ? slots.default() : props2.message]
40
+ });
41
+ }
42
+ });
43
+ exports.default = stdin_default;
44
+ exports.notifyProps = notifyProps;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const vue = require("vue");
4
+ const mountComponent = require("../utils/mount-component.js");
5
+ const Notify = require("./Notify.js");
6
+ const basic = require("../utils/basic.js");
7
+ let timer;
8
+ let instance;
9
+ const parseOptions = (message) => basic.isObject(message) ? message : {
10
+ message
11
+ };
12
+ function initInstance() {
13
+ ({
14
+ instance
15
+ } = mountComponent.mountComponent({
16
+ setup() {
17
+ const {
18
+ state,
19
+ toggle
20
+ } = mountComponent.usePopupState();
21
+ return () => vue.createVNode(Notify.default, vue.mergeProps(state, {
22
+ "onUpdate:show": toggle
23
+ }), null);
24
+ }
25
+ }));
26
+ }
27
+ const getDefaultOptions = () => ({
28
+ type: "danger",
29
+ color: void 0,
30
+ message: "",
31
+ onClose: void 0,
32
+ onClick: void 0,
33
+ onOpened: void 0,
34
+ duration: 3e3,
35
+ position: void 0,
36
+ className: "",
37
+ lockScroll: false,
38
+ background: void 0
39
+ });
40
+ let currentOptions = getDefaultOptions();
41
+ const closeNotify = () => {
42
+ if (instance) {
43
+ instance.toggle(false);
44
+ }
45
+ };
46
+ function showNotify(options) {
47
+ if (!basic.inBrowser) {
48
+ return;
49
+ }
50
+ if (!instance) {
51
+ initInstance();
52
+ }
53
+ options = basic.extend({}, currentOptions, parseOptions(options));
54
+ instance.open(options);
55
+ clearTimeout(timer);
56
+ if (options.duration > 0) {
57
+ timer = setTimeout(closeNotify, options.duration);
58
+ }
59
+ return instance;
60
+ }
61
+ exports.closeNotify = closeNotify;
62
+ exports.showNotify = showNotify;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const BORDER = "van-hairline";
4
4
  const BORDER_TOP = `${BORDER}--top`;
5
+ const BORDER_LEFT = `${BORDER}--left`;
5
6
  const BORDER_BOTTOM = `${BORDER}--bottom`;
6
7
  const BORDER_SURROUND = `${BORDER}--surround`;
7
8
  const BORDER_TOP_BOTTOM = `${BORDER}--top-bottom`;
@@ -12,6 +13,7 @@ const LONG_PRESS_START_TIME = 500;
12
13
  const TAP_OFFSET = 5;
13
14
  exports.BORDER = BORDER;
14
15
  exports.BORDER_BOTTOM = BORDER_BOTTOM;
16
+ exports.BORDER_LEFT = BORDER_LEFT;
15
17
  exports.BORDER_SURROUND = BORDER_SURROUND;
16
18
  exports.BORDER_TOP = BORDER_TOP;
17
19
  exports.BORDER_TOP_BOTTOM = BORDER_TOP_BOTTOM;
@@ -54,7 +54,10 @@ 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
+ const functionCall = require("../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/dialog/function-call.js");
58
+ const functionCall$1 = require("../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/image-preview/function-call.js");
59
+ const functionCall$2 = require("../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/notify/function-call.js");
60
+ const functionCall$3 = require("../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/toast/function-call.js");
58
61
  const index = {
59
62
  install: (app) => {
60
63
  for (let c in all) {
@@ -115,10 +118,16 @@ exports.MobileTabs = index$O.MobileTabs;
115
118
  exports.MobileTabbar = index$P.MobileTabbar;
116
119
  exports.MobileTabbarItem = index$Q.MobileTabbarItem;
117
120
  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;
121
+ exports.closeDialog = functionCall.closeDialog;
122
+ exports.showConfirmDialog = functionCall.showConfirmDialog;
123
+ exports.showDialog = functionCall.showDialog;
124
+ exports.showImagePreview = functionCall$1.showImagePreview;
125
+ exports.closeNotify = functionCall$2.closeNotify;
126
+ exports.showNotify = functionCall$2.showNotify;
127
+ exports.allowMultipleToast = functionCall$3.allowMultipleToast;
128
+ exports.closeToast = functionCall$3.closeToast;
129
+ exports.showFailToast = functionCall$3.showFailToast;
130
+ exports.showLoadingToast = functionCall$3.showLoadingToast;
131
+ exports.showSuccessToast = functionCall$3.showSuccessToast;
132
+ exports.showToast = functionCall$3.showToast;
124
133
  exports.default = index;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fecp/mobile",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "main": "lib/packages/mobile/index.js",
5
5
  "module": "es/packages/mobile/index.mjs",
6
6
  "files": [