@opentinyvue/vue-exception 3.26.0 → 3.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,176 @@
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
+ import { openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, createBlock, resolveDynamicComponent, createCommentVNode, toDisplayString } from 'vue';
6
+
7
+ function _createForOfIteratorHelperLoose(r, e) {
8
+ var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
9
+ if (t) return (t = t.call(r)).next.bind(t);
10
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
11
+ t && (r = t);
12
+ var o = 0;
13
+ return function() {
14
+ return o >= r.length ? { done: true } : { done: false, value: r[o++] };
15
+ };
16
+ }
17
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
18
+ }
19
+ function _unsupportedIterableToArray(r, a) {
20
+ if (r) {
21
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
22
+ var t = {}.toString.call(r).slice(8, -1);
23
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
24
+ }
25
+ }
26
+ function _arrayLikeToArray(r, a) {
27
+ (null == a || a > r.length) && (a = r.length);
28
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
29
+ return n;
30
+ }
31
+ var _export_sfc = function _export_sfc2(sfc, props) {
32
+ var target = sfc.__vccOpts || sfc;
33
+ for (var _iterator = _createForOfIteratorHelperLoose(props), _step; !(_step = _iterator()).done; ) {
34
+ var _step$value = _step.value, key = _step$value[0], val = _step$value[1];
35
+ target[key] = val;
36
+ }
37
+ return target;
38
+ };
39
+
40
+ function _extends() {
41
+ return _extends = Object.assign ? Object.assign.bind() : function(n) {
42
+ for (var e = 1; e < arguments.length; e++) {
43
+ var t = arguments[e];
44
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
45
+ }
46
+ return n;
47
+ }, _extends.apply(null, arguments);
48
+ }
49
+ var $constants = {
50
+ INTERNALCONFIG: {
51
+ NODATA: "ui.exception.nodata",
52
+ NOPERM: "ui.exception.noperm",
53
+ WEAKNET: "ui.exception.weaknet",
54
+ NORESULT: "ui.exception.noresult",
55
+ NONEWS: "ui.exception.nonews",
56
+ PAGENOPERM: "ui.exception.pagenoperm",
57
+ PAGEWEAKNET: "ui.exception.pageweaknet",
58
+ PAGENOTHING: "ui.exception.pagenothing",
59
+ PAGESERVERERROR: "ui.exception.pageservererror"
60
+ },
61
+ ICONCONFIG: {
62
+ NODATA: "icon-no-data",
63
+ NOPERM: "icon-no-perm",
64
+ NONEWS: "icon-no-news",
65
+ WEAKNET: "icon-weaknet",
66
+ NORESULT: "icon-no-result",
67
+ PAGENOPERM: "icon-page-noperm",
68
+ PAGENOTHING: "icon-page-nothing",
69
+ PAGESERVERERROR: "icon-page-servererror",
70
+ PAGEWEAKNET: "icon-page-weaknet"
71
+ }
72
+ };
73
+ var _sfc_main = defineComponent({
74
+ components: {
75
+ TinyButton: Button,
76
+ IconNoData: iconNoData(),
77
+ IconNoNews: iconNoNews(),
78
+ IconNoPerm: iconNoPerm(),
79
+ IconNoResult: iconNoResult(),
80
+ IconWeaknet: iconWeaknet(),
81
+ IconPageNoperm: iconPageNoperm(),
82
+ IconPageNothing: iconPageNothing(),
83
+ IconPageServererror: iconPageServererror(),
84
+ IconPageWeaknet: iconPageWeaknet()
85
+ },
86
+ emits: ["click"],
87
+ props: _extends({}, $props, {
88
+ _constants: {
89
+ type: Object,
90
+ default: function _default() {
91
+ return $constants;
92
+ }
93
+ },
94
+ type: {
95
+ type: String,
96
+ default: "nodata"
97
+ },
98
+ subMessage: String,
99
+ exceptionClass: String,
100
+ pageEmpty: {
101
+ type: Boolean,
102
+ default: false
103
+ },
104
+ componentPage: {
105
+ type: Boolean,
106
+ default: false
107
+ }
108
+ }),
109
+ setup: function setup$1(props, context) {
110
+ return setup({
111
+ props,
112
+ context,
113
+ renderless,
114
+ api
115
+ });
116
+ }
117
+ });
118
+ var _hoisted_1 = {
119
+ class: "tiny-exception-body"
120
+ };
121
+ var _hoisted_2 = {
122
+ class: "tiny-exception__description"
123
+ };
124
+ var _hoisted_3 = {
125
+ key: 0,
126
+ class: "tiny-exception__submessage"
127
+ };
128
+ var _hoisted_4 = {
129
+ class: "tiny-exception__footer"
130
+ };
131
+ function _sfc_render(_ctx, _cache, $props2, $setup, $data, $options) {
132
+ return openBlock(), createElementBlock(
133
+ "div",
134
+ {
135
+ class: normalizeClass(["tiny-exception", _ctx.exceptionClass])
136
+ },
137
+ [createElementVNode("div", _hoisted_1, [createElementVNode(
138
+ "div",
139
+ {
140
+ class: normalizeClass(["tiny-exception__image bg-cover", {
141
+ "tiny-exception__componentpage-image": _ctx.componentPage
142
+ }])
143
+ },
144
+ [renderSlot(_ctx.$slots, "icon", {}, function() {
145
+ return [_ctx.state.urlType ? (openBlock(), createBlock(resolveDynamicComponent(_ctx._constants.ICONCONFIG[_ctx.type.toUpperCase()]), {
146
+ key: 0
147
+ })) : createCommentVNode("v-if", true)];
148
+ })],
149
+ 2
150
+ /* CLASS */
151
+ ), renderSlot(_ctx.$slots, "content", {}, function() {
152
+ return [createElementVNode("div", _hoisted_2, [createElementVNode(
153
+ "div",
154
+ {
155
+ class: normalizeClass(["tiny-exception__message", {
156
+ "tiny-exception__componentpage": _ctx.componentPage
157
+ }])
158
+ },
159
+ toDisplayString(_ctx.t(_ctx._constants.INTERNALCONFIG[_ctx.type.toUpperCase()])),
160
+ 3
161
+ /* TEXT, CLASS */
162
+ ), _ctx.subMessage ? (openBlock(), createElementBlock(
163
+ "div",
164
+ _hoisted_3,
165
+ toDisplayString(_ctx.subMessage),
166
+ 1
167
+ /* TEXT */
168
+ )) : createCommentVNode("v-if", true), createElementVNode("div", _hoisted_4, [renderSlot(_ctx.$slots, "default")])])];
169
+ })])],
170
+ 2
171
+ /* CLASS */
172
+ );
173
+ }
174
+ var pc = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
175
+
176
+ export { pc as default };
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@opentinyvue/vue-exception",
3
- "version": "3.26.0",
3
+ "version": "3.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": "~3.26.0",
12
- "@opentinyvue/vue-button": "~3.26.0",
13
- "@opentinyvue/vue-icon": "~3.26.0"
10
+ "@opentinyvue/vue-renderless": "~3.27.0",
11
+ "@opentinyvue/vue-common": "~3.27.0",
12
+ "@opentinyvue/vue-button": "~3.27.0",
13
+ "@opentinyvue/vue-icon": "~3.27.0"
14
14
  },
15
15
  "license": "MIT",
16
16
  "types": "index.d.ts",
@@ -0,0 +1,108 @@
1
+ declare const _default: import("@vue/runtime-core").DefineComponent<{
2
+ _constants: {
3
+ type: ObjectConstructor;
4
+ default: () => {
5
+ INTERNALCONFIG: {
6
+ NODATA: string;
7
+ NOPERM: string;
8
+ WEAKNET: string;
9
+ NORESULT: string;
10
+ NONEWS: string;
11
+ PAGENOPERM: string;
12
+ PAGEWEAKNET: string;
13
+ PAGENOTHING: string;
14
+ PAGESERVERERROR: string;
15
+ };
16
+ ICONCONFIG: {
17
+ NODATA: string;
18
+ NOPERM: string;
19
+ NONEWS: string;
20
+ WEAKNET: string;
21
+ NORESULT: string;
22
+ PAGENOPERM: string;
23
+ PAGENOTHING: string;
24
+ PAGESERVERERROR: string;
25
+ PAGEWEAKNET: string;
26
+ };
27
+ };
28
+ };
29
+ type: {
30
+ type: StringConstructor;
31
+ default: string;
32
+ };
33
+ subMessage: StringConstructor;
34
+ exceptionClass: StringConstructor;
35
+ pageEmpty: {
36
+ type: BooleanConstructor;
37
+ default: boolean;
38
+ };
39
+ componentPage: {
40
+ type: BooleanConstructor;
41
+ default: boolean;
42
+ };
43
+ tiny_mode: StringConstructor;
44
+ tiny_mode_root: BooleanConstructor;
45
+ tiny_template: (ObjectConstructor | FunctionConstructor)[];
46
+ tiny_renderless: FunctionConstructor;
47
+ tiny_theme: StringConstructor;
48
+ tiny_mcp_config: ObjectConstructor;
49
+ tiny_chart_theme: ObjectConstructor;
50
+ }, any, unknown, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, "click"[], "click", import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
51
+ _constants: {
52
+ type: ObjectConstructor;
53
+ default: () => {
54
+ INTERNALCONFIG: {
55
+ NODATA: string;
56
+ NOPERM: string;
57
+ WEAKNET: string;
58
+ NORESULT: string;
59
+ NONEWS: string;
60
+ PAGENOPERM: string;
61
+ PAGEWEAKNET: string;
62
+ PAGENOTHING: string;
63
+ PAGESERVERERROR: string;
64
+ };
65
+ ICONCONFIG: {
66
+ NODATA: string;
67
+ NOPERM: string;
68
+ NONEWS: string;
69
+ WEAKNET: string;
70
+ NORESULT: string;
71
+ PAGENOPERM: string;
72
+ PAGENOTHING: string;
73
+ PAGESERVERERROR: string;
74
+ PAGEWEAKNET: string;
75
+ };
76
+ };
77
+ };
78
+ type: {
79
+ type: StringConstructor;
80
+ default: string;
81
+ };
82
+ subMessage: StringConstructor;
83
+ exceptionClass: StringConstructor;
84
+ pageEmpty: {
85
+ type: BooleanConstructor;
86
+ default: boolean;
87
+ };
88
+ componentPage: {
89
+ type: BooleanConstructor;
90
+ default: boolean;
91
+ };
92
+ tiny_mode: StringConstructor;
93
+ tiny_mode_root: BooleanConstructor;
94
+ tiny_template: (ObjectConstructor | FunctionConstructor)[];
95
+ tiny_renderless: FunctionConstructor;
96
+ tiny_theme: StringConstructor;
97
+ tiny_mcp_config: ObjectConstructor;
98
+ tiny_chart_theme: ObjectConstructor;
99
+ }>> & {
100
+ onClick?: ((...args: any[]) => any) | undefined;
101
+ }, {
102
+ type: string;
103
+ tiny_mode_root: boolean;
104
+ _constants: Record<string, any>;
105
+ pageEmpty: boolean;
106
+ componentPage: boolean;
107
+ }, {}>;
108
+ export default _default;