toggle-components-library 1.33.0-beta.3 → 1.33.0-beta.5

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.
Files changed (95) hide show
  1. package/dist/demo.html +10 -0
  2. package/dist/img/add_circle.7c6b29c6.svg +29 -0
  3. package/dist/img/airship-audiences-hover.7197407c.svg +9 -0
  4. package/dist/img/airship-audiences.e7477e19.svg +9 -0
  5. package/dist/img/airship-circle-user-icon-hover.7eecff69.svg +3 -0
  6. package/dist/img/airship-circle-user-icon.b39571b4.svg +3 -0
  7. package/dist/img/airship-clipboard-hover.80ae4cc8.svg +10 -0
  8. package/dist/img/airship-clipboard.4e2aec57.svg +10 -0
  9. package/dist/img/airship-cog-hover.9bfe1b84.svg +10 -0
  10. package/dist/img/airship-cog.6c89b74b.svg +10 -0
  11. package/dist/img/airship-down-arrow-active.bab27497.svg +3 -0
  12. package/dist/img/airship-down-arrow.5b2f3f44.svg +3 -0
  13. package/dist/img/airship-hat-hover.56740dd2.svg +10 -0
  14. package/dist/img/airship-hat.5cff7b4e.svg +10 -0
  15. package/dist/img/airship-megaphone-hover.2a7711d9.svg +10 -0
  16. package/dist/img/airship-megaphone.38428749.svg +10 -0
  17. package/dist/img/airship-pencil-hover.3970bc92.svg +11 -0
  18. package/dist/img/airship-pencil.350548ab.svg +11 -0
  19. package/dist/img/airship-pie-chart-hover.d3aac6ad.svg +11 -0
  20. package/dist/img/airship-pie-chart.617f307c.svg +11 -0
  21. package/dist/img/airship-plane-hover.abb5f358.svg +10 -0
  22. package/dist/img/airship-plane.978cf187.svg +10 -0
  23. package/dist/img/airship-sms-hover.4d1b0c06.svg +10 -0
  24. package/dist/img/airship-sms.17a3fcef.svg +10 -0
  25. package/dist/img/airship-user-icon.1c0e190a.svg +3 -0
  26. package/dist/img/airship-wrench-hover.9531b048.svg +10 -0
  27. package/dist/img/airship-wrench.a406f6f1.svg +10 -0
  28. package/dist/img/airship-x-hover.e1c3bb98.svg +3 -0
  29. package/dist/img/airship-x.dec93e61.svg +3 -0
  30. package/dist/img/arrow-icon.6b7bdc31.svg +3 -0
  31. package/dist/img/arrow-left-blue-hover.5b0a1e54.svg +32 -0
  32. package/dist/img/arrow-left-blue.1e5404dd.svg +32 -0
  33. package/dist/img/arrow-right-blue-hover.b800a882.svg +32 -0
  34. package/dist/img/arrow-right-blue.fbc83729.svg +32 -0
  35. package/dist/img/arrow_down.787e1a8b.svg +28 -0
  36. package/dist/img/booster_close.34390853.svg +3 -0
  37. package/dist/img/calendar.16f176cd.svg +37 -0
  38. package/dist/img/card.e1735960.svg +9 -0
  39. package/dist/img/checkbox_blank.907b325c.svg +6 -0
  40. package/dist/img/checkbox_checked.3e2d399f.svg +9 -0
  41. package/dist/img/checkbox_hover.e99ab40c.svg +3 -0
  42. package/dist/img/checkbox_inactive.b94b6c81.svg +9 -0
  43. package/dist/img/circle_blank.ab1622db.svg +24 -0
  44. package/dist/img/clipboard.e483ded3.svg +12 -0
  45. package/dist/img/clock-solid.fdaf024d.svg +1 -0
  46. package/dist/img/contacts-greyblue.ef6f8a9a.svg +1 -0
  47. package/dist/img/contacts-white.95d07c7a.svg +1 -0
  48. package/dist/img/delete-grey.cf15dcd1.svg +29 -0
  49. package/dist/img/delete-trash.3a307964.svg +12 -0
  50. package/dist/img/delete.ee71bb54.svg +29 -0
  51. package/dist/img/drag_drop.0c778868.svg +14 -0
  52. package/dist/img/draggable.7493006c.svg +1 -0
  53. package/dist/img/edit_circle.4f3826d3.svg +34 -0
  54. package/dist/img/edit_circle_grey.0c96938c.svg +34 -0
  55. package/dist/img/email-icon.3c44b236.svg +3 -0
  56. package/dist/img/email.078e944d.svg +7 -0
  57. package/dist/img/file.f4fb9e5d.svg +9 -0
  58. package/dist/img/form_icon.cd53ec12.svg +10 -0
  59. package/dist/img/funnel.7fa095c3.svg +11 -0
  60. package/dist/img/graph.7f2e3985.svg +16 -0
  61. package/dist/img/grey_cross.2ac5fda1.svg +15 -0
  62. package/dist/img/info.4b233da4.svg +29 -0
  63. package/dist/img/magnifying-glass-icon.9a2b42a1.svg +3 -0
  64. package/dist/img/megaphone.73161a8a.svg +19 -0
  65. package/dist/img/mobile-icon.9e16ffcd.svg +6 -0
  66. package/dist/img/orders.51f8963f.svg +29 -0
  67. package/dist/img/search.db8f673f.svg +25 -0
  68. package/dist/img/tick-grey.b6d7b16c.svg +12 -0
  69. package/dist/img/tick.97f35963.svg +12 -0
  70. package/dist/img/tick_circle.417fd97d.svg +28 -0
  71. package/dist/img/tick_circle_grey.92b7e747.svg +32 -0
  72. package/dist/img/upload.9b0f1f1c.svg +30 -0
  73. package/dist/img/view_email.508021c9.svg +7 -0
  74. package/dist/img/view_heatmap.f9058fdb.svg +1 -0
  75. package/dist/toggle-components-library.common.js +25936 -0
  76. package/dist/toggle-components-library.common.js.map +1 -0
  77. package/dist/toggle-components-library.css +1 -0
  78. package/dist/toggle-components-library.umd.js +25946 -0
  79. package/dist/toggle-components-library.umd.js.map +1 -0
  80. package/dist/toggle-components-library.umd.min.js +45 -0
  81. package/dist/toggle-components-library.umd.min.js.map +1 -0
  82. package/package-lock.json +20285 -0
  83. package/package.json +2 -2
  84. package/src/components/forms/ToggleDatePicker.vue +142 -238
  85. package/src/components/forms/ToggleDateRangePicker.vue +199 -0
  86. package/src/components/forms/ToggleInputCurrency.vue +2 -8
  87. package/src/components/forms/ToggleInputPercentage.vue +4 -15
  88. package/src/components/forms/ToggleInputSelect.vue +8 -27
  89. package/src/components/forms/ToggleInputText.vue +7 -30
  90. package/src/components/statusbar/ToggleStatusBar.vue +28 -3
  91. package/src/components/tables/ToggleTable.vue +48 -115
  92. package/src/index.js +3 -1
  93. package/src/sass/includes/_as_inputs.scss +50 -55
  94. package/src/sass/includes/_as_statusbar.scss +97 -0
  95. package/src/sass/includes/_as_table.scss +9 -11
@@ -10,14 +10,13 @@
10
10
  </label>
11
11
  <input
12
12
  :name="name ? name : 'ToggleInputPercentage' "
13
- :class="[ 'toggle-input', {'toggle-input-is-readonly':readonly, size}]"
13
+ :class="[ 'toggle-input', 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"
20
- :readonly="readonly"
19
+ @focus="isInputActive = true"
21
20
  />
22
21
  <label
23
22
  class="toggle-input-label-error"
@@ -78,17 +77,7 @@ export default {
78
77
  allowFloat: {
79
78
  type: Boolean,
80
79
  default: false
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
- },
80
+ }
92
81
  },
93
82
 
94
83
  created : function(){
@@ -111,7 +100,7 @@ export default {
111
100
  inputVal: {
112
101
 
113
102
  get: function() {
114
- if (this.isInputActive && !this.readonly) {
103
+ if (this.isInputActive) {
115
104
  // Cursor is inside the input field. unformat display value for user
116
105
  return this.value.toString()
117
106
  } else {
@@ -1,18 +1,18 @@
1
1
  <template>
2
2
 
3
- <div v-if="show" class="toggle-input-container" :class="{'toggle-input-is-invalid':isInvalid, 'toggle-input-is-disabled':disabled}" v-on:click="focusClosestInput">
4
- <label
3
+ <div class="toggle-input-container" :class="{'toggle-input-is-invalid':isInvalid, 'toggle-input-is-disabled':disabled}" v-on:click="focusClosestInput">
4
+ <label
5
5
  v-if="label"
6
- :for="name ? name : 'ToggleInputSelect' "
6
+ :for="name ? name : 'ToggleInputSelect' "
7
7
  class="toggle-input-label"
8
- > {{ label }}
8
+ > {{ label }}
9
9
  </label>
10
10
 
11
11
  <div class="toggle-input-select-container">
12
- <select
13
- :name="name ? name : 'ToggleInputSelect' "
12
+ <select
13
+ :name="name ? name : 'ToggleInputSelect' "
14
14
  :class="[ 'toggle-input-select', size]"
15
- v-model="inputVal"
15
+ v-model="inputVal"
16
16
  :autocomplete="autocomplete ? 'on' : 'off' "
17
17
  :required="required"
18
18
  :disabled="disabled"
@@ -24,7 +24,7 @@
24
24
  </div>
25
25
 
26
26
  <label
27
- class="toggle-input-label-error"
27
+ class="toggle-input-label-error"
28
28
  v-if="isInvalid"
29
29
  :for="name ? name : 'ToggleInputText' "
30
30
  >
@@ -39,11 +39,6 @@ import { mixins } from '../mixins/mixins'
39
39
 
40
40
  export default {
41
41
  mixins:[mixins],
42
- data() {
43
- return {
44
- show: false
45
- }
46
- },
47
42
  props: {
48
43
  value: {},
49
44
  name: {
@@ -88,19 +83,10 @@ export default {
88
83
  type: Boolean,
89
84
  required: false,
90
85
  default: false
91
- },
92
- // in toggle-table context, if search bar height expand transition has finished
93
- searchIsOpen: {
94
- type: Boolean,
95
- required: false,
96
- default: null
97
86
  }
98
87
  },
99
88
 
100
89
  created : function(){
101
- if(this.searchIsOpen === null || this.searchIsOpen){
102
- this.show = true;
103
- }
104
90
  },
105
91
  computed: {
106
92
  inputVal: {
@@ -126,11 +112,6 @@ export default {
126
112
  options(options) {
127
113
  if (options.filter( option => option.value == this.inputVal).length == 0)
128
114
  this.inputVal = "";
129
- },
130
- searchIsOpen(new_value){
131
- if(new_value){
132
- this.show = true;
133
- }
134
115
  }
135
116
  }
136
117
  }
@@ -1,17 +1,17 @@
1
1
  <template>
2
2
 
3
3
  <div class="toggle-input-container" :class="{'toggle-input-is-invalid':isInvalid, 'toggle-input-is-disabled':disabled}" v-on:click="focusClosestInput">
4
- <label
4
+ <label
5
5
  v-if="label"
6
- :for="name ? name : 'InputText' "
6
+ :for="name ? name : 'InputText' "
7
7
  class="toggle-input-label"
8
- > {{ label }}
8
+ > {{ label }}
9
9
  </label>
10
10
  <span class="toggle-input-counter" v-if="maxLength">{{messageLength(inputVal, maxLength)}}</span>
11
11
  <input
12
12
  :type="type"
13
- :name="name ? name : 'ToggleInputText' "
14
- :class="['toggle-input', {'toggle-input-is-readonly':readonly, size}]"
13
+ :name="name ? name : 'ToggleInputText' "
14
+ :class="[ 'toggle-input', size]"
15
15
  :placeholder="placeholder ? placeholder : '' "
16
16
  :autocomplete="autocomplete ? 'on' : 'off' "
17
17
  :required="required"
@@ -19,11 +19,9 @@
19
19
  :maxlength="maxLength"
20
20
  :disabled="disabled"
21
21
  :readonly="readonly"
22
- :ref="'input_ele'"
23
- @keyup.esc="handleEscPress"
24
22
  />
25
23
  <label
26
- class="toggle-input-label-error"
24
+ class="toggle-input-label-error"
27
25
  v-if="isInvalid"
28
26
  :for="name ? name : 'ToggleInputText' "
29
27
  >
@@ -102,26 +100,10 @@ export default {
102
100
  type: Boolean,
103
101
  required: false,
104
102
  default: false
105
- },
106
- // in toggle-table context, if search bar height expand transition has finished
107
- searchIsOpen: {
108
- type: Boolean,
109
- required: false
110
103
  }
111
104
  },
112
105
 
113
- created : function()
114
- {
115
- if(this.searchIsOpen){
116
- this.$nextTick(() => this.$refs['input_ele'].focus());
117
- }
118
- },
119
- watch: {
120
- searchIsOpen(new_value){
121
- if(new_value){
122
- this.$nextTick(() => this.$refs['input_ele'].focus());
123
- }
124
- }
106
+ created : function(){
125
107
  },
126
108
  computed: {
127
109
  inputVal: {
@@ -136,11 +118,6 @@ export default {
136
118
  },
137
119
  methods: {
138
120
 
139
- handleEscPress()
140
- {
141
- this.$emit('bail');
142
- },
143
-
144
121
  /*
145
122
  * Concat message for count characters
146
123
  * @return string
@@ -1,9 +1,16 @@
1
1
  <template>
2
2
  <div :class="['toggle-status-bar-container', statusColours, statusSize]">
3
3
  <label class="toggle-status-bar-label">
4
- <span class="toggle-status-bar-dot" v-if="showDot">&#9679;</span>
4
+ <span class="toggle-status-bar-dot blinking" v-if="showDot">&#9679;</span>
5
5
  {{ statusName }}
6
6
  </label>
7
+
8
+ <div class="toggle-status-bar-tooltip-container" v-if="showToolTip && toolTipText.length">
9
+ <div class="toggle-status-bar-tooltip">
10
+ ?
11
+ <span class="toggle-status-bar-tooltip-text">{{ toolTipText }}</span>
12
+ </div>
13
+ </div>
7
14
  </div>
8
15
  </template>
9
16
 
@@ -15,7 +22,7 @@ export default {
15
22
  type: String,
16
23
  required: true,
17
24
  validator: function (value) {
18
- return ['draft', 'processing', 'complete', 'inactive', 'active'].indexOf(value) !== -1;
25
+ return ['draft', 'processing', 'complete', 'inactive', 'active', 'submitted'].indexOf(value) !== -1;
19
26
  }
20
27
  },
21
28
  size: {
@@ -24,6 +31,10 @@ export default {
24
31
  validator: function (value) {
25
32
  return ['small'].indexOf(value) !== -1;
26
33
  }
34
+ },
35
+ toolTipOptions: {
36
+ type: Object,
37
+ required: false
27
38
  }
28
39
  },
29
40
  computed: {
@@ -41,7 +52,21 @@ export default {
41
52
  },
42
53
  // Show the dot if the status is active or processing
43
54
  showDot() {
44
- return this.status === 'active' || this.status === 'processing';
55
+ return this.status === 'active' || this.status === 'processing' || this.status === 'submitted';
56
+ },
57
+ showToolTip() {
58
+ return this.size !== 'small';
59
+ },
60
+ toolTipText() {
61
+ if (!this.toolTipOptions) {
62
+ return '';
63
+ }
64
+
65
+ if (this.toolTipOptions[this.status]) {
66
+ return this.toolTipOptions[this.status];
67
+ } else {
68
+ return '';
69
+ }
45
70
  }
46
71
  }
47
72
  }
@@ -3,58 +3,29 @@
3
3
  <div>
4
4
 
5
5
  <table class="toggle-table">
6
- <thead :class="{'toggle-table-any-search-active': anySearchActive}">
6
+ <thead :class="{'toggle-table-any-search-active': searchActive}">
7
7
  <tr class="toggle-tablee-tr">
8
- <th
9
- scope="col"
10
- :class="['toggle-table-th', {'toggle-table-search-active': tableSearchActive(field), 'toggle-table-searchable':field.filterable}]"
11
- v-for="(field, index) in headers"
12
- :colspan="field.colspan"
8
+ <th
9
+ scope="col"
10
+ :class="['toggle-table-th', {'toggle-table-search-active': tableSearchActive(field), 'toggle-table-searchable':field.filterable}]"
11
+ v-for="(field, index) in headers"
13
12
  :key="index"
14
13
  :style="'width:'+field.width"
15
14
  @click="activateSearch(field)"
16
15
  >
17
- <div class="toggle-table-th-inner" @transitionend="handleTransitionEnd">
18
-
16
+ <div class="toggle-table-th-inner">
19
17
  <span class="toggle-table-th-title">{{field.label}}</span>
20
18
  <span class="toggle-table-close-search" v-on:click.stop @click="closeSearch(field)"></span>
19
+ <ToggleInputText type="text" :ref="field.key+'-input'" v-model="searchModels[field.key]" @input="searchChange(field)"
20
+ v-if="field.type == 'text' && (searchModels[field.key] || editingInput == field.key)" />
21
+ <ToggleInputSelect style="margin-top:2px;" size="small" v-if="field.type == 'select' && (searchModels[field.key] || editingInput == field.key)" :options="field.select_options" v-model="searchModels[field.key]" @input="val=>searchChange(val, field)"/>
21
22
 
22
- <ToggleInputText
23
- v-if="field.type === 'text' && (searchModels[field.key] || editingInput === field.key)"
24
- type="text"
25
- :ref="field.key+'-input'"
26
- v-model="searchModels[field.key]"
27
- @input="searchChange(field)"
28
- @bail="closeSearch(field)"
29
- :searchIsOpen="searchIsOpen"
30
- />
31
- <ToggleInputSelect
32
- style="margin-top:2px;"
33
- :size="'small'"
34
- v-if="field.type === 'select' && (searchModels[field.key] || editingInput === field.key)"
35
- :searchIsOpen="searchIsOpen"
36
- :options="field.select_options"
37
- v-model="searchModels[field.key]"
38
- @input="val=>searchChange(val, field)"
39
- />
40
- <ToggleDatePicker
41
- v-if="field.type === 'date_range' && (searchModels[field.key].start || searchModels[field.key].end || editingInput === field.key)"
42
- name="date_range" size="small"
43
- :searchIsOpen="searchIsOpen"
44
- @input="val=>searchChange(val, field)" type="date" :range="true" label="Input label" v-model="searchModels[field.key]"
45
- />
23
+ <ToggleDateRangePicker v-if="field.type == 'date' && (searchModels[field.key].start || searchModels[field.key].end || editingInput == field.key)" name="date" v-model="searchModels[field.key]" @input="val=>searchChange(val, field)" />
46
24
  </div>
47
25
  </th>
48
-
26
+
49
27
  </tr>
50
28
  </thead>
51
- <tr class="empty-table" v-if="(items && items.length === 0) && !loading">
52
- <td colspan="5">
53
- <div class="full">
54
- <div class="empty-area"><p>{{ emptyTableMessage }}</p></div>
55
- </div>
56
- </td>
57
- </tr>
58
29
  <tbody v-if="!$slots.default || !$slots.default.length">
59
30
  <ToggleTableRow v-for="(item, index) in items" :key="index" >
60
31
  <ToggleTableColumn v-for="(column, column_index) in item" :key="column_index">{{column}}</ToggleTableColumn>
@@ -73,7 +44,7 @@
73
44
 
74
45
  import { mixins } from '../mixins/mixins';
75
46
 
76
- import ToggleDatePicker from '../forms/ToggleDatePicker.vue';
47
+ import ToggleDateRangePicker from '../forms/ToggleDateRangePicker.vue';
77
48
  import ToggleInputText from '../forms/ToggleInputText.vue';
78
49
  import ToggleInputSelect from '../forms/ToggleInputSelect.vue';
79
50
  import ToggleTableRow from '../tables/ToggleTableRow.vue';
@@ -82,7 +53,7 @@ import TogglePagination from '../tables/TogglePagination.vue';
82
53
 
83
54
  export default {
84
55
  mixins:[mixins],
85
- components:{ToggleDatePicker, ToggleInputText, ToggleInputSelect, ToggleTableColumn, ToggleTableRow, TogglePagination},
56
+ components:{ToggleDateRangePicker, ToggleInputText, ToggleInputSelect, ToggleTableColumn, ToggleTableRow, TogglePagination},
86
57
  props: {
87
58
  items: {
88
59
  type: [Array]
@@ -91,30 +62,20 @@ export default {
91
62
  type: [Array]
92
63
  },
93
64
  total:{
94
- type: [Number]
65
+ type: [Number]
95
66
  },
96
67
  per_page:{
97
- type: [Number]
68
+ type: [Number]
98
69
  },
99
70
  page:{
100
71
  type: [Number],
101
72
  default:1
102
- },
103
- loading: {
104
- type: Boolean
105
- },
106
- emptyTableMessage: {
107
- type: String,
108
- default: "No rows returned."
109
73
  }
110
- },
74
+ },
111
75
  data : function(){
112
76
  return {
113
77
  editingInput:false,
114
- searchModels:{},
115
- anySearchActive: false,
116
- searchIsOpen: false,
117
- searchDebounce: null
78
+ searchModels:{}
118
79
  };
119
80
  },
120
81
  computed: {
@@ -136,23 +97,36 @@ export default {
136
97
 
137
98
  headers() {
138
99
  if(!this.fields){
139
- return Object.keys(this.items[0]);
100
+ return Object.keys(this.items[0]);
140
101
  }
141
102
  return this.fields;
142
103
  },
143
104
 
105
+ searchActive() {
106
+ if(this.editingInput) {
107
+ return true;
108
+ }
109
+ for(let col in this.searchModels){
110
+ if(!this.searchModels[col])
111
+ return false;
112
+ if (this.searchModels[col].start !== undefined) {
113
+ return true;
114
+ }
115
+ else if(this.searchModels[col]) return true;
116
+ }
117
+ return false;
118
+ },
119
+
120
+
144
121
  },
145
122
  created : function(){
146
123
 
147
124
  if(this.fields){
148
-
149
125
  for (let i = 0; i < this.fields.length; i++) {
150
- let value = this.fields[i].type == 'date_range' ? this.setInitialDate(i) : (this.fields[i].value ?? '');
151
-
126
+ let value = this.fields[i].type == 'date' ? this.setInitialDate(i) : this.fields[i].value;
152
127
  let field_name = this.fields[i].key;
153
128
  this.$set( this.searchModels, field_name, value )
154
129
  if(value){
155
- this.searchIsOpen = true;
156
130
  // if date has an initial value set, show it.
157
131
  if(typeof value.start !== 'undefined'){
158
132
  if(value.start.length) this.activateSearch(this.fields[i]);
@@ -163,29 +137,20 @@ export default {
163
137
  this.searchChange();
164
138
  }
165
139
  }
166
-
140
+
167
141
  },
168
142
 
169
143
  beforeDestroy: function () {
144
+ },
145
+ watch:{
146
+
170
147
  },
171
148
  mounted : function ()
172
149
  {
173
150
 
174
151
  },
175
-
152
+
176
153
  methods:{
177
-
178
- handleTransitionEnd(event){
179
- if(event.propertyName === 'height'){
180
- if(this.anySearchActive && !this.searchIsOpen){
181
- this.searchIsOpen = true;
182
- }
183
- if(!this.anySearchActive && this.searchIsOpen){
184
- this.searchIsOpen = false;
185
- }
186
- }
187
- },
188
-
189
154
  // set initial date
190
155
  setInitialDate(index){
191
156
  let value = this.fields[index].value;
@@ -195,68 +160,36 @@ export default {
195
160
 
196
161
  tableSearchActive(field)
197
162
  {
198
- if(field.type === 'date_range'){
199
- return (this.searchModels[field.key].start || this.searchModels[field.key].end || this.editingInput === field.key);
163
+ if(field.type == 'date'){
164
+ return (this.searchModels[field.key].start || this.searchModels[field.key].end || this.editingInput == field.key);
200
165
  }
201
- return (this.searchModels[field.key] || this.editingInput === field.key);
166
+ return (this.searchModels[field.key] || this.editingInput == field.key);
202
167
 
203
168
  },
204
169
 
205
-
206
- getSearchModelTypeFromKey(key){
207
- for(let i=0; i<this.fields.length; i++){
208
- if(this.fields[i].key === key){
209
- return this.fields[i].type;
210
- }
211
- }
212
- return null;
213
- },
214
-
215
170
  closeSearch(field){
216
-
217
171
  this.editingInput = false;
218
- this.searchModels[field.key] = field.type === 'date_range' ? { start: null, end: null} : '' ;
219
-
220
- // check if any search is active; if not, close/shrink header
221
- let is_active = false;
222
- for(const key in this.searchModels){
223
-
224
- if(this.getSearchModelTypeFromKey(key) === 'date_range'){
225
- if (this.searchModels[key].start || this.searchModels[key].end){
226
- is_active = true;
227
- break;
228
- }
229
- }else if(this.searchModels[key] && this.searchModels[key] !== ''){
230
- is_active = true;
231
- break;
232
- }
233
- }
234
- this.anySearchActive = is_active;
172
+ this.searchModels[field.key] = field.type == 'date' ? { start: false, end: false} : '' ;
235
173
  this.searchChange();
236
174
  },
237
175
 
238
176
  searchChange(){
239
- clearTimeout(this.searchDebounce);
240
- this.searchDebounce = setTimeout(()=>{
241
- this.$emit('search', this.fieldsWithSearch);
242
- },500);
243
-
177
+ this.$emit('search', this.fieldsWithSearch);
244
178
  },
245
179
 
246
180
  /* activateSearch
247
181
  * When a user clicks a searchable column name, show it as active, and focus the child input field (unless it's already active)
248
182
  */
249
183
  activateSearch(field){
250
- if(!field.filterable || field.readonly) return;
251
- if(field.type === 'date_range'){
184
+ if(!field.filterable) return;
185
+ if(field.type === 'date'){
252
186
  this.datePickerOpen = true;
253
187
  }
254
188
  this.editingInput = field.key;
255
- this.anySearchActive = true;
256
189
  //this.$nextTick(() => this.$refs[this.editingInput + '-input'].focus())
257
190
  },
258
191
 
259
-
192
+
260
193
 
261
194
  }
262
195
  }
package/src/index.js CHANGED
@@ -4,6 +4,7 @@ import ToggleInputText from "./components/forms/ToggleInputText.vue";
4
4
  import ToggleInputEditableText from "./components/forms/ToggleInputEditableText.vue";
5
5
  import ToggleInputWebsite from "./components/forms/ToggleInputWebsite.vue";
6
6
  import ToggleDatePicker from "./components/forms/ToggleDatePicker.vue";
7
+ import ToggleDateRangePicker from "./components/forms/ToggleDateRangePicker.vue";
7
8
  import ToggleInputSelect from "./components/forms/ToggleInputSelect.vue";
8
9
  import ToggleInputPercentage from "./components/forms/ToggleInputPercentage.vue";
9
10
  import ToggleInputCurrency from "./components/forms/ToggleInputCurrency.vue";
@@ -105,13 +106,14 @@ const Components = {
105
106
  ToggleInputEditableText,
106
107
  ToggleInputWebsite,
107
108
  ToggleDatePicker,
109
+ ToggleDateRangePicker,
108
110
  ToggleInputSelect,
109
111
  ToggleInputPercentage,
110
112
  ToggleInputCurrency,
111
113
  ToggleInputRadioButtons,
112
114
  ToggleInputTextArea,
113
115
  ToggleInputCheckboxContainer,
114
- ToggleInputCheckbox,
116
+ ToggleInputCheckbox,
115
117
  ToggleInputCheckboxInline,
116
118
  ToggleFillLoader,
117
119
  ToggleProgressLoader,