@ibiz-template/mob-vue3-components 0.0.13 → 0.0.15

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.
@@ -61,15 +61,15 @@ const RouterShell = /* @__PURE__ */ defineComponent({
61
61
  context,
62
62
  params,
63
63
  srfnav,
64
- viewModel
64
+ viewConfig
65
65
  } = this.viewData;
66
66
  const props = mergeDeepLeft({
67
67
  ...this.$props,
68
68
  ...this.$attrs,
69
69
  context,
70
70
  params,
71
- modelData: viewModel,
72
- key: viewModel.codeName
71
+ viewId: viewConfig.id,
72
+ key: viewConfig.codeName
73
73
  }, {
74
74
  state: {
75
75
  srfnav
@@ -7,6 +7,7 @@ import { createVueApp } from './create-vue-app.mjs';
7
7
  import { AppRouter } from './router/index.mjs';
8
8
  import './util/index.mjs';
9
9
  import '../util/index.mjs';
10
+ import { UnauthorizedHandler } from './util/unauthorized-handler/unauthorized-handler.mjs';
10
11
  import { OpenViewUtil } from '../util/open-view-util/open-view-util.mjs';
11
12
  import { MessageUtil } from '../util/message-util/message-util.mjs';
12
13
  import { ModalUtil } from '../util/modal-util/modal-util.mjs';
@@ -14,7 +15,6 @@ import { ConfirmUtil } from '../util/confirm-util/confirm-util.mjs';
14
15
  import { NotificationUtil } from '../util/notification-util/notification-util.mjs';
15
16
  import { LoadingUtil } from '../util/loading-util/loading-util.mjs';
16
17
  import { OverlayController } from '../util/overlay-controller/overlay-controller.mjs';
17
- import { UnauthorizedHandler } from './util/unauthorized-handler/unauthorized-handler.mjs';
18
18
 
19
19
  "use strict";
20
20
  async function runApp(plugins) {
@@ -28,6 +28,7 @@ async function runApp(plugins) {
28
28
  install();
29
29
  install$1();
30
30
  ibiz.plugin = new PluginFactory();
31
+ ibiz.util.error.register(new UnauthorizedHandler());
31
32
  const app = createVueApp(App);
32
33
  OverlayContainer.createVueApp = createVueApp;
33
34
  window.onerror = function(_event, _source, _lineno, _colno, error) {
@@ -51,7 +52,6 @@ async function runApp(plugins) {
51
52
  ibiz.notification = new NotificationUtil();
52
53
  ibiz.loading = new LoadingUtil();
53
54
  ibiz.overlay = new OverlayController();
54
- ibiz.util.error.register(new UnauthorizedHandler());
55
55
  ibiz.platform = getPlatformProvider();
56
56
  await ibiz.i18n.init();
57
57
  app.mount("#app");
@@ -42,12 +42,16 @@ class AppRouter {
42
42
  * @return {*}
43
43
  */
44
44
  static createRouter() {
45
- const beforeEnter = async () => {
45
+ const beforeEnter = async (_to, _from, next) => {
46
46
  if (!isNilOrEmpty(ibiz.appData)) {
47
- return true;
47
+ next();
48
48
  }
49
49
  const authority = await AuthGuard();
50
- return authority;
50
+ if (authority) {
51
+ next();
52
+ } else {
53
+ next(false);
54
+ }
51
55
  };
52
56
  const placeholder = ibiz.env.routePlaceholder;
53
57
  const paramReg = `[^/]+=[^/]+|${placeholder}`;
@@ -12,7 +12,7 @@ export declare const IBizPanelButton: import("@ibiz-template/vue3-util").TypeWit
12
12
  }, {
13
13
  ns: import("@ibiz-template/core").Namespace;
14
14
  captionText: import("vue").ComputedRef<any>;
15
- buttonType: import("vue").ComputedRef<"default" | "text" | "success" | "primary" | "danger" | "warning">;
15
+ buttonType: import("vue").ComputedRef<"text" | "success" | "primary" | "danger" | "warning" | "default">;
16
16
  showCaption: boolean | undefined;
17
17
  sysImage: import("@ibiz/model-core").ISysImage | undefined;
18
18
  codeName: string | undefined;
@@ -14,7 +14,7 @@ export declare const PanelButton: import("vue").DefineComponent<{
14
14
  }, {
15
15
  ns: import("@ibiz-template/core").Namespace;
16
16
  captionText: import("vue").ComputedRef<any>;
17
- buttonType: import("vue").ComputedRef<"default" | "text" | "success" | "primary" | "danger" | "warning">;
17
+ buttonType: import("vue").ComputedRef<"text" | "success" | "primary" | "danger" | "warning" | "default">;
18
18
  showCaption: boolean | undefined;
19
19
  sysImage: import("@ibiz/model-core").ISysImage | undefined;
20
20
  codeName: string | undefined;
@@ -15,6 +15,7 @@ export declare const AppModalComponent: import("vue").DefineComponent<{
15
15
  footerHide?: boolean | undefined;
16
16
  placement?: "center" | undefined;
17
17
  modalClass?: string | undefined;
18
+ isRouteModal?: boolean | undefined;
18
19
  }>;
19
20
  modalZIndex: number;
20
21
  customStyle: IData;
@@ -9,6 +9,7 @@ import { INotificationUtil, NotificationParams } from '@ibiz-template/runtime';
9
9
  * @implements {INotificationUtil}
10
10
  */
11
11
  export declare class NotificationUtil implements INotificationUtil {
12
+ default(_params: NotificationParams): void;
12
13
  info(params: NotificationParams): void;
13
14
  success(params: NotificationParams): void;
14
15
  warning(params: NotificationParams): void;
@@ -2,6 +2,9 @@ import { showNotify } from 'vant';
2
2
 
3
3
  "use strict";
4
4
  class NotificationUtil {
5
+ default(_params) {
6
+ throw new Error("\u672A\u5B9E\u73B0");
7
+ }
5
8
  info(params) {
6
9
  const duration = params.duration ? params.duration * 1e3 : 4500;
7
10
  showNotify({
@@ -1,5 +1,6 @@
1
1
  import { RuntimeError } from '@ibiz-template/core';
2
2
  import { getNestedRoutePath } from '@ibiz-template/vue3-util';
3
+ import { isNavigationFailure } from 'vue-router';
3
4
  import { defineStore } from 'pinia';
4
5
  import { reactive } from 'vue';
5
6
  import { QXEvent } from 'qx-util';
@@ -51,7 +52,10 @@ const useViewStack = defineStore("viewStack", () => {
51
52
  };
52
53
  const init = (_router) => {
53
54
  router = _router;
54
- _router.afterEach((to) => {
55
+ _router.afterEach((to, _form, failure) => {
56
+ if (isNavigationFailure(failure)) {
57
+ return;
58
+ }
55
59
  const { key, isCache } = calcUniqueKey(to);
56
60
  if (isCache) {
57
61
  if (key === viewStack.currentKey) {
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var runtime = require('@ibiz-template/runtime');
6
+ var vue = require('vue');
6
7
  var notSupportedEditor = require('./not-supported-editor/not-supported-editor.cjs');
7
8
  require('./span/index.cjs');
8
9
  require('./text-box/index.cjs');
@@ -21,7 +22,6 @@ require('./date-range/index.cjs');
21
22
  require('./cascader/index.cjs');
22
23
  require('./color-picker/index.cjs');
23
24
  require('./markdown/index.cjs');
24
- var ibizMarkdownEditor = require('./markdown/ibiz-markdown-editor/ibiz-markdown-editor.cjs');
25
25
  var ibizDropdownList = require('./dropdown-list/ibiz-dropdown-list/ibiz-dropdown-list.cjs');
26
26
  require('./check-box/index.cjs');
27
27
  require('./common/index.cjs');
@@ -114,8 +114,13 @@ const IBizEditor = {
114
114
  v.component(ibizCascader.IBizCascader.name, ibizCascader.IBizCascader);
115
115
  v.component(ibizColorPicker.IBizColorPicker.name, ibizColorPicker.IBizColorPicker);
116
116
  v.component(ibizPickerSelectView.IBizPickerSelectView.name, ibizPickerSelectView.IBizPickerSelectView);
117
- v.component(ibizMarkdownEditor.default.name, ibizMarkdownEditor.default);
118
117
  v.component(ibizCarousel.IBizEditorCarousel.name, ibizCarousel.IBizEditorCarousel);
118
+ v.component(
119
+ "IBizMarkDown",
120
+ vue.defineAsyncComponent(
121
+ () => Promise.resolve().then(function () { return require('./markdown/ibiz-markdown-editor/ibiz-markdown-editor.cjs'); })
122
+ )
123
+ );
119
124
  runtime.registerEditorProvider("SPAN", () => new spanEditor_provider.SpanEditorProvider());
120
125
  const textBoxEditorProvider = new textBoxEditor_provider.TextBoxEditorProvider();
121
126
  runtime.registerEditorProvider("MOBTEXT", () => textBoxEditorProvider);
@@ -63,15 +63,15 @@ const RouterShell = /* @__PURE__ */ vue.defineComponent({
63
63
  context,
64
64
  params,
65
65
  srfnav,
66
- viewModel
66
+ viewConfig
67
67
  } = this.viewData;
68
68
  const props = ramda.mergeDeepLeft({
69
69
  ...this.$props,
70
70
  ...this.$attrs,
71
71
  context,
72
72
  params,
73
- modelData: viewModel,
74
- key: viewModel.codeName
73
+ viewId: viewConfig.id,
74
+ key: viewConfig.codeName
75
75
  }, {
76
76
  state: {
77
77
  srfnav
@@ -9,6 +9,7 @@ var createVueApp = require('./create-vue-app.cjs');
9
9
  var index = require('./router/index.cjs');
10
10
  require('./util/index.cjs');
11
11
  require('../util/index.cjs');
12
+ var unauthorizedHandler = require('./util/unauthorized-handler/unauthorized-handler.cjs');
12
13
  var openViewUtil = require('../util/open-view-util/open-view-util.cjs');
13
14
  var messageUtil = require('../util/message-util/message-util.cjs');
14
15
  var modalUtil = require('../util/modal-util/modal-util.cjs');
@@ -16,7 +17,6 @@ var confirmUtil = require('../util/confirm-util/confirm-util.cjs');
16
17
  var notificationUtil = require('../util/notification-util/notification-util.cjs');
17
18
  var loadingUtil = require('../util/loading-util/loading-util.cjs');
18
19
  var overlayController = require('../util/overlay-controller/overlay-controller.cjs');
19
- var unauthorizedHandler = require('./util/unauthorized-handler/unauthorized-handler.cjs');
20
20
 
21
21
  "use strict";
22
22
  async function runApp(plugins) {
@@ -30,6 +30,7 @@ async function runApp(plugins) {
30
30
  core.install();
31
31
  runtime.install();
32
32
  ibiz.plugin = new vue3Util.PluginFactory();
33
+ ibiz.util.error.register(new unauthorizedHandler.UnauthorizedHandler());
33
34
  const app = createVueApp.createVueApp(App.default);
34
35
  vue3Util.OverlayContainer.createVueApp = createVueApp.createVueApp;
35
36
  window.onerror = function(_event, _source, _lineno, _colno, error) {
@@ -53,7 +54,6 @@ async function runApp(plugins) {
53
54
  ibiz.notification = new notificationUtil.NotificationUtil();
54
55
  ibiz.loading = new loadingUtil.LoadingUtil();
55
56
  ibiz.overlay = new overlayController.OverlayController();
56
- ibiz.util.error.register(new unauthorizedHandler.UnauthorizedHandler());
57
57
  ibiz.platform = runtime.getPlatformProvider();
58
58
  await ibiz.i18n.init();
59
59
  app.mount("#app");
@@ -44,12 +44,16 @@ class AppRouter {
44
44
  * @return {*}
45
45
  */
46
46
  static createRouter() {
47
- const beforeEnter = async () => {
47
+ const beforeEnter = async (_to, _from, next) => {
48
48
  if (!qxUtil.isNilOrEmpty(ibiz.appData)) {
49
- return true;
49
+ next();
50
50
  }
51
51
  const authority = await authGuard.AuthGuard();
52
- return authority;
52
+ if (authority) {
53
+ next();
54
+ } else {
55
+ next(false);
56
+ }
53
57
  };
54
58
  const placeholder = ibiz.env.routePlaceholder;
55
59
  const paramReg = `[^/]+=[^/]+|${placeholder}`;
@@ -4,6 +4,9 @@ var Vant = require('vant');
4
4
 
5
5
  "use strict";
6
6
  class NotificationUtil {
7
+ default(_params) {
8
+ throw new Error("\u672A\u5B9E\u73B0");
9
+ }
7
10
  info(params) {
8
11
  const duration = params.duration ? params.duration * 1e3 : 4500;
9
12
  Vant.showNotify({
@@ -2,6 +2,7 @@
2
2
 
3
3
  var core = require('@ibiz-template/core');
4
4
  var vue3Util = require('@ibiz-template/vue3-util');
5
+ var vueRouter = require('vue-router');
5
6
  var pinia = require('pinia');
6
7
  var vue = require('vue');
7
8
  var qxUtil = require('qx-util');
@@ -53,7 +54,10 @@ const useViewStack = pinia.defineStore("viewStack", () => {
53
54
  };
54
55
  const init = (_router) => {
55
56
  router = _router;
56
- _router.afterEach((to) => {
57
+ _router.afterEach((to, _form, failure) => {
58
+ if (vueRouter.isNavigationFailure(failure)) {
59
+ return;
60
+ }
57
61
  const { key, isCache } = calcUniqueKey(to);
58
62
  if (isCache) {
59
63
  if (key === viewStack.currentKey) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiz-template/mob-vue3-components",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "description": "使用 rollup 编译 vue 组件或者 jsx",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.mjs",
@@ -24,12 +24,12 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@ibiz-template-package/vs-tree-ex": "^0.1.1",
27
- "@ibiz-template/core": "^0.6.0",
28
- "@ibiz-template/model-helper": "0.6.1-alpha.0",
29
- "@ibiz-template/runtime": "0.6.1-alpha.0",
27
+ "@ibiz-template/core": "^0.6.3",
28
+ "@ibiz-template/model-helper": "^0.6.3",
29
+ "@ibiz-template/runtime": "^0.6.3",
30
30
  "@ibiz-template/theme": "^0.6.0",
31
- "@ibiz-template/vue3-util": "0.6.1-alpha.0",
32
- "@ibiz/model-core": "^0.1.11",
31
+ "@ibiz-template/vue3-util": "^0.6.3",
32
+ "@ibiz/model-core": "^0.1.14",
33
33
  "@ibiz-template/mob-theme": "^0.2.12",
34
34
  "async-validator": "^4.2.5",
35
35
  "cherry-markdown": "^0.8.26",