vi-grid-builder 0.0.2 → 0.0.3

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.
@@ -25,6 +25,10 @@ export default {
25
25
  noDataLabel:{
26
26
  type: String,
27
27
  default: options.noDataLabel ?? 'No data found'
28
+ },
29
+ noCellDataLabel:{
30
+ type: String,
31
+ default: options.noCellDataLabel ?? '/'
28
32
  }
29
33
  }
30
34
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vi-grid-builder",
3
3
  "main": "ViGridBuilderPlugin",
4
- "version": "0.0.2",
4
+ "version": "0.0.3",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -9,7 +9,7 @@
9
9
  "preview": "vite preview"
10
10
  },
11
11
  "dependencies": {
12
- "vi-pagination": "^0.0.2",
12
+ "vi-pagination": "^0.0.4",
13
13
  "vue": "^3.3.4"
14
14
  },
15
15
  "devDependencies": {
@@ -127,6 +127,10 @@
127
127
  },
128
128
  noDataLabel: {
129
129
  type: String,
130
+ },
131
+ noCellDataLabel: {
132
+ type: String,
133
+ default:'/'
130
134
  }
131
135
  },
132
136
  data: () => ({search: null, isFetchingData: false}),
@@ -1,28 +1,31 @@
1
1
  <template>
2
- <div class="vi-grid-field">
3
- <component
4
- v-if="fieldComponent"
5
- v-bind:is="fieldComponent"
6
- :field="field"
7
- :value="fieldValue"
8
- :row="rowValue"
9
- />
10
- <slot v-else name="custom-field" :field="field"
11
- :value="fieldValue"
12
- :row="rowValue">
13
- </slot>
2
+ <div class="vi-grid-field">
3
+ <component
4
+ v-if="fieldComponent"
5
+ v-bind:is="fieldComponent"
6
+ :field="field"
7
+ :value="filedValueFormatted"
8
+ :original-value="fieldValue"
9
+ :row="rowValue"
10
+ />
11
+ <slot v-else name="custom-field"
12
+ :field="field"
13
+ :value="fieldValue"
14
+ :original-value="fieldValue"
15
+ :row="rowValue">
16
+ </slot>
14
17
 
15
- </div>
18
+ </div>
16
19
  </template>
17
20
 
18
21
  <script>
19
22
  const snakeToCamel = str =>
20
- str.toLowerCase().replace(/([-_][a-z])/g, group =>
21
- group
22
- .toUpperCase()
23
- .replace('-', '')
24
- .replace('_', '')
25
- );
23
+ str.toLowerCase().replace(/([-_][a-z])/g, group =>
24
+ group
25
+ .toUpperCase()
26
+ .replace('-', '')
27
+ .replace('_', '')
28
+ );
26
29
  const uppercaseFirstLetter = str => str.charAt(0).toUpperCase() + str.slice(1);
27
30
 
28
31
  import ViGridBadge from "./fields/ViGridBadge.vue";
@@ -34,7 +37,7 @@
34
37
 
35
38
  export default {
36
39
  name: "ViGridField",
37
- components:{
40
+ components: {
38
41
  ViGridBadge,
39
42
  ViGridImage,
40
43
  ViGridText,
@@ -49,9 +52,15 @@
49
52
  },
50
53
  fieldValue: {},
51
54
  rowValue: {},
55
+ noDataLabel: {
56
+ type: String,
57
+ default: '/'
58
+ }
52
59
  },
53
60
  computed: {
54
-
61
+ filedValueFormatted() {
62
+ return this.fieldValue ?? this.noDataLabel
63
+ },
55
64
  fieldComponent() {
56
65
  let component = uppercaseFirstLetter(snakeToCamel(this.field.type))
57
66
 
@@ -66,5 +75,5 @@
66
75
  </script>
67
76
 
68
77
  <style lang="scss">
69
- @import "ViGridField";
78
+ @import "ViGridField";
70
79
  </style>