@truenewx/tnxvue3 3.0.0-alpha.13 → 3.0.0-alpha.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truenewx/tnxvue3",
3
- "version": "3.0.0-alpha.13",
3
+ "version": "3.0.0-alpha.15",
4
4
  "description": "互联网技术解决方案:Vue3扩展支持",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -24,10 +24,9 @@
24
24
  "vue-router": "~4.4.0"
25
25
  },
26
26
  "dependencies": {
27
- "@truenewx/tnxcore": "3.0.0-alpha.7",
27
+ "@truenewx/tnxcore": "3.0.0-alpha.9",
28
28
  "@element-plus/icons-vue": "2.3.1",
29
29
  "async-validator": "4.2.5",
30
- "crypto-es": "2.1.0",
31
30
  "mitt": "3.0.1"
32
31
  },
33
32
  "devDependencies": {
@@ -15,7 +15,7 @@
15
15
  </template>
16
16
 
17
17
  <script>
18
- import * as $ from 'jquery';
18
+ import $ from 'cash-dom';
19
19
 
20
20
  const util = window.tnx.util;
21
21
 
@@ -1,19 +1,19 @@
1
1
  <template>
2
2
  <el-dialog :data-v-id="id"
3
- class="tnxel-dialog"
4
- v-model="visible"
5
- destroy-on-close
6
- append-to-body
7
- :modal="options.modal"
8
- :close-on-click-modal="options['close-on-click-modal']"
9
- :close-on-press-escape="options['close-on-press-escape']"
10
- :show-close="options['show-close']"
11
- :center="options.center"
12
- :before-close="beforeClose"
13
- @closed="onClosed">
3
+ class="tnxel-dialog"
4
+ v-model="visible"
5
+ destroy-on-close
6
+ append-to-body
7
+ :modal="options.modal"
8
+ :close-on-click-modal="options['close-on-click-modal']"
9
+ :close-on-press-escape="options['close-on-press-escape']"
10
+ :show-close="options['show-close']"
11
+ :center="options.center"
12
+ :before-close="beforeClose"
13
+ @closed="onClosed">
14
14
  <template #header>
15
15
  <div class="tnxel-dialog-title" :class="mergeClass({'border-bottom': title})" v-html="title"
16
- v-if="title || options['show-close']"></div>
16
+ v-if="title || options['show-close']"></div>
17
17
  </template>
18
18
  <template v-if="$slots.default">
19
19
  <slot></slot>
@@ -23,7 +23,7 @@
23
23
  <template #footer v-if="buttons && buttons.length">
24
24
  <div class="tnxel-dialog-footer" :class="mergeClass()">
25
25
  <el-button v-for="(button, index) in buttons" :type="button.type" :key="index"
26
- :loading="buttonLoadings[index]" @click="btnClick(index)">{{ button.caption || button.text }}
26
+ :loading="buttonLoadings[index]" @click="btnClick(index)">{{ button.caption || button.text }}
27
27
  </el-button>
28
28
  </div>
29
29
  </template>
@@ -31,7 +31,7 @@
31
31
  </template>
32
32
 
33
33
  <script>
34
- import * as $ from 'jquery';
34
+ import $ from 'cash-dom';
35
35
  import DialogContent from './DialogContent.vue';
36
36
 
37
37
  const util = window.tnx.util;
@@ -49,7 +49,7 @@
49
49
  </template>
50
50
 
51
51
  <script>
52
- import * as $ from 'jquery';
52
+ import $ from 'cash-dom';
53
53
  import Icon from '../icon/Icon.vue';
54
54
  import Button from '../button/Button.vue';
55
55
  import Paged from '../paged/Paged.vue';
@@ -1,12 +1,12 @@
1
1
  <template>
2
2
  <el-steps class="w-fit-content tnxel-steps-nav" :id="id" direction="vertical" :space="space">
3
3
  <el-step status="finish" v-for="item in items" :key="item.target" :data-target="item.target"
4
- :title="item.title"/>
4
+ :title="item.title"/>
5
5
  </el-steps>
6
6
  </template>
7
7
 
8
8
  <script>
9
- import * as $ from 'jquery';
9
+ import $ from 'cash-dom';
10
10
 
11
11
  export default {
12
12
  name: 'TnxelStepsNav',
@@ -1,11 +1,11 @@
1
1
  <template>
2
2
  <el-form ref="form" :id="id" :label-width="labelWidth" :label-position="vertical ? 'top' : 'right'"
3
- :model="model" :rules="validationRules" :validate-on-rule-change="false"
4
- :inline="inline" :inline-message="!vertical" :disabled="disabled"
5
- :class="theme ? ('theme-' + theme) : null" :size="size" :status-icon="statusIcon">
3
+ :model="model" :rules="validationRules" :validate-on-rule-change="false"
4
+ :inline="inline" :inline-message="!vertical" :disabled="disabled"
5
+ :class="theme ? ('theme-' + theme) : null" :size="size" :status-icon="statusIcon">
6
6
  <slot></slot>
7
7
  <el-form-item class="w-100 mb-0" :label="vertical ? undefined : '&nbsp;'"
8
- v-if="submit !== undefined && submit !== null">
8
+ v-if="submit !== undefined && submit !== null">
9
9
  <el-button :type="theme || 'primary'" :size="size" @click="toSubmit" v-if="submit !== false">
10
10
  {{ _submitText }}
11
11
  </el-button>
@@ -15,7 +15,7 @@
15
15
  </template>
16
16
 
17
17
  <script>
18
- import * as $ from 'jquery';
18
+ import $ from 'cash-dom';
19
19
  import AsyncValidator from 'async-validator';
20
20
 
21
21
  export default {
@@ -5,7 +5,7 @@
5
5
  import ElementPlus, {ElLoading, ElMessage, ElMessageBox} from 'element-plus';
6
6
  import ElementPlus_zh_CN from 'element-plus/es/locale/lang/zh-cn';
7
7
  import tnxbs from '@truenewx/tnxcore/src/tnxbs'; // 二次封装组件中使用了Bootstrap的基础样式
8
- import tnxvue, {build} from '../tnxvue.js';
8
+ import tnxvue from '../tnxvue.js';
9
9
 
10
10
  import Avatar from './avatar/Avatar.vue';
11
11
  import Alert from './alert/Alert.vue';
@@ -44,7 +44,7 @@ import Upload from './upload/Upload.vue';
44
44
 
45
45
  import './tnxel.css';
46
46
 
47
- export {build};
47
+ export const build = tnxvue.build;
48
48
 
49
49
  export default build('tnxel', () => {
50
50
  const $ = tnxbs.libs.$;
@@ -1,22 +1,22 @@
1
1
  <template>
2
2
  <el-upload ref="upload" name="file" class="tnxel-upload-container"
3
- :class="{center: center, 'hide-file-list': !showFileList}"
4
- :id="id"
5
- :action="actionUrl"
6
- :before-upload="_beforeUpload"
7
- :on-progress="_onProgress"
8
- :on-success="_onSuccess"
9
- :on-error="_onError"
10
- :with-credentials="true"
11
- :list-type="listType"
12
- :file-list="fileList"
13
- :show-file-list="true"
14
- :headers="uploadHeaders"
15
- :multiple="uploadOptions && uploadOptions.number !== 1"
16
- :accept="uploadAccept" :disabled="disabled" v-if="uploadOptions">
3
+ :class="{center: center, 'hide-file-list': !showFileList}"
4
+ :id="id"
5
+ :action="actionUrl"
6
+ :before-upload="_beforeUpload"
7
+ :on-progress="_onProgress"
8
+ :on-success="_onSuccess"
9
+ :on-error="_onError"
10
+ :with-credentials="true"
11
+ :list-type="listType"
12
+ :file-list="fileList"
13
+ :show-file-list="true"
14
+ :headers="uploadHeaders"
15
+ :multiple="uploadOptions && uploadOptions.number !== 1"
16
+ :accept="uploadAccept" :disabled="disabled" v-if="uploadOptions">
17
17
  <template #file="{file}">
18
18
  <div class="el-upload-list__panel" :data-file-id="getFileId(file)" :style="itemPanelStyle"
19
- v-if="showFileList">
19
+ v-if="showFileList">
20
20
  <img class="el-upload-list__item-thumbnail" :src="file.url" v-if="imageable">
21
21
  <div class="el-upload-list__item-name" v-else>
22
22
  <tnxel-icon :value="getFileIcon(file)"/>
@@ -27,7 +27,7 @@
27
27
  </span>
28
28
  <label class="el-upload-list__item-status-label">
29
29
  <el-progress type="circle" :percentage="file.percentage" :width="16" :stroke-width="3"
30
- :show-text="false" v-if="isUploading(file)"/>
30
+ :show-text="false" v-if="isUploading(file)"/>
31
31
  <tnxel-icon value="CircleCheck" class="text-success" v-else-if="listType === 'text'"/>
32
32
  <tnxel-icon value="Check" style="margin-top: 8px;" v-else/>
33
33
  </label>
@@ -40,16 +40,16 @@
40
40
  <template #trigger>
41
41
  <el-tooltip :content="tipContent" placement="top" :disabled="tip !== 'tooltip'">
42
42
  <div class="upload-trigger" :title="tip === 'title' ? tipContent : undefined"
43
- :class="{'text-placeholder': disabled}" v-if="$slots.trigger">
43
+ :class="{'text-placeholder': disabled}" v-if="$slots.trigger">
44
44
  <slot name="trigger"></slot>
45
45
  </div>
46
46
  <el-button class="upload-trigger" :title="tip === 'title' ? tipContent : undefined"
47
- :disabled="disabled" v-else-if="listType === 'text'">
47
+ :disabled="disabled" v-else-if="listType === 'text'">
48
48
  <tnxel-icon :value="triggerIcon" :size="uploadIconSize"/>
49
49
  <div class="upload-trigger-text" v-if="triggerText">{{ triggerText }}</div>
50
50
  </el-button>
51
51
  <div class="upload-trigger" :title="tip === 'title' ? tipContent : undefined"
52
- :class="{'text-placeholder': disabled}" v-else>
52
+ :class="{'text-placeholder': disabled}" v-else>
53
53
  <tnxel-icon :value="triggerIcon" :size="uploadIconSize"/>
54
54
  <div class="upload-trigger-text" v-if="triggerText">{{ triggerText }}</div>
55
55
  </div>
@@ -67,7 +67,7 @@
67
67
  </template>
68
68
 
69
69
  <script>
70
- import * as $ from 'jquery';
70
+ import $ from 'cash-dom';
71
71
  import Alert from '../alert/Alert.vue';
72
72
  import Icon from '../icon/Icon.vue';
73
73
 
@@ -233,7 +233,7 @@ export default {
233
233
  },
234
234
  uploadAccept() {
235
235
  if (this.uploadOptions && !this.uploadOptions.extensionsRejected && this.uploadOptions.extensions
236
- && this.uploadOptions.extensions.length) {
236
+ && this.uploadOptions.extensions.length) {
237
237
  let accept = '';
238
238
  for (let extension of this.uploadOptions.extensions) {
239
239
  accept += ',.' + extension;
@@ -342,7 +342,7 @@ export default {
342
342
  } else {
343
343
  // 没有URL的文件,通过文件类型+文件名+文件大小+最后修改时间,几乎可以唯一区分一个文件,重复的概率极低,即使重复也不破坏业务一致性和完整性
344
344
  file.id = this.tnx.util.string.md5(
345
- file.type + '-' + file.name + '-' + file.size + '-' + file.lastModified);
345
+ file.type + '-' + file.name + '-' + file.size + '-' + file.lastModified);
346
346
  }
347
347
  }
348
348
  return file.id;
@@ -382,7 +382,7 @@ export default {
382
382
  const capacity = this.tnx.util.string.getCapacityCaption(this.uploadOptions.capacity);
383
383
  let message = this.tipMessages.capacity.format(capacity, 2);
384
384
  message += ',文件"' + file.name + '"大小为' + this.tnx.util.string.getCapacityCaption(file.size, 2)
385
- + ',不符合要求,未加入上传队列';
385
+ + ',不符合要求,未加入上传队列';
386
386
  this.handleErrors([{
387
387
  code: 'error.upload.capacity',
388
388
  message: message,
package/src/tnxvue.js CHANGED
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * 基于Vue 3的扩展支持
4
4
  */
5
- import tnxcore, {build} from '@truenewx/tnxcore';
5
+ import tnxcore from '@truenewx/tnxcore';
6
6
  import validator from './tnxvue-validator';
7
7
  import createRouter from './tnxvue-router';
8
8
  import Text from './text/Text.vue';
@@ -12,7 +12,7 @@ import * as Vue from 'vue';
12
12
  import mitt from 'mitt';
13
13
  import './tnxvue.css';
14
14
 
15
- export {build};
15
+ export const build = tnxcore.build;
16
16
 
17
17
  export default build('tnxvue', () => {
18
18
  const tnxvue = Object.assign({}, tnxcore, {