tianheng-ui 0.0.59 → 0.0.60

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,7 +1,7 @@
1
1
  {
2
2
  "name": "tianheng-ui",
3
3
  "description": "A Vue.js project",
4
- "version": "0.0.59",
4
+ "version": "0.0.60",
5
5
  "author": "shu lang <403732931@qq.com>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -58,16 +58,16 @@ export default {
58
58
  ];
59
59
  return className;
60
60
  },
61
- _elFormItemSize() {
62
- return (this.elFormItem || {}).elFormItemSize;
61
+ _thFormItemSize() {
62
+ return (this.thFormItem || {}).thFormItemSize;
63
63
  },
64
64
  buttonSize() {
65
- return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
65
+ return this.size || this._thFormItemSize || (this.$ELEMENT || {}).size;
66
66
  },
67
67
  buttonDisabled() {
68
68
  return this.$options.propsData.hasOwnProperty("disabled")
69
69
  ? this.disabled
70
- : (this.elForm || {}).disabled;
70
+ : (this.thForm || {}).disabled;
71
71
  }
72
72
  },
73
73
 
@@ -40,7 +40,7 @@ import htmlWorkerUrl from "file-loader!ace-builds/src-noconflict/worker-html";
40
40
  ace.config.setModuleUrl("ace/mode/html_worker", htmlWorkerUrl);
41
41
 
42
42
  export default {
43
- name: "CodeEditor",
43
+ name: "ThCodeEditor",
44
44
  model: {
45
45
  event: "change"
46
46
  },
@@ -33,10 +33,8 @@
33
33
  >
34
34
  <transition-group name="fade" tag="div" class="widget-form-list">
35
35
  <widget-form-item
36
- v-for="(element, elementIndex) in data.list.filter(item => {
37
- return item.key;
38
- })"
39
- :key="elementIndex"
36
+ v-for="(element, elementIndex) in widgetList"
37
+ :key="element.key"
40
38
  :widget="element"
41
39
  :widgetIndex="elementIndex"
42
40
  :widgetArray="data"
@@ -75,6 +73,11 @@ export default {
75
73
  }
76
74
  },
77
75
  computed: {
76
+ widgetList() {
77
+ return this.data.list.filter(item => {
78
+ return item.key;
79
+ });
80
+ },
78
81
  formWidth() {
79
82
  if (this.data.config.width) return this.data.config.width;
80
83
  if (this.client === "mobile") return "375px";
@@ -84,7 +87,11 @@ export default {
84
87
  },
85
88
  mounted() {
86
89
  document.body.ondrop = function(event) {
87
- let isFirefox = navigator.userAgent.toLowerCase().indexOf("firefox") > -1;
90
+ let s = navigator.userAgent;
91
+ let isFirefox =
92
+ typeof s === "string"
93
+ ? s.toLowerCase().indexOf("firefox") > -1
94
+ : s.indexOf("firefox") > -1;
88
95
  if (isFirefox) {
89
96
  event.preventDefault();
90
97
  event.stopPropagation();
File without changes
File without changes
@@ -283,7 +283,7 @@ export default {
283
283
  action: this.action,
284
284
  multiple: this.multiple,
285
285
  'before-upload': this.beforeUpload,
286
- 'with-credentials': this.withCredentials,
286
+ // 'with-credentials': this.withCredentials,
287
287
  headers: this.headers,
288
288
  name: this.name,
289
289
  data: this.data,
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div
3
- class="el-upload-dragger"
3
+ class="th-upload-dragger"
4
4
  :class="{
5
5
  'is-dragover': dragover
6
6
  }"
@@ -2,16 +2,16 @@
2
2
  <transition-group
3
3
  tag="ul"
4
4
  :class="[
5
- 'el-upload-list',
6
- 'el-upload-list--' + listType,
5
+ 'th-upload-list',
6
+ 'th-upload-list--' + listType,
7
7
  { 'is-disabled': disabled }
8
8
  ]"
9
- name="el-list"
9
+ name="th-list"
10
10
  >
11
11
  <li
12
12
  v-for="file in files"
13
13
  :class="[
14
- 'el-upload-list__item',
14
+ 'th-upload-list__item',
15
15
  'is-' + file.status,
16
16
  focusing ? 'focusing' : ''
17
17
  ]"
@@ -24,7 +24,7 @@
24
24
  >
25
25
  <slot :file="file">
26
26
  <img
27
- class="el-upload-list__item-thumbnail"
27
+ class="th-upload-list__item-thumbnail"
28
28
  v-if="
29
29
  file.status !== 'uploading' &&
30
30
  ['picture-card', 'picture'].indexOf(listType) > -1
@@ -32,10 +32,10 @@
32
32
  :src="file.url"
33
33
  alt=""
34
34
  />
35
- <a class="el-upload-list__item-name" @click="handleClick(file)">
35
+ <a class="th-upload-list__item-name" @click="handleClick(file)">
36
36
  <i class="el-icon-document"></i>{{ file.name }}
37
37
  </a>
38
- <label class="el-upload-list__item-status-label">
38
+ <label class="th-upload-list__item-status-label">
39
39
  <i
40
40
  :class="{
41
41
  'el-icon-upload-success': true,
@@ -50,9 +50,9 @@
50
50
  v-if="!disabled"
51
51
  @click="$emit('remove', file)"
52
52
  ></i>
53
- <i class="el-icon-close-tip" v-if="!disabled">{{
53
+ <!-- <i class="el-icon-close-tip" v-if="!disabled">{{
54
54
  t("el.upload.deleteTip")
55
- }}</i>
55
+ }}</i> -->
56
56
  <!--因为close按钮只在li:focus的时候 display, li blur后就不存在了,所以键盘导航时永远无法 focus到 close按钮上-->
57
57
  <el-progress
58
58
  v-if="file.status === 'uploading'"
@@ -62,11 +62,11 @@
62
62
  >
63
63
  </el-progress>
64
64
  <span
65
- class="el-upload-list__item-actions"
65
+ class="th-upload-list__item-actions"
66
66
  v-if="listType === 'picture-card'"
67
67
  >
68
68
  <span
69
- class="el-upload-list__item-preview"
69
+ class="th-upload-list__item-preview"
70
70
  v-if="handlePreview && listType === 'picture-card'"
71
71
  @click="handlePreview(file)"
72
72
  >
@@ -74,7 +74,7 @@
74
74
  </span>
75
75
  <span
76
76
  v-if="!disabled"
77
- class="el-upload-list__item-delete"
77
+ class="th-upload-list__item-delete"
78
78
  @click="$emit('remove', file)"
79
79
  >
80
80
  <i class="el-icon-delete"></i>
@@ -85,11 +85,9 @@
85
85
  </transition-group>
86
86
  </template>
87
87
  <script>
88
- import Locale from "element-ui/src/mixins/locale";
89
88
  import ElProgress from "element-ui/packages/progress";
90
89
  export default {
91
90
  name: "ThUploadList",
92
- mixins: [Locale],
93
91
  data() {
94
92
  return {
95
93
  focusing: false
@@ -1,3 +1,12 @@
1
+ <template>
2
+ <div @click="handleClick" :class="classMatch" @keydown="handleKeydown" tabindex="0" >
3
+ <upload-dragger v-if="drag" :disabled="disabled" @file="uploadFiles"><slot></slot></upload-dragger>
4
+ <slot v-else></slot>
5
+ <input class="th-upload__input" type="file" ref="input" :name="name" @change="handleChange" :multiple="multiple" :accept="accept"></input>
6
+ </div>
7
+ </template>
8
+
9
+
1
10
  <script>
2
11
  import ajax from './ajax';
3
12
  import UploadDragger from './upload-dragger.vue';
@@ -54,7 +63,15 @@ export default {
54
63
  reqs: {}
55
64
  };
56
65
  },
57
-
66
+ computed: {
67
+ classMatch(){
68
+ const classGroup = {
69
+ 'th-upload': true
70
+ }
71
+ classGroup[`th-upload--${this.listType}`] = true;
72
+ return classGroup
73
+ },
74
+ },
58
75
  methods: {
59
76
  isImage(str) {
60
77
  return str.indexOf('image') !== -1;
@@ -172,40 +189,5 @@ export default {
172
189
  }
173
190
  }
174
191
  },
175
-
176
- render(h) {
177
- let {
178
- handleClick,
179
- drag,
180
- name,
181
- handleChange,
182
- multiple,
183
- accept,
184
- listType,
185
- uploadFiles,
186
- disabled,
187
- handleKeydown
188
- } = this;
189
- const data = {
190
- class: {
191
- 'el-upload': true
192
- },
193
- on: {
194
- click: handleClick,
195
- keydown: handleKeydown
196
- }
197
- };
198
- data.class[`el-upload--${listType}`] = true;
199
- return (
200
- <div {...data} tabindex="0" >
201
- {
202
- drag
203
- ? <upload-dragger disabled={disabled} on-file={uploadFiles}>{this.$slots.default}</upload-dragger>
204
- : this.$slots.default
205
- }
206
- <input class="el-upload__input" type="file" ref="input" name={name} on-change={handleChange} multiple={multiple} accept={accept}></input>
207
- </div>
208
- );
209
- }
210
192
  };
211
193
  </script>
@@ -17,7 +17,9 @@ export function initListenerForm(listener) {
17
17
  console.log(listener.eventDefinitions, key);
18
18
  if (key.indexOf("time") !== -1) {
19
19
  k = key;
20
- self.eventDefinitionType = key.replace("time", "").toLowerCase();
20
+ let s = key.replace("time", "");
21
+ self.eventDefinitionType =
22
+ typeof s === "string" ? s.toLowerCase() : s;
21
23
  }
22
24
  }
23
25
  console.log(k);
@@ -1,9 +0,0 @@
1
- import { t } from 'element-ui/src/locale';
2
-
3
- export default {
4
- methods: {
5
- t(...args) {
6
- return t.apply(this, args);
7
- }
8
- }
9
- };