@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.
Files changed (47) hide show
  1. package/es/node_modules/.pnpm/@vue_shared@3.5.13/node_modules/@vue/shared/dist/shared.esm-bundler.mjs +0 -2
  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
  3. 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
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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
  13. 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
  14. 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
  15. 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
  16. 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
  17. 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
  18. 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
  19. 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
  20. 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
  21. 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
  22. 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
  23. package/es/packages/mobile/index.mjs +7 -0
  24. package/lib/node_modules/.pnpm/@vue_shared@3.5.13/node_modules/@vue/shared/dist/shared.esm-bundler.js +0 -2
  25. 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
  26. 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
  27. 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
  28. 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
  29. 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
  30. 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
  31. 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
  32. 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
  33. 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
  34. 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
  35. 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
  36. 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
  37. 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
  38. 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
  39. 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
  40. 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
  41. 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
  42. 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
  43. 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
  44. 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
  45. 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
  46. package/lib/packages/mobile/index.js +14 -7
  47. package/package.json +1 -1
@@ -52,6 +52,8 @@ 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 { 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
57
  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
58
  const index = {
57
59
  install: (app) => {
@@ -115,10 +117,15 @@ export {
115
117
  MobileTreeSelect,
116
118
  MobileUploader,
117
119
  allowMultipleToast,
120
+ closeDialog,
121
+ closeNotify,
118
122
  closeToast,
119
123
  index as default,
124
+ showConfirmDialog,
125
+ showDialog,
120
126
  showFailToast,
121
127
  showLoadingToast,
128
+ showNotify,
122
129
  showSuccessToast,
123
130
  showToast
124
131
  };
@@ -5,8 +5,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
5
5
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
6
6
  * @license MIT
7
7
  **/
8
- !!(process.env.NODE_ENV !== "production") ? Object.freeze({}) : {};
9
- !!(process.env.NODE_ENV !== "production") ? Object.freeze([]) : [];
10
8
  const isArray = Array.isArray;
11
9
  const isString = (val) => typeof val === "string";
12
10
  const isObject = (val) => val !== null && typeof val === "object";
@@ -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;
@@ -60,9 +60,6 @@ var stdin_default = vue.defineComponent({
60
60
  if (el) {
61
61
  return el;
62
62
  }
63
- if (process.env.NODE_ENV !== "production") {
64
- console.error(`[Vant] BackTop: target element "${target}" was not found, the BackTop component will not be rendered.`);
65
- }
66
63
  } else {
67
64
  return target;
68
65
  }
@@ -16,17 +16,6 @@ const collapseProps = {
16
16
  default: ""
17
17
  }
18
18
  };
19
- function validateModelValue(modelValue, accordion) {
20
- if (accordion && Array.isArray(modelValue)) {
21
- console.error('[Vant] Collapse: "v-model" should not be Array in accordion mode');
22
- return false;
23
- }
24
- if (!accordion && !Array.isArray(modelValue)) {
25
- console.error('[Vant] Collapse: "v-model" should be Array in non-accordion mode');
26
- return false;
27
- }
28
- return true;
29
- }
30
19
  var stdin_default = vue.defineComponent({
31
20
  name,
32
21
  props: collapseProps,
@@ -83,9 +72,6 @@ var stdin_default = vue.defineComponent({
83
72
  accordion,
84
73
  modelValue
85
74
  } = props2;
86
- if (process.env.NODE_ENV !== "production" && !validateModelValue(modelValue, accordion)) {
87
- return false;
88
- }
89
75
  return accordion ? modelValue === name2 : modelValue.includes(name2);
90
76
  };
91
77
  useExpose.useExpose({
@@ -32,9 +32,6 @@ var stdin_default = vue.defineComponent({
32
32
  index: index$1
33
33
  } = index_esm.useParent(Collapse.COLLAPSE_KEY);
34
34
  if (!parent) {
35
- if (process.env.NODE_ENV !== "production") {
36
- console.error("[Vant] <CollapseItem> must be a child component of <Collapse>.");
37
- }
38
35
  return;
39
36
  }
40
37
  const name2 = vue.computed(() => {
@@ -5,9 +5,6 @@ let current = 0;
5
5
  function useId() {
6
6
  const vm = vue.getCurrentInstance();
7
7
  const { name = "unknown" } = (vm == null ? void 0 : vm.type) || {};
8
- if (process.env.NODE_ENV === "test") {
9
- return name;
10
- }
11
8
  return `${name}-${++current}`;
12
9
  }
13
10
  exports.useId = useId;
@@ -91,9 +91,6 @@ var stdin_default = vue.defineComponent({
91
91
  case "day":
92
92
  return genDayOptions();
93
93
  default:
94
- if (process.env.NODE_ENV !== "production") {
95
- throw new Error(`[Vant] DatePicker: unsupported columns type: ${type}`);
96
- }
97
94
  return [];
98
95
  }
99
96
  }));
@@ -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;
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
- require("vue");
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");
3
6
  const basic = require("../utils/basic.js");
7
+ let instance;
4
8
  const DEFAULT_OPTIONS = {
5
9
  title: "",
6
10
  width: "",
@@ -28,4 +32,46 @@ const DEFAULT_OPTIONS = {
28
32
  closeOnPopstate: true,
29
33
  closeOnClickOverlay: false
30
34
  };
31
- basic.extend({}, DEFAULT_OPTIONS);
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;
@@ -42,9 +42,6 @@ var stdin_default = vue.defineComponent({
42
42
  index: index$3
43
43
  } = index_esm.useParent(DropdownMenu.DROPDOWN_KEY);
44
44
  if (!parent) {
45
- if (process.env.NODE_ENV !== "production") {
46
- console.error("[Vant] <DropdownItem> must be a child component of <DropdownMenu>.");
47
- }
48
45
  return;
49
46
  }
50
47
  const getEmitter = (name2) => () => emit(name2);
@@ -33,9 +33,6 @@ var stdin_default = vue.defineComponent({
33
33
  } = index_esm.useParent(Grid.GRID_KEY);
34
34
  const route = useRoute.useRoute();
35
35
  if (!parent) {
36
- if (process.env.NODE_ENV !== "production") {
37
- console.error("[Vant] <GridItem> must be a child component of <Grid>.");
38
- }
39
36
  return;
40
37
  }
41
38
  const rootStyle = vue.computed(() => {
@@ -35,9 +35,6 @@ var stdin_default = vue.defineComponent({
35
35
  parent
36
36
  } = index_esm.useParent(IndexBar.INDEX_BAR_KEY);
37
37
  if (!parent) {
38
- if (process.env.NODE_ENV !== "production") {
39
- console.error("[Vant] <IndexAnchor> must be a child component of <IndexBar>.");
40
- }
41
38
  return;
42
39
  }
43
40
  const isSticky = () => state.active && parent.props.sticky;
@@ -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;
@@ -30,9 +30,6 @@ var stdin_default = vue.defineComponent({
30
30
  index: index$1
31
31
  } = index_esm.useParent(Sidebar.SIDEBAR_KEY);
32
32
  if (!parent) {
33
- if (process.env.NODE_ENV !== "production") {
34
- console.error("[Vant] <SidebarItem> must be a child component of <Sidebar>.");
35
- }
36
33
  return;
37
34
  }
38
35
  const onClick = () => {
@@ -17,9 +17,6 @@ var stdin_default = vue.defineComponent({
17
17
  index: index$1
18
18
  } = index_esm.useParent(Steps.STEPS_KEY);
19
19
  if (!parent) {
20
- if (process.env.NODE_ENV !== "production") {
21
- console.error("[Vant] <Step> must be a child component of <Steps>.");
22
- }
23
20
  return;
24
21
  }
25
22
  const parentProps = parent.props;
@@ -22,9 +22,6 @@ var stdin_default = vue.defineComponent({
22
22
  index
23
23
  } = index_esm.useParent(Swipe.SWIPE_KEY);
24
24
  if (!parent) {
25
- if (process.env.NODE_ENV !== "production") {
26
- console.error("[Vant] <SwipeItem> must be a child component of <Swipe>.");
27
- }
28
25
  return;
29
26
  }
30
27
  const style = vue.computed(() => {
@@ -38,9 +38,6 @@ var stdin_default = vue.defineComponent({
38
38
  index: index$1
39
39
  } = index_esm.useParent(Tabs.TABS_KEY);
40
40
  if (!parent) {
41
- if (process.env.NODE_ENV !== "production") {
42
- console.error("[Vant] <Tab> must be a child component of <Tabs>.");
43
- }
44
41
  return;
45
42
  }
46
43
  const getName = () => {
@@ -33,9 +33,6 @@ var stdin_default = vue.defineComponent({
33
33
  index: index$2
34
34
  } = index_esm.useParent(Tabbar.TABBAR_KEY);
35
35
  if (!parent) {
36
- if (process.env.NODE_ENV !== "production") {
37
- console.error("[Vant] <TabbarItem> must be a child component of <Tabbar>.");
38
- }
39
36
  return;
40
37
  }
41
38
  const active = vue.computed(() => {