@tripup-company/element-ui-extended 0.0.87 → 0.0.89

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": "@tripup-company/element-ui-extended",
3
- "version": "0.0.87",
3
+ "version": "0.0.89",
4
4
  "main": "./dist/element-ui-extended.umd.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve && tsc --emitDeclarationOnly",
@@ -44,7 +44,7 @@
44
44
  "prettier": "^2.2.1",
45
45
  "sass": "^1.26.5",
46
46
  "sass-loader": "^8.0.2",
47
- "ts-loader": "^9.2.6",
47
+ "ts-loader": "^9.4.2",
48
48
  "typescript": "~4.1.5",
49
49
  "vue-loader": "^15.9.5",
50
50
  "vue-template-compiler": "^2.6.11"
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="editable-cell">
3
- <div v-if="!isEditMode" class="editable-cell__text">
3
+ <div v-if="!isEditMode" class="editable-cell__text" :style="height? 'height: ' + height : ''">
4
4
  <slot class="editable-cell__text__slot">
5
5
  <el-col :span="23">
6
6
  <div
@@ -78,7 +78,7 @@
78
78
  <el-input
79
79
  v-else
80
80
  v-model="model"
81
- :rows="3"
81
+ :rows="rows"
82
82
  :type="type"
83
83
  :placeholder="placeholder"
84
84
  class="editable-cell__input"
@@ -141,6 +141,14 @@ export default {
141
141
  type: Array,
142
142
  default: () => [],
143
143
  },
144
+ rows: {
145
+ type: Number,
146
+ default: 3,
147
+ },
148
+ height: {
149
+ type: String,
150
+ default: '102px',
151
+ },
144
152
  selectMultiple: {
145
153
  type: Boolean,
146
154
  default: false,
@@ -4,19 +4,19 @@
4
4
  <template v-for="field in fields">
5
5
  <template v-if="field.callback">
6
6
  <el-table-column
7
- :key="field.prop"
8
- v-slot="context"
9
- :prop="field.prop"
10
- :label="field.label"
11
- :width="field.width ? field.width : null"
12
- :sortable="field.sortable ? field.sortable : null"
7
+ :key="field.prop"
8
+ v-slot="context"
9
+ :prop="field.prop"
10
+ :label="field.label"
11
+ :width="field.width ? field.width : null"
12
+ :sortable="field.sortable ? field.sortable : null"
13
13
  >
14
14
  <el-link v-if="field.href" :href="customHref(field, context)">
15
15
  {{ customLinkLabel(field, context) }}
16
16
  </el-link>
17
17
  <el-link
18
- v-else
19
- @click.prevent="
18
+ v-else
19
+ @click.prevent="
20
20
  field.callback(field.prop, context.$index, context.row)
21
21
  "
22
22
  >
@@ -24,16 +24,29 @@
24
24
  </el-link>
25
25
  </el-table-column>
26
26
  </template>
27
+ <template v-else-if="field.type && field.type === 'template'">
28
+ <el-table-column
29
+ :key="field.prop"
30
+ :prop="field.prop"
31
+ :label="field.label"
32
+ :width="field.width ? field.width : null"
33
+ :sortable="field.sortable ? field.sortable : null"
34
+ >
35
+ <template slot-scope="scope">
36
+ <span v-html="field.formatter(scope)"></span>
37
+ </template>
38
+ </el-table-column>
39
+ </template>
27
40
  <template v-else>
28
41
  <el-table-column
29
- :formatter="
42
+ :formatter="
30
43
  typeof field.formatter === 'function' ? field.formatter : null
31
44
  "
32
- :key="field.prop"
33
- :prop="field.prop"
34
- :label="field.label"
35
- :width="field.width ? field.width : null"
36
- :sortable="field.sortable ? field.sortable : null"
45
+ :key="field.prop"
46
+ :prop="field.prop"
47
+ :label="field.label"
48
+ :width="field.width ? field.width : null"
49
+ :sortable="field.sortable ? field.sortable : null"
37
50
  />
38
51
  </template>
39
52
  </template>
@@ -68,15 +81,15 @@ export default {
68
81
  },
69
82
  customHref(field, context) {
70
83
  return field.href
71
- ? typeof field.href === "function"
72
- ? field.href(field.prop, context.$index, context.row)
73
- : field.href
74
- : "#";
84
+ ? typeof field.href === "function"
85
+ ? field.href(field.prop, context.$index, context.row)
86
+ : field.href
87
+ : "#";
75
88
  },
76
89
  customLinkLabel(field, context) {
77
90
  return typeof field.formatter === "function"
78
- ? field.formatter(context.row)
79
- : context.row[field.prop];
91
+ ? field.formatter(context.row)
92
+ : context.row[field.prop];
80
93
  },
81
94
  },
82
95
  };
@@ -49,6 +49,7 @@
49
49
  :disabled="disabled"
50
50
  v-else
51
51
  v-model="dataModel"
52
+ :rows="rows"
52
53
  :type="type"
53
54
  :placeholder="placeholder"
54
55
  class="editable-cell__input"
@@ -77,6 +78,14 @@ export default {
77
78
  type: [String, Boolean, Date, Number, Array],
78
79
  default: "",
79
80
  },
81
+ rows: {
82
+ type: Number,
83
+ default: 3,
84
+ },
85
+ height: {
86
+ type: String,
87
+ default: 'auto',
88
+ },
80
89
  type: {
81
90
  type: String,
82
91
  default: "input",
@@ -23,6 +23,8 @@
23
23
  :select-label="field.selectList ? (field.selectLabel ? field.selectLabel : 'name' ) : ''"
24
24
  :select-value="field.selectList ? (field.selectValue ? field.selectValue : 'value' ) : ''"
25
25
  :field="field.prop"
26
+ :rows="field.rows ? field.rows : 3"
27
+ :height="field.height ? field.height : 'auto'"
26
28
  :precision="field.precision ? field.precision : 0"
27
29
  :remote-method="field.remoteMethod ? field.remoteMethod : null"
28
30
  :filterable="field.filterable ? field.filterable : null"
@@ -23,6 +23,8 @@
23
23
  :select-label="field.selectList ? (field.selectLabel ? field.selectLabel : 'name' ) : ''"
24
24
  :select-value="field.selectList ? (field.selectValue ? field.selectValue : 'value' ) : ''"
25
25
  :field="field.prop"
26
+ :rows="field.rows ? field.rows : 3"
27
+ :height="field.height ? field.height : 'auto'"
26
28
  :precision="field.precision ? field.precision : 0"
27
29
  :remote-method="field.remoteMethod ? field.remoteMethod : null"
28
30
  :filterable="field.filterable ? field.filterable : null"
@@ -34,7 +34,6 @@
34
34
  color: #606266;
35
35
  display: inline-block;
36
36
  font-size: inherit;
37
- max-height: 102px;
38
37
  line-height: 34px;
39
38
  outline: none;
40
39
  padding: 0 15px;