toggle-components-library 1.14.1 → 1.14.2

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-lock.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toggle-components-library",
3
- "version": "1.14.1",
3
+ "version": "1.14.2",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toggle-components-library",
3
- "version": "1.14.1",
3
+ "version": "1.14.2",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -4,7 +4,7 @@
4
4
  <label
5
5
  v-if="label && !empty"
6
6
  class="toggle-input-crud-container-label"
7
- > {{ label }}
7
+ > {{ computedLabel }}
8
8
  </label>
9
9
  <button
10
10
  v-if="label && empty"
@@ -23,11 +23,6 @@
23
23
  buttonStyle="mini_edit"
24
24
  @click="$emit('edit')"
25
25
  />
26
- <ToggleButton
27
- v-if="!empty"
28
- buttonStyle="mini_delete"
29
- @click="$emit('delete')"
30
- />
31
26
  </div>
32
27
 
33
28
  <label
@@ -76,7 +71,10 @@ export default {
76
71
  created : function(){
77
72
  },
78
73
  computed: {
79
-
74
+ computedLabel() {
75
+ let labelLength = this.label.split('').length;
76
+ return labelLength <= 15 ? this.label : this.label.slice(0,15) + '...'
77
+ }
80
78
  },
81
79
  methods: {
82
80
 
@@ -16,7 +16,7 @@
16
16
  <div class="toggle-grid-input-row-remove">
17
17
  <ToggleButton
18
18
  buttonStyle="mini_delete"
19
- @click="removeRow(rowindex)"
19
+ @click="deleteCurrentRow(rowindex)"
20
20
  />
21
21
  </div>
22
22
 
@@ -32,9 +32,6 @@
32
32
  </label>
33
33
  </div>
34
34
 
35
-
36
-
37
-
38
35
  </div>
39
36
  <div class="toggle-grid-input-add-row" >
40
37
  <button
@@ -44,6 +41,18 @@
44
41
  />
45
42
  </div>
46
43
 
44
+ <ToggleModal name="confirm_delete_row" maxwidth="500px">
45
+ <ToggleHeaderTextLarge class="text-center">Are you sure you want to delete this row?</ToggleHeaderTextLarge>
46
+ <div class="text-center toggle-copy-text">
47
+ You will lose all the fields in this row.
48
+ </div>
49
+
50
+ <div class="toggle-grid-modal-button-container">
51
+ <ToggleButton buttonStyle="abort" buttonText="Delete this row" @click="removeRow(editingGridRow)" />
52
+ <ToggleButton class="mr-3" buttonStyle="neutral" buttonText="Keep this row" @click="$toggle_event.$emit('modal_hide', 'confirm_delete_row')" />
53
+ </div>
54
+ </ToggleModal>
55
+
47
56
  </div>
48
57
  </template>
49
58
 
@@ -51,11 +60,13 @@
51
60
 
52
61
  import { mixins } from '../mixins/mixins'
53
62
  import ToggleButton from '../buttons/ToggleButton.vue';
63
+ import ToggleModal from '../modals/ToggleModal.vue';
64
+ import ToggleHeaderTextLarge from '../text/ToggleHeaderTextLarge.vue';
54
65
 
55
66
 
56
67
  export default {
57
68
  mixins:[mixins],
58
- components:{ToggleButton},
69
+ components:{ToggleButton, ToggleModal, ToggleHeaderTextLarge},
59
70
  props: {
60
71
  value: {
61
72
  type: [Array]
@@ -132,6 +143,7 @@ export default {
132
143
  layout:[3,9]
133
144
  },
134
145
  ],
146
+ editingGridRow: null,
135
147
 
136
148
  };
137
149
  },
@@ -236,6 +248,12 @@ export default {
236
248
  */
237
249
  removeRow(row_index){
238
250
  this.$delete( this.inputVal, row_index);
251
+ this.$toggle_event.$emit('modal_hide', 'confirm_delete_row');
252
+ },
253
+
254
+ deleteCurrentRow(rowindex) {
255
+ this.editingGridRow = rowindex;
256
+ this.$toggle_event.$emit('modal_show', 'confirm_delete_row')
239
257
  },
240
258
 
241
259
  /*
@@ -4,9 +4,17 @@
4
4
  <div class="toggle-formbuilder-input-label">
5
5
  <p v-if="label" class="toggle-formbuilder-label-text">{{label}}</p>
6
6
  </div>
7
- <slot></slot>
7
+ <div v-if="!multipleInputs" class="inner-input-container">
8
+ <slot ></slot>
9
+ <ToggleInfoText v-if="infoText" class="info">{{infoText}}</ToggleInfoText>
10
+ </div>
11
+ <div v-else class="inner-input-container">
12
+ <div class="multiple-inputs-container">
13
+ <slot></slot>
14
+ </div>
15
+ <ToggleInfoText v-if="infoText" class="info">{{infoText}}</ToggleInfoText>
16
+ </div>
8
17
  </div>
9
- <ToggleInfoText v-if="infoText" class="info">{{infoText}}</ToggleInfoText>
10
18
  </div>
11
19
  </template>
12
20
 
@@ -27,6 +35,12 @@ export default {
27
35
  infoText: {
28
36
  type: String,
29
37
  required: false
38
+ },
39
+ multipleInputs: {
40
+ type: Boolean,
41
+ default: false,
42
+ required: false,
43
+ description: "Set to true if more than one input is required per line. Inputs will be rendered horizontally"
30
44
  }
31
45
  }
32
46
 
@@ -44,11 +58,16 @@ export default {
44
58
  width: 100%;
45
59
  }
46
60
 
61
+ .inner-input-container {
62
+ width: 100%;
63
+ }
64
+
47
65
  .toggle-formbuilder-input-label {
48
66
  display: flex;
49
67
  flex-direction: column;
50
- width: 300px;
68
+ width: 20rem;
51
69
  justify-content: center;
70
+ margin-bottom: 20px;
52
71
  }
53
72
 
54
73
  .toggle-formbuilder-label-text {
@@ -59,7 +78,14 @@ export default {
59
78
  }
60
79
 
61
80
  .info {
62
- width: 230px;
63
- margin: 0 !important;
81
+ margin: 5px 0 0 0;
82
+ }
83
+
84
+ .multiple-inputs-container {
85
+ width: 100%;
86
+ display: flex;
87
+ flex-direction: row;
88
+ justify-content: space-between;
89
+ column-gap: 0.875rem;
64
90
  }
65
91
  </style>
@@ -698,7 +698,7 @@ $iconWidth:20px;
698
698
  height:100%;
699
699
  box-sizing:border-box;
700
700
  padding:1rem 0;
701
- top:0;
701
+ top: 0.8rem;
702
702
  position: absolute;
703
703
  width:2rem;
704
704
  }
@@ -82,3 +82,10 @@
82
82
  {
83
83
  -webkit-transform: scale(0.8);
84
84
  }
85
+
86
+ .toggle-grid-modal-button-container {
87
+ display: flex;
88
+ flex-direction: row;
89
+ justify-content: space-between;
90
+ margin-top: 20px;
91
+ }
@@ -51,7 +51,7 @@ a {
51
51
  }
52
52
 
53
53
  .toggle-info-text{
54
- font-size: 0.85rem;
54
+ font-size: 0.7rem;
55
55
  font-family: "Lato", sans-serif;
56
56
 
57
57
  color:$toggle-dark-blue;
@@ -60,14 +60,15 @@ a {
60
60
  padding-left: 1.25rem;
61
61
  margin-top: 5px;
62
62
  font-weight: normal;
63
- line-height: 1.5;
63
+ line-height: 1;
64
64
 
65
65
  &::before{
66
66
  content: url('../assets/icons/info.svg');
67
67
  width: 1rem;
68
68
  position: absolute;
69
69
  margin-left:-1.25rem;
70
- margin-top: 2px;
70
+ margin-top: -0.15rem;
71
+ transform: scale(0.85);
71
72
  }
72
73
 
73
74
  }