@tripup-company/element-ui-extended 0.0.92 → 0.0.93

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.92",
3
+ "version": "0.0.93",
4
4
  "main": "./dist/element-ui-extended.umd.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve && tsc --emitDeclarationOnly",
@@ -57,12 +57,14 @@
57
57
  placeholder="Select"
58
58
  :value-key="objectValueKey"
59
59
  :multiple="selectMultiple"
60
+ :allow-create="allowCreate"
61
+ :default-first-option="defaultFirstOption"
60
62
  class="w-100"
61
63
  >
62
64
  <el-option
63
65
  v-for="item in selectListLocal"
64
- :key="item[selectKey]"
65
- :label="item[selectLabel]"
66
+ :key="selectJson ? item : item[selectKey]"
67
+ :label="selectJson ? item : item[selectLabel]"
66
68
  :value="selectJson ? item : item[selectValue]"
67
69
  />
68
70
  </el-select>
@@ -181,6 +183,14 @@ export default {
181
183
  type: Number,
182
184
  default: 1,
183
185
  },
186
+ allowCreate: {
187
+ type: Boolean,
188
+ default: false,
189
+ },
190
+ defaultFirstOption: {
191
+ type: Boolean,
192
+ default: false,
193
+ },
184
194
  remoteMethod: {
185
195
  type: Object,
186
196
  default: null,
@@ -237,12 +247,18 @@ export default {
237
247
  if (this.value.length) {
238
248
  let values = [];
239
249
  this.value.forEach((element) => {
240
- const compareValue = this.selectJson ? element[this.selectKey] : element;
250
+ console.log(element);
251
+ let compareValue = this.selectJson ? element[this.selectKey] : element;
252
+ if (!compareValue) {
253
+ compareValue = element;
254
+ }
241
255
  const labArray = this.selectListLocal.find(
242
256
  x => x[this.selectKey] === compareValue
243
257
  );
244
258
  if (labArray && labArray[this.selectLabel]) {
245
259
  values.push(labArray[this.selectLabel]);
260
+ } else {
261
+ values.push(element);
246
262
  }
247
263
  label = values.join("; ");
248
264
  });
@@ -17,12 +17,14 @@
17
17
  placeholder="Select"
18
18
  :multiple="selectMultiple"
19
19
  :value-key="objectValueKey"
20
+ :allow-create="allowCreate"
21
+ :default-first-option="defaultFirstOption"
20
22
  class="w-100"
21
23
  >
22
24
  <el-option
23
25
  v-for="item in selectListLocal"
24
- :key="item[selectKey]"
25
- :label="item[selectLabel]"
26
+ :key="selectJson ? item : item[selectKey]"
27
+ :label="selectJson ? item : item[selectLabel]"
26
28
  :value="selectJson ? item : item[selectValue]"
27
29
  />
28
30
  </el-select>
@@ -140,6 +142,14 @@ export default {
140
142
  type: Object,
141
143
  default: null,
142
144
  },
145
+ allowCreate: {
146
+ type: Boolean,
147
+ default: false,
148
+ },
149
+ defaultFirstOption: {
150
+ type: Boolean,
151
+ default: false,
152
+ },
143
153
  format: {
144
154
  type: String,
145
155
  default: "dd.MM.yyyy",
@@ -22,6 +22,8 @@
22
22
  :select-key="field.selectList ? (field.selectKey ? field.selectKey : 'value' ) : ''"
23
23
  :select-label="field.selectList ? (field.selectLabel ? field.selectLabel : 'name' ) : ''"
24
24
  :select-value="field.selectList ? (field.selectValue ? field.selectValue : 'value' ) : ''"
25
+ :allow-create="field.allowCreate ? field.allowCreate : false"
26
+ :default-first-option="field.defaultFirstOption ? field.defaultFirstOption : false"
25
27
  :field="field.prop"
26
28
  :rows="field.rows ? field.rows : 3"
27
29
  :height="field.height ? field.height : 'auto'"
@@ -22,6 +22,8 @@
22
22
  :select-key="field.selectList ? (field.selectKey ? field.selectKey : 'value' ) : ''"
23
23
  :select-label="field.selectList ? (field.selectLabel ? field.selectLabel : 'name' ) : ''"
24
24
  :select-value="field.selectList ? (field.selectValue ? field.selectValue : 'value' ) : ''"
25
+ :allow-create="field.allowCreate ? field.allowCreate : false"
26
+ :default-first-option="field.defaultFirstOption ? field.defaultFirstOption : false"
25
27
  :field="field.prop"
26
28
  :rows="field.rows ? field.rows : 3"
27
29
  :height="field.height ? field.height : 'auto'"
@@ -44,6 +46,7 @@ import Vue from 'vue';
44
46
  import getResolution from "@/services/resolutions";
45
47
  import NewField from "@/components/NewField";
46
48
  import lodash from "lodash";
49
+ import EditableField from "@/components/EditableField/index.vue";
47
50
  const _ = lodash;
48
51
  export default {
49
52
  name: 'PartColumnNew',