@truenewx/tnxvue3 3.0.11 → 3.0.13

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/index.html ADDED
@@ -0,0 +1,12 @@
1
+ <!DOCTYPE html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>tnxvue3</title>
7
+ </head>
8
+ <body>
9
+ <div id="app"></div>
10
+ <script type="module" src="./sample/main.js"></script>
11
+ </body>
12
+ </html>
package/package.json CHANGED
@@ -1,11 +1,9 @@
1
1
  {
2
2
  "name": "@truenewx/tnxvue3",
3
- "version": "3.0.11",
3
+ "version": "3.0.13",
4
4
  "description": "互联网技术解决方案:Vue3扩展支持",
5
5
  "private": false,
6
- "publishConfig": {
7
- "access": "public"
8
- },
6
+ "type": "module",
9
7
  "main": "src/tnxvue.js",
10
8
  "keywords": [
11
9
  "truenewx",
@@ -15,8 +13,9 @@
15
13
  "author": "truenewx",
16
14
  "license": "Apache-2.0",
17
15
  "scripts": {
18
- "serve": "vue-cli-service serve",
19
- "build": "vue-cli-service build"
16
+ "dev": "vite",
17
+ "build": "vite build",
18
+ "preview": "vite preview"
20
19
  },
21
20
  "peerDependencies": {
22
21
  "element-plus": "~2.8.0",
@@ -25,22 +24,16 @@
25
24
  "vue-router": "~4.4.0"
26
25
  },
27
26
  "dependencies": {
28
- "@truenewx/tnxcore": "3.0.8",
27
+ "@truenewx/tnxcore": "3.0.11",
29
28
  "@element-plus/icons-vue": "2.3.1",
30
29
  "async-validator": "4.2.5",
31
30
  "mitt": "3.0.1"
32
31
  },
33
32
  "devDependencies": {
34
- "@babel/core": "7.22.5",
35
- "@babel/eslint-parser": "7.22.5",
36
- "@babel/preset-env": "7.22.5",
37
- "@vue/cli-plugin-babel": "5.0.8",
38
- "@vue/cli-plugin-eslint": "5.0.8",
39
- "@vue/cli-service": "5.0.8",
33
+ "@vitejs/plugin-vue": "5.2.1",
34
+ "vite": "6.2.0",
40
35
  "eslint": "7.32.0",
41
- "eslint-plugin-vue": "8.7.1",
42
- "copy-webpack-plugin": "11.0.0",
43
- "terser-webpack-plugin": "5.3.7"
36
+ "eslint-plugin-vue": "8.7.1"
44
37
  },
45
38
  "eslintConfig": {
46
39
  "root": true,
@@ -51,9 +44,6 @@
51
44
  "plugin:vue/vue3-essential",
52
45
  "eslint:recommended"
53
46
  ],
54
- "parserOptions": {
55
- "parser": "@babel/eslint-parser"
56
- },
57
47
  "rules": {
58
48
  "eqeqeq": "warn",
59
49
  "no-unused-vars": [
@@ -116,8 +116,7 @@ export default {
116
116
  }
117
117
  }
118
118
  },
119
- getText(value) {
120
- // 暂不支持分组枚举类型
119
+ getCaption(value) {
121
120
  if (this.$refs.select) {
122
121
  return this.$refs.select.getText(value);
123
122
  }
@@ -218,7 +218,11 @@ export default {
218
218
  // 设置输入框为无效状态
219
219
  let fieldElement = this.queryFieldElement(fieldGroupElement);
220
220
  if (fieldElement) {
221
- fieldElement.classList.add('is-invalid');
221
+ // 如果字段元素或其上级元素中不包含.ignore-feedback样式,则加入.is-invalid样式
222
+ if (!fieldElement.classList.contains('ignore-feedback')
223
+ && !fieldElement.closest('.ignore-feedback')) {
224
+ fieldElement.classList.add('is-invalid');
225
+ }
222
226
  }
223
227
  }
224
228
  },
@@ -346,26 +346,30 @@ export default {
346
346
  </script>
347
347
 
348
348
  <style>
349
- .tnxbsv-select[variant="danger"] {
349
+ .tnxbsv-select[variant="outline-danger"] {
350
350
  border-color: var(--bs-danger-border-subtle);
351
351
  color: var(--bs-danger);
352
352
  }
353
353
 
354
- .tnxbsv-select[variant="danger"]:focus {
354
+ .tnxbsv-select[variant="outline-danger"]:focus {
355
355
  box-shadow: 0 0 0 0.25rem rgba(var(--bs-danger-rgb), 0.25);
356
356
  }
357
357
 
358
+ .tnxbsv-radio-group.btn-group > .btn {
359
+ flex: none;
360
+ --bs-btn-padding-x: 1rem;
361
+ }
362
+
363
+ select.tnxbsv-select option:disabled {
364
+ color: var(--bs-tertiary-color);
365
+ }
366
+
358
367
  select.tnxbsv-select.is-empty,
359
368
  .tnxbsv-select .empty-item {
360
369
  color: var(--bs-tertiary-color);
361
370
  }
362
371
 
363
- select.tnxbsv-select.is-empty option:not(.empty-item) {
372
+ select.tnxbsv-select.is-empty option:not(.empty-item):not(:disabled) {
364
373
  color: var(--bs-body-color);
365
374
  }
366
-
367
- .tnxbsv-radio-group.btn-group > .btn {
368
- flex: none;
369
- --bs-btn-padding-x: 1rem;
370
- }
371
375
  </style>
@@ -76,6 +76,11 @@ export default {
76
76
  }
77
77
  }
78
78
  },
79
+ mounted() {
80
+ this.file = null;
81
+ this.uploading = false;
82
+ this.errorMessage = null;
83
+ },
79
84
  methods: {
80
85
  toSelect() {
81
86
  const $ = window.tnx.libs.$;
@@ -103,7 +103,7 @@ export default {
103
103
  return height;
104
104
  },
105
105
  downloadUrl() {
106
- let baseUrl = process.env.VUE_APP_API_BASE_URL;
106
+ let baseUrl = window.tnx.app.rpc.getDefaultBaseUrl();
107
107
  if (this.app) {
108
108
  baseUrl = window.tnx.app.rpc.getBaseUrl(this.app);
109
109
  }
package/src/tnxvue-cli.js DELETED
@@ -1,64 +0,0 @@
1
- // tnxvue-cli.js
2
- const TerserPlugin = require('terser-webpack-plugin');
3
- const CopyWebpackPlugin = require('copy-webpack-plugin');
4
-
5
- module.exports = {
6
- uglify(config, options) {
7
- Object.assign(config, {
8
- optimization: {
9
- minimizer: [new TerserPlugin({
10
- terserOptions: Object.assign({
11
- compress: {
12
- warnings: false,
13
- drop_console: false,
14
- drop_debugger: true,
15
- }
16
- }, options)
17
- })]
18
- }
19
- });
20
- },
21
- copy(config, dependencies, libs, patterns) {
22
- let pluginPatterns = [];
23
- for (let lib of libs) {
24
- let from = lib.path;
25
- let to = 'libs/js/' + lib.name;
26
- if (config.mode === 'production') {
27
- let version = dependencies[lib.name];
28
- if (version) {
29
- to += '-' + version;
30
- }
31
- from += lib.prod;
32
- to += lib.prod;
33
- }
34
- if (!from.endsWith('/')) {
35
- from += '.js';
36
- }
37
- if (!to.endsWith('/')) {
38
- to += '.js';
39
- }
40
- pluginPatterns.push({
41
- from: './node_modules/' + from,
42
- to: './' + to,
43
- });
44
- let globalVarName = config.externals[lib.name];
45
- if (globalVarName) {
46
- let baseUrl = process.env.VUE_APP_VIEW_BASE_URL;
47
- if (!baseUrl.endsWith('/')) {
48
- baseUrl += '/';
49
- }
50
- process.env['VUE_APP_LIBS_' + globalVarName] = baseUrl + to;
51
- }
52
- if (lib.map) {
53
- pluginPatterns.push({
54
- from: './node_modules/' + lib.path + lib.map,
55
- to: './libs/js/',
56
- });
57
- }
58
- }
59
- if (patterns && patterns.length) {
60
- pluginPatterns = pluginPatterns.concat(patterns);
61
- }
62
- config.plugins.push(new CopyWebpackPlugin({patterns: pluginPatterns}));
63
- },
64
- }