toggle-components-library 1.33.0-beta.0 → 1.33.0-beta.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.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toggle-components-library",
3
- "version": "1.33.0-beta.0",
3
+ "version": "1.33.0-beta.2",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -6,8 +6,8 @@
6
6
  <label class="toggle-input-label">{{label}}</label>
7
7
 
8
8
  <div class="toggle-date-input-container">
9
- <div class="toggle-date-input-calendar-icon">
10
- <input type="text" class="toggle-input" :name="name" ref="date-input" :id="'toggle-date-input'+_uid" :value="date" v-on:keypress="$event.preventDefault()">
9
+ <div :class="['toggle-date-input-calendar-icon', {'calendar-icon-disabled' :disabled}]">
10
+ <input type="text" class="toggle-input" :name="name" :disabled="disabled" ref="date-input" :id="'toggle-date-input'+_uid" :value="date" v-on:keypress="$event.preventDefault()" />
11
11
  </div>
12
12
  <button type="button" class="toggle-clear" v-on:click="clearDate" v-if="displayValue"></button>
13
13
  </div>
@@ -101,7 +101,11 @@ export default {
101
101
  maxLength:{
102
102
  type: Number,
103
103
  required:false
104
- }
104
+ },
105
+ disabled: {
106
+ type: Boolean,
107
+ default: false
108
+ },
105
109
  },
106
110
 
107
111
  created : function(){
@@ -12,11 +12,12 @@
12
12
  </label>
13
13
  <input
14
14
  :name="name ? name : 'ToggleInputCurrency' "
15
- :class="[ 'toggle-input', size]"
15
+ :class="[ 'toggle-input', {'toggle-input-is-readonly':readonly, size}]"
16
16
  :placeholder="placeholder ? placeholder : '' "
17
17
  :autocomplete="autocomplete ? 'on' : 'off' "
18
18
  :required="required"
19
19
  :disabled="disabled"
20
+ :readonly="readonly"
20
21
  v-model="inputVal"
21
22
  @blur="isInputActive = false"
22
23
  @focus="isInputActive = true"
@@ -98,6 +99,11 @@ export default {
98
99
  required: false,
99
100
  default: false
100
101
  },
102
+ readonly: {
103
+ type: Boolean,
104
+ required: false,
105
+ default: false
106
+ },
101
107
  },
102
108
 
103
109
  created : function(){
@@ -115,7 +121,7 @@ export default {
115
121
 
116
122
  get: function() {
117
123
 
118
- if (this.isInputActive) {
124
+ if (this.isInputActive && !this.readonly) {
119
125
  if((this.value === '' || this.value === null) && this.allowBlank)
120
126
  return '';
121
127
  // Cursor is inside the input field. unformat display value for user
@@ -10,13 +10,14 @@
10
10
  </label>
11
11
  <input
12
12
  :name="name ? name : 'ToggleInputPercentage' "
13
- :class="[ 'toggle-input', size]"
13
+ :class="[ 'toggle-input', {'toggle-input-is-readonly':readonly, size}]"
14
14
  :placeholder="placeholder ? placeholder : '' "
15
15
  :autocomplete="autocomplete ? 'on' : 'off' "
16
16
  :required="required"
17
17
  v-model="inputVal"
18
18
  @blur="isInputActive = false"
19
- @focus="isInputActive = true"
19
+ @focus="isInputActive = true"
20
+ :readonly="readonly"
20
21
  />
21
22
  <label
22
23
  class="toggle-input-label-error"
@@ -77,7 +78,17 @@ export default {
77
78
  allowFloat: {
78
79
  type: Boolean,
79
80
  default: false
80
- }
81
+ },
82
+ readonly: {
83
+ type: Boolean,
84
+ required: false,
85
+ default: false
86
+ },
87
+ disabled: {
88
+ type: Boolean,
89
+ required: false,
90
+ default: false
91
+ },
81
92
  },
82
93
 
83
94
  created : function(){
@@ -100,7 +111,7 @@ export default {
100
111
  inputVal: {
101
112
 
102
113
  get: function() {
103
- if (this.isInputActive) {
114
+ if (this.isInputActive && !this.readonly) {
104
115
  // Cursor is inside the input field. unformat display value for user
105
116
  return this.value.toString()
106
117
  } else {
@@ -11,7 +11,7 @@
11
11
  <input
12
12
  :type="type"
13
13
  :name="name ? name : 'ToggleInputText' "
14
- :class="[ 'toggle-input', size]"
14
+ :class="['toggle-input', {'toggle-input-is-readonly':readonly, size}]"
15
15
  :placeholder="placeholder ? placeholder : '' "
16
16
  :autocomplete="autocomplete ? 'on' : 'off' "
17
17
  :required="required"
@@ -227,6 +227,11 @@
227
227
  }
228
228
  }
229
229
 
230
+ .calendar-icon-disabled {
231
+ cursor: default;
232
+ opacity: 0.5;
233
+ }
234
+
230
235
  .toggle-input-select-container{
231
236
  position:relative;
232
237
  background-color: $toggle-dark-grey;
@@ -430,6 +435,10 @@
430
435
  }
431
436
  }
432
437
 
438
+ .toggle-input-is-readonly:focus {
439
+ outline: none;
440
+ }
441
+
433
442
  .toggle-input-radio-label, .toggle-input-checkbox-label{
434
443
  display : inline-block;
435
444
  font-size: $toggle-font-size-large;