toggle-components-library 1.16.2 → 1.19.0

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": "toggle-components-library",
3
- "version": "1.16.2",
3
+ "version": "1.19.0",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -32,6 +32,7 @@
32
32
  "vue-airbnb-style-datepicker": "^2.7.1",
33
33
  "vue-color": "^2.7.1",
34
34
  "vue-moment": "^4.1.0",
35
+ "vue-multiselect": "^2.0.8",
35
36
  "vue-router": "^3.4.3",
36
37
  "vue2-dropzone": "^3.6.0",
37
38
  "vuedraggable": "^2.24.3",
@@ -0,0 +1,10 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="14.942" height="14.942" viewBox="0 0 14.942 14.942">
2
+ <g id="Group_207" data-name="Group 207" transform="translate(-162.057 -567.364)">
3
+ <rect id="Rectangle_890" data-name="Rectangle 890" width="14" height="14" rx="2" transform="matrix(0.998, -0.07, 0.07, 0.998, 162.057, 568.341)" fill="#e57936"/>
4
+ <path id="Rectangle_889_-_Outline" data-name="Rectangle 889 - Outline" d="M2,1A1,1,0,0,0,1,2V12a1,1,0,0,0,1,1H12a1,1,0,0,0,1-1V2a1,1,0,0,0-1-1H2M2,0H12a2,2,0,0,1,2,2V12a2,2,0,0,1-2,2H2a2,2,0,0,1-2-2V2A2,2,0,0,1,2,0Z" transform="matrix(0.998, -0.07, 0.07, 0.998, 162.057, 568.341)" fill="#881212"/>
5
+ <path id="Line_290" data-name="Line 290" d="M4.641.5H0A.5.5,0,0,1-.5,0,.5.5,0,0,1,0-.5H4.641a.5.5,0,0,1,.5.5A.5.5,0,0,1,4.641.5Z" transform="matrix(0.998, -0.07, 0.07, 0.998, 165.198, 571.75)" fill="#881212"/>
6
+ <path id="Line_291" data-name="Line 291" d="M8.21.5H0A.5.5,0,0,1-.5,0,.5.5,0,0,1,0-.5H8.21a.5.5,0,0,1,.5.5A.5.5,0,0,1,8.21.5Z" transform="matrix(0.998, -0.07, 0.07, 0.998, 165.364, 574.125)" fill="#881212"/>
7
+ <path id="Line_292" data-name="Line 292" d="M1.685.5H0A.5.5,0,0,1-.5,0,.5.5,0,0,1,0-.5H1.685a.5.5,0,0,1,.5.5A.5.5,0,0,1,1.685.5Z" transform="matrix(0.998, -0.07, 0.07, 0.998, 171.588, 571.303)" fill="#881212"/>
8
+ <path id="Line_293" data-name="Line 293" d="M2.761.75H0A.75.75,0,0,1-.75,0,.75.75,0,0,1,0-.75H2.761a.75.75,0,0,1,.75.75A.75.75,0,0,1,2.761.75Z" transform="matrix(0.998, -0.07, 0.07, 0.998, 168.317, 577.306)" fill="#881212"/>
9
+ </g>
10
+ </svg>
@@ -74,7 +74,29 @@ export default {
74
74
  return this.buttonStyle.includes('mini');
75
75
  }
76
76
  },
77
+ watch: {
78
+ disabled() {
79
+ if (this.$slots.default !== undefined){
80
+ this.disableLinks()
81
+ }
82
+ },
83
+ loading() {
84
+ if (this.$slots.default !== undefined){
85
+ this.disableLinks()
86
+ }
87
+ }
88
+ },
77
89
  methods: {
90
+
91
+ /**
92
+ * set link href to null if button loading or disabled
93
+ */
94
+ disableLinks() {
95
+ this.$slots.default.forEach(slot => {
96
+ slot.data.attrs.href = this.disabled || this.loading ? null : slot.data.attrs.href;
97
+ })
98
+ },
99
+
78
100
  click(){
79
101
  /**
80
102
  * Emitted when the button is clicked.
@@ -83,6 +105,11 @@ export default {
83
105
  */
84
106
  this.$emit('click');
85
107
  }
108
+ },
109
+ created() {
110
+ if (this.$slots.default !== undefined){
111
+ this.disableLinks()
112
+ }
86
113
  }
87
114
  }
88
115
  </script>
@@ -0,0 +1,70 @@
1
+ <template>
2
+ <div class="toggle-input-container" :class="{'toggle-input-is-invalid':isInvalid }" >
3
+
4
+ <label v-if="label" class="toggle-input-label toggle-float-none" :for="name ? name : 'ToggleInputMultiSelect' ">
5
+ {{label}}
6
+ </label>
7
+
8
+ <div class="input-holder">
9
+ <multiselect v-model="inputVal" :options="options" :multiple="true" :close-on-select="true" :clear-on-select="false" :preserve-search="true" :placeholder="placeholder" label="label" track-by="value" :preselect-first="false">
10
+ </multiselect>
11
+ </div>
12
+
13
+ <label class="toggle-input-label-error" v-if="isInvalid" :for="name ? name : 'ToggleInputMultiSelect' ">
14
+ {{ errorMessage }}
15
+ </label>
16
+ </div>
17
+ </template>
18
+
19
+ <script>
20
+ import Vue from 'vue';
21
+ import Multiselect from 'vue-multiselect';
22
+ import 'vue-multiselect/dist/vue-multiselect.min.css';
23
+ Vue.component('multi-select', Multiselect);
24
+
25
+ export default {
26
+ components: { Multiselect },
27
+ props: {
28
+ value: {
29
+ type: Array
30
+ },
31
+ label: {
32
+ type: String
33
+ },
34
+ name: {
35
+ type: String,
36
+ required: false
37
+ },
38
+ options: {
39
+ type: Array,
40
+ required: true
41
+ },
42
+ placeholder: {
43
+ type: String,
44
+ required: false
45
+ },
46
+ isInvalid: {
47
+ type: Boolean,
48
+ required: false
49
+ },
50
+ errorMessage: {
51
+ type: String,
52
+ required: false
53
+ }
54
+ },
55
+ computed: {
56
+ inputVal: {
57
+ get(){
58
+ return this.value;
59
+ },
60
+
61
+ set(value){
62
+ this.$emit('input', value);
63
+ }
64
+ }
65
+ },
66
+ }
67
+ </script>
68
+ <style>
69
+
70
+ </style>
@@ -16,6 +16,7 @@
16
16
  :required="required"
17
17
  v-model="inputVal"
18
18
  :maxlength="maxLength"
19
+ :disabled="disabled"
19
20
  />
20
21
  <label
21
22
  class="toggle-input-label-error"
@@ -81,6 +82,10 @@ export default {
81
82
  maxLength:{
82
83
  type: Number,
83
84
  required:false
85
+ },
86
+ disabled: {
87
+ type: Boolean,
88
+ required: false,
84
89
  }
85
90
  },
86
91
 
@@ -22,7 +22,7 @@ export default {
22
22
  default: false,
23
23
  },
24
24
  /**
25
- * Icon to use `toggle-graph-icon`, `toggle-orders-icon`, `toggle-card-icon`, `toggle-megaphone-icon`
25
+ * Icon to use `toggle-graph-icon`, `toggle-orders-icon`, `toggle-card-icon`, `toggle-megaphone-icon`, `toggle-form-icon`
26
26
  */
27
27
  icon: {
28
28
  type: String,
package/src/index.js CHANGED
@@ -53,6 +53,7 @@ import ToggleFontPicker from "./components/forms/ToggleFontPicker.vue";
53
53
 
54
54
  import ToggleInputNumberUnit from "./components/forms/ToggleInputNumberUnit.vue";
55
55
  import ToggleInputLabelLeft from "./components/forms/ToggleInputLabelLeft.vue";
56
+ import ToggleInputMultiSelect from "./components/forms/ToggleInputMultiSelect.vue";
56
57
 
57
58
  import './sass/main.scss';
58
59
 
@@ -100,7 +101,8 @@ const Components = {
100
101
  ToggleInternationalPhoneInputSelect,
101
102
  ToggleFontPicker,
102
103
  ToggleInputNumberUnit,
103
- ToggleInputLabelLeft
104
+ ToggleInputLabelLeft,
105
+ ToggleInputMultiSelect
104
106
  }
105
107
 
106
108
  Object.keys(Components).forEach(name => {
@@ -1 +1,5 @@
1
1
  @import "_as_variables";
2
+
3
+ .toggle-float-none {
4
+ float: none !important;
5
+ }
@@ -158,8 +158,6 @@
158
158
  bottom : 0.3rem;
159
159
  }
160
160
 
161
-
162
-
163
161
  // date picker
164
162
 
165
163
  .toggle-date-container{
@@ -248,7 +246,6 @@
248
246
  }
249
247
  }
250
248
 
251
-
252
249
 
253
250
  .toggle-input-select{
254
251
 
@@ -81,6 +81,9 @@
81
81
  &.toggle-email-icon a::before {
82
82
  background-image: url("../assets/icons/email.svg");
83
83
  }
84
+ &.toggle-form-icon a::before {
85
+ background-image: url("../assets/icons/form_icon.svg");
86
+ }
84
87
 
85
88
 
86
89
  }