@nutui/nutui 4.0.0-beta.8 → 4.0.0-beta.9

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.
@@ -235,16 +235,11 @@ class DialogOptions {
235
235
  __publicField(this, "teleport", "body");
236
236
  __publicField(this, "id", new Date().getTime());
237
237
  __publicField(this, "footerDirection", "horizontal");
238
- __publicField(this, "onUpdate", (value) => {
239
- });
240
- __publicField(this, "onOk", () => {
241
- });
242
- __publicField(this, "onCancel", () => {
243
- });
244
- __publicField(this, "onOpened", () => {
245
- });
246
- __publicField(this, "onClosed", () => {
247
- });
238
+ __publicField(this, "onUpdate");
239
+ __publicField(this, "onOk");
240
+ __publicField(this, "onCancel");
241
+ __publicField(this, "onOpened");
242
+ __publicField(this, "onClosed");
248
243
  __publicField(this, "beforeClose");
249
244
  __publicField(this, "visible", true);
250
245
  __publicField(this, "noFooter", false);
@@ -259,7 +254,7 @@ class DialogFunction {
259
254
  constructor(_options) {
260
255
  __publicField(this, "options", new DialogOptions());
261
256
  __publicField(this, "instance");
262
- let options = Object.assign(this.options, _options);
257
+ const options = Object.assign(this.options, _options);
263
258
  const { unmount } = CreateComponent(options, {
264
259
  name: "dialog",
265
260
  components: [Popup, Button, Overlay],
@@ -284,15 +279,15 @@ class DialogFunction {
284
279
  });
285
280
  }
286
281
  }
287
- const _Dialog = function(options) {
282
+ const showDialog = function(options) {
288
283
  return new DialogFunction(options);
289
284
  };
290
- _Dialog.install = (app) => {
285
+ showDialog.install = (app) => {
291
286
  app.use(Dialog);
292
- app.config.globalProperties.$dialog = _Dialog;
287
+ app.config.globalProperties.$dialog = showDialog;
293
288
  };
294
289
  export {
295
- Dialog,
296
290
  DialogOptions,
297
- _Dialog as default
291
+ Dialog as default,
292
+ showDialog
298
293
  };
@@ -470,8 +470,6 @@ class ImagePreviewOptions {
470
470
  __publicField(this, "maxZoom", 3);
471
471
  __publicField(this, "minZoom", 1 / 3);
472
472
  __publicField(this, "isLoop", true);
473
- __publicField(this, "onClose", () => {
474
- });
475
473
  __publicField(this, "teleport", "body");
476
474
  }
477
475
  }
@@ -479,7 +477,7 @@ class ImagePreviewFunction {
479
477
  constructor(_options) {
480
478
  __publicField(this, "options", new ImagePreviewOptions());
481
479
  const options = Object.assign(this.options, _options);
482
- const { instance, unmount } = CreateComponent(options, {
480
+ const { unmount } = CreateComponent(options, {
483
481
  name: "image-preview",
484
482
  components: [Popup, Video, Swiper, SwiperItem, Overlay],
485
483
  wrapper: () => {
@@ -497,13 +495,13 @@ class ImagePreviewFunction {
497
495
  });
498
496
  }
499
497
  }
500
- const _ImagePreview = (options) => new ImagePreviewFunction(options);
501
- _ImagePreview.install = (app) => {
498
+ const showImagePreview = (options) => new ImagePreviewFunction(options);
499
+ showImagePreview.install = (app) => {
502
500
  app.use(ImagePreview);
503
- app.config.globalProperties.$imagepreview = _ImagePreview;
501
+ app.config.globalProperties.$imagepreview = showImagePreview;
504
502
  };
505
503
  export {
506
- ImagePreview,
507
504
  ImagePreviewOptions,
508
- _ImagePreview as default
505
+ ImagePreview as default,
506
+ showImagePreview
509
507
  };
@@ -188,7 +188,7 @@ const errorMsg = (msg) => {
188
188
  return;
189
189
  }
190
190
  };
191
- const NotifyFunction = {
191
+ const showNotify = {
192
192
  text(msg, obj = {}) {
193
193
  errorMsg(msg);
194
194
  return mountNotify({ ...obj, msg });
@@ -214,11 +214,10 @@ const NotifyFunction = {
214
214
  },
215
215
  install(app) {
216
216
  app.use(Notify);
217
- app.config.globalProperties.$notify = NotifyFunction;
217
+ app.config.globalProperties.$notify = showNotify;
218
218
  }
219
219
  };
220
220
  export {
221
- Notify,
222
- NotifyFunction,
223
- NotifyFunction as default
221
+ Notify as default,
222
+ showNotify
224
223
  };
@@ -245,7 +245,7 @@ const updateToast = (opts) => {
245
245
  }
246
246
  const instance = createVNode(Toast, opts);
247
247
  render(instance, container);
248
- return ToastFunction;
248
+ return showToast;
249
249
  }
250
250
  };
251
251
  const mountToast = (opts) => {
@@ -266,7 +266,7 @@ const mountToast = (opts) => {
266
266
  CreateComponent(opts, {
267
267
  wrapper: Toast
268
268
  });
269
- return ToastFunction;
269
+ return showToast;
270
270
  };
271
271
  const errorMsg = (msg) => {
272
272
  if (!msg) {
@@ -274,7 +274,7 @@ const errorMsg = (msg) => {
274
274
  return;
275
275
  }
276
276
  };
277
- const ToastFunction = {
277
+ const showToast = {
278
278
  text(msg, opts = {}) {
279
279
  errorMsg(msg);
280
280
  return mountToast({ ...opts, type: "text", msg });
@@ -304,11 +304,10 @@ const ToastFunction = {
304
304
  },
305
305
  install(app) {
306
306
  app.use(Toast);
307
- app.config.globalProperties.$toast = ToastFunction;
307
+ app.config.globalProperties.$toast = showToast;
308
308
  }
309
309
  };
310
310
  export {
311
- Toast,
312
- ToastFunction,
313
- ToastFunction as default
311
+ Toast as default,
312
+ showToast
314
313
  };
@@ -1,4 +1,5 @@
1
1
  import _Dialog from '../_es/Dialog.js';
2
+ import { showDialog } from '../_es/Dialog.js';
2
3
  const treeshaking = (t) => t;
3
4
  const Dialog = treeshaking(_Dialog);
4
- export { Dialog };
5
+ export { Dialog, showDialog };
@@ -1,4 +1,5 @@
1
1
  import _ImagePreview from '../_es/ImagePreview.js';
2
+ import { showImagePreview } from '../_es/ImagePreview.js';
2
3
  const treeshaking = (t) => t;
3
4
  const ImagePreview = treeshaking(_ImagePreview);
4
- export { ImagePreview };
5
+ export { ImagePreview, showImagePreview };
@@ -1,4 +1,5 @@
1
1
  import _Notify from '../_es/Notify.js';
2
+ import { showNotify } from '../_es/Notify.js';
2
3
  const treeshaking = (t) => t;
3
4
  const Notify = treeshaking(_Notify);
4
- export { Notify };
5
+ export { Notify, showNotify };
@@ -1,4 +1,5 @@
1
1
  import _Toast from '../_es/Toast.js';
2
+ import { showToast } from '../_es/Toast.js';
2
3
  const treeshaking = (t) => t;
3
4
  const Toast = treeshaking(_Toast);
4
- export { Toast };
5
+ export { Toast, showToast };
@@ -2487,27 +2487,27 @@
2487
2487
  "type": "boolean",
2488
2488
  "description": "属性说明:背景是否锁定,默认值:`false`"
2489
2489
  },
2490
- "nut-toast/Toast.text": {
2490
+ "nut-toast/showToast.text": {
2491
2491
  "type": "message| options",
2492
2492
  "description": "属性说明:展示文字提示,默认值:toast 实例(message支持传入HTML)"
2493
2493
  },
2494
- "nut-toast/Toast.success": {
2494
+ "nut-toast/showToast.success": {
2495
2495
  "type": "message| options",
2496
2496
  "description": "属性说明:展示成功提示,默认值:toast 实例"
2497
2497
  },
2498
- "nut-toast/Toast.fail": {
2498
+ "nut-toast/showToast.fail": {
2499
2499
  "type": "message| options",
2500
2500
  "description": "属性说明:展示失败提示,默认值:toast 实例"
2501
2501
  },
2502
- "nut-toast/Toast.warn": {
2502
+ "nut-toast/showToast.warn": {
2503
2503
  "type": "message| options",
2504
2504
  "description": "属性说明:展示警告提示,默认值:toast 实例"
2505
2505
  },
2506
- "nut-toast/Toast.hide": {
2506
+ "nut-toast/showToast.hide": {
2507
2507
  "type": "默认关闭所有实例,可传id关闭指定实例",
2508
2508
  "description": "属性说明:关闭提示,默认值:void"
2509
2509
  },
2510
- "nut-toast/Toast.loading": {
2510
+ "nut-toast/showToast.loading": {
2511
2511
  "type": "message| options",
2512
2512
  "description": "属性说明:展示加载提示,默认值:toast 实例"
2513
2513
  },
@@ -942,12 +942,12 @@
942
942
  },
943
943
  "nut-toast": {
944
944
  "attributes": [
945
- "Toast.text",
946
- "Toast.success",
947
- "Toast.fail",
948
- "Toast.warn",
949
- "Toast.hide",
950
- "Toast.loading"
945
+ "showToast.text",
946
+ "showToast.success",
947
+ "showToast.fail",
948
+ "showToast.warn",
949
+ "showToast.hide",
950
+ "showToast.loading"
951
951
  ]
952
952
  },
953
953
  "nut-tour": {
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "framework": "vue",
4
4
  "name": "NutUI",
5
- "version": "4.0.0-beta.8",
5
+ "version": "4.0.0-beta.9",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "tags": [
@@ -6169,7 +6169,7 @@
6169
6169
  "events": [],
6170
6170
  "attributes": [
6171
6171
  {
6172
- "name": "Toast.text",
6172
+ "name": "showToast.text",
6173
6173
  "default": "toast 实例(message支持传入HTML)",
6174
6174
  "description": "展示文字提示",
6175
6175
  "value": {
@@ -6178,7 +6178,7 @@
6178
6178
  }
6179
6179
  },
6180
6180
  {
6181
- "name": "Toast.success",
6181
+ "name": "showToast.success",
6182
6182
  "default": "toast 实例",
6183
6183
  "description": "展示成功提示",
6184
6184
  "value": {
@@ -6187,7 +6187,7 @@
6187
6187
  }
6188
6188
  },
6189
6189
  {
6190
- "name": "Toast.fail",
6190
+ "name": "showToast.fail",
6191
6191
  "default": "toast 实例",
6192
6192
  "description": "展示失败提示",
6193
6193
  "value": {
@@ -6196,7 +6196,7 @@
6196
6196
  }
6197
6197
  },
6198
6198
  {
6199
- "name": "Toast.warn",
6199
+ "name": "showToast.warn",
6200
6200
  "default": "toast 实例",
6201
6201
  "description": "展示警告提示",
6202
6202
  "value": {
@@ -6205,7 +6205,7 @@
6205
6205
  }
6206
6206
  },
6207
6207
  {
6208
- "name": "Toast.hide",
6208
+ "name": "showToast.hide",
6209
6209
  "default": "void",
6210
6210
  "description": "关闭提示",
6211
6211
  "value": {
@@ -6214,7 +6214,7 @@
6214
6214
  }
6215
6215
  },
6216
6216
  {
6217
- "name": "Toast.loading",
6217
+ "name": "showToast.loading",
6218
6218
  "default": "toast 实例",
6219
6219
  "description": "展示加载提示",
6220
6220
  "value": {