@opentinyvue/vue-exception 2.26.0 → 2.27.0

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/lib/index.js CHANGED
@@ -8,11 +8,19 @@ function _extends() {
8
8
  }, _extends.apply(null, arguments);
9
9
  }
10
10
  import { defineComponent, $props, $setup, $prefix } from "@opentinyvue/vue-common";
11
+ import PcTemplate from "./pc.js";
11
12
  import MobileFirstTemplate from "./mobile-first.js";
13
+ import "@opentinyvue/vue-theme/exception/index.css";
12
14
  var template = function template2(mode) {
13
15
  var _process$env;
14
- typeof process === "object" ? (_process$env = process.env) == null ? void 0 : _process$env.TINY_MODE : null;
15
- return MobileFirstTemplate;
16
+ var tinyMode = typeof process === "object" ? (_process$env = process.env) == null ? void 0 : _process$env.TINY_MODE : null;
17
+ if ("pc" === (tinyMode || mode)) {
18
+ return PcTemplate;
19
+ }
20
+ if ("mobile-first" === (tinyMode || mode)) {
21
+ return MobileFirstTemplate;
22
+ }
23
+ return PcTemplate;
16
24
  };
17
25
  var Exception = defineComponent({
18
26
  name: $prefix + "Exception",
package/lib/pc.js ADDED
@@ -0,0 +1,159 @@
1
+ import { renderless, api } from '@opentinyvue/vue-renderless/exception/vue';
2
+ import { defineComponent, setup, $props } from '@opentinyvue/vue-common';
3
+ import Button from '@opentinyvue/vue-button';
4
+ import { iconNoData, iconNoNews, iconNoPerm, iconNoResult, iconWeaknet, iconPageNoperm, iconPageNothing, iconPageServererror, iconPageWeaknet } from '@opentinyvue/vue-icon';
5
+
6
+ function normalizeComponent(scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
7
+ var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
8
+ if (render) {
9
+ options.render = render;
10
+ options.staticRenderFns = staticRenderFns;
11
+ options._compiled = true;
12
+ }
13
+ var hook;
14
+ if (injectStyles) {
15
+ hook = injectStyles;
16
+ }
17
+ if (hook) {
18
+ if (options.functional) {
19
+ options._injectStyles = hook;
20
+ var originalRender = options.render;
21
+ options.render = function renderWithStyleInjection(h, context) {
22
+ hook.call(context);
23
+ return originalRender(h, context);
24
+ };
25
+ } else {
26
+ var existing = options.beforeCreate;
27
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
28
+ }
29
+ }
30
+ return {
31
+ exports: scriptExports,
32
+ options
33
+ };
34
+ }
35
+
36
+ function _extends() {
37
+ return _extends = Object.assign ? Object.assign.bind() : function(n) {
38
+ for (var e = 1; e < arguments.length; e++) {
39
+ var t = arguments[e];
40
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
41
+ }
42
+ return n;
43
+ }, _extends.apply(null, arguments);
44
+ }
45
+ var $constants = {
46
+ INTERNALCONFIG: {
47
+ NODATA: "ui.exception.nodata",
48
+ NOPERM: "ui.exception.noperm",
49
+ WEAKNET: "ui.exception.weaknet",
50
+ NORESULT: "ui.exception.noresult",
51
+ NONEWS: "ui.exception.nonews",
52
+ PAGENOPERM: "ui.exception.pagenoperm",
53
+ PAGEWEAKNET: "ui.exception.pageweaknet",
54
+ PAGENOTHING: "ui.exception.pagenothing",
55
+ PAGESERVERERROR: "ui.exception.pageservererror"
56
+ },
57
+ ICONCONFIG: {
58
+ NODATA: "icon-no-data",
59
+ NOPERM: "icon-no-perm",
60
+ NONEWS: "icon-no-news",
61
+ WEAKNET: "icon-weaknet",
62
+ NORESULT: "icon-no-result",
63
+ PAGENOPERM: "icon-page-noperm",
64
+ PAGENOTHING: "icon-page-nothing",
65
+ PAGESERVERERROR: "icon-page-servererror",
66
+ PAGEWEAKNET: "icon-page-weaknet"
67
+ }
68
+ };
69
+ var __vue2_script = defineComponent({
70
+ components: {
71
+ TinyButton: Button,
72
+ IconNoData: iconNoData(),
73
+ IconNoNews: iconNoNews(),
74
+ IconNoPerm: iconNoPerm(),
75
+ IconNoResult: iconNoResult(),
76
+ IconWeaknet: iconWeaknet(),
77
+ IconPageNoperm: iconPageNoperm(),
78
+ IconPageNothing: iconPageNothing(),
79
+ IconPageServererror: iconPageServererror(),
80
+ IconPageWeaknet: iconPageWeaknet()
81
+ },
82
+ emits: ["click"],
83
+ props: _extends({}, $props, {
84
+ _constants: {
85
+ type: Object,
86
+ default: function _default() {
87
+ return $constants;
88
+ }
89
+ },
90
+ type: {
91
+ type: String,
92
+ default: "nodata"
93
+ },
94
+ subMessage: String,
95
+ exceptionClass: String,
96
+ pageEmpty: {
97
+ type: Boolean,
98
+ default: false
99
+ },
100
+ componentPage: {
101
+ type: Boolean,
102
+ default: false
103
+ }
104
+ }),
105
+ setup: function setup$1(props, context) {
106
+ return setup({
107
+ props,
108
+ context,
109
+ renderless,
110
+ api
111
+ });
112
+ }
113
+ });
114
+ var render = function render2() {
115
+ var _vm = this;
116
+ var _h = _vm.$createElement;
117
+ var _c = _vm._self._c || _h;
118
+ return _c("div", {
119
+ staticClass: "tiny-exception",
120
+ class: _vm.exceptionClass
121
+ }, [_c("div", {
122
+ staticClass: "tiny-exception-body"
123
+ }, [_c("div", {
124
+ staticClass: "tiny-exception__image bg-cover",
125
+ class: {
126
+ "tiny-exception__componentpage-image": _vm.componentPage
127
+ }
128
+ }, [_vm._t("icon", function() {
129
+ return [_vm.state.urlType ? _c(_vm._constants.ICONCONFIG[_vm.type.toUpperCase()], {
130
+ tag: "component"
131
+ }) : _vm._e()];
132
+ })], 2), _vm._t("content", function() {
133
+ return [_c("div", {
134
+ staticClass: "tiny-exception__description"
135
+ }, [_c("div", {
136
+ staticClass: "tiny-exception__message",
137
+ class: {
138
+ "tiny-exception__componentpage": _vm.componentPage
139
+ }
140
+ }, [_vm._v(" " + _vm._s(_vm.t(_vm._constants.INTERNALCONFIG[_vm.type.toUpperCase()])) + " ")]), _vm.subMessage ? _c("div", {
141
+ staticClass: "tiny-exception__submessage"
142
+ }, [_vm._v(" " + _vm._s(_vm.subMessage) + " ")]) : _vm._e(), _c("div", {
143
+ staticClass: "tiny-exception__footer"
144
+ }, [_vm._t("default")], 2)])];
145
+ })], 2)]);
146
+ };
147
+ var staticRenderFns = [];
148
+ var __cssModules = {};
149
+ var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles);
150
+ function __vue2_injectStyles(context) {
151
+ for (var o in __cssModules) {
152
+ this[o] = __cssModules[o];
153
+ }
154
+ }
155
+ var pc = /* @__PURE__ */ (function() {
156
+ return __component__.exports;
157
+ })();
158
+
159
+ export { pc as default };
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@opentinyvue/vue-exception",
3
- "version": "2.26.0",
3
+ "version": "2.27.0",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",
7
7
  "sideEffects": false,
8
8
  "type": "module",
9
9
  "dependencies": {
10
- "@opentinyvue/vue-renderless": "~3.26.0",
11
- "@opentinyvue/vue-common": "~2.26.0",
12
- "@opentinyvue/vue-button": "~2.26.0",
13
- "@opentinyvue/vue-icon": "~2.26.0"
10
+ "@opentinyvue/vue-renderless": "~3.27.0",
11
+ "@opentinyvue/vue-common": "~2.27.0",
12
+ "@opentinyvue/vue-button": "~2.27.0",
13
+ "@opentinyvue/vue-icon": "~2.27.0"
14
14
  },
15
15
  "license": "MIT",
16
16
  "types": "index.d.ts",
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;