@itfin/components 1.0.109 → 1.0.112
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 +1 -1
- package/src/.DS_Store +0 -0
- package/src/assets/scss/components/_search-input.scss +1 -1
- package/src/components/.DS_Store +0 -0
- package/src/components/datepicker/DatePicker.vue +2 -0
- package/src/components/datepicker/DatePickerInline.vue +2 -0
- package/src/components/select/Select.vue +43 -10
package/package.json
CHANGED
package/src/.DS_Store
ADDED
|
Binary file
|
|
@@ -60,7 +60,7 @@ $font-size: 1em;
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
// Single, when searching but not loading or open
|
|
63
|
-
.vs--single.vs--searching:not(.vs--open):not(.vs--loading) {
|
|
63
|
+
.vs--single.vs--searching:not(.vs--open):not(.vs--combobox):not(.vs--loading) {
|
|
64
64
|
.vs__search {
|
|
65
65
|
opacity: .2;
|
|
66
66
|
}
|
|
Binary file
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
:only-calendar="onlyCalendar"
|
|
43
43
|
:display-format="displayFormat"
|
|
44
44
|
:value-format="valueFormat"
|
|
45
|
+
:min-date="minDate"
|
|
45
46
|
@input="selectInlineDate"
|
|
46
47
|
></itf-date-picker-inline>
|
|
47
48
|
</div>
|
|
@@ -115,6 +116,7 @@ class itfDatePicker extends Vue {
|
|
|
115
116
|
@Prop({ type: String, default: '' }) placeholder;
|
|
116
117
|
@Prop({ type: String, default: '' }) prependIcon;
|
|
117
118
|
@Prop({ type: String, default: 'bottom-start' }) placement;
|
|
119
|
+
@Prop({ type: [String, Date], default: '' }) minDate;
|
|
118
120
|
@Prop(Boolean) clearable;
|
|
119
121
|
|
|
120
122
|
focused = false;
|
|
@@ -78,6 +78,7 @@ class itfDatePickerInline extends Vue {
|
|
|
78
78
|
@Prop({ type: Boolean, default: false }) onlyCalendar;
|
|
79
79
|
@Prop({ type: Boolean, default: false }) range;
|
|
80
80
|
@Prop({ type: Object, default: () => ({}) }) customDays;
|
|
81
|
+
@Prop({ type: [String, Date], default: '' }) minDate;
|
|
81
82
|
@Prop({
|
|
82
83
|
type: Array,
|
|
83
84
|
default: () => ([
|
|
@@ -111,6 +112,7 @@ class itfDatePickerInline extends Vue {
|
|
|
111
112
|
range: this.range,
|
|
112
113
|
view: (this.valueAsLuxon && !this.minView) ? 'days' : this.startView,
|
|
113
114
|
minView: this.minView,
|
|
115
|
+
minDate: this.minDate,
|
|
114
116
|
selectedDates: this.valueAsLuxon ? [this.valueAsLuxon.toJSDate()] : [],
|
|
115
117
|
onSelect: ({ date }) => {
|
|
116
118
|
if (this.range && !this.calendar.rangeDateTo) {
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
</div>
|
|
89
89
|
<transition :name="transition">
|
|
90
90
|
<ul
|
|
91
|
-
v-if="
|
|
91
|
+
v-if="dropdownWindowOpen"
|
|
92
92
|
:id="`vs${uid}__listbox`"
|
|
93
93
|
ref="dropdownMenu"
|
|
94
94
|
:key="`vs${uid}__listbox`"
|
|
@@ -231,9 +231,7 @@ import itfButton from '../button/Button';
|
|
|
231
231
|
import appendToBody from '../../directives/appendToBody';
|
|
232
232
|
import sortAndStringify from '../../helpers/sortAndStringify';
|
|
233
233
|
import uniqueId from '../../helpers/uniqueId';
|
|
234
|
-
|
|
235
|
-
* @name VueSelect
|
|
236
|
-
*/
|
|
234
|
+
|
|
237
235
|
export default {
|
|
238
236
|
components: {
|
|
239
237
|
itfButton,
|
|
@@ -242,6 +240,10 @@ export default {
|
|
|
242
240
|
directives: { appendToBody },
|
|
243
241
|
mixins: [pointerScroll, typeAheadPointer, ajax],
|
|
244
242
|
props: {
|
|
243
|
+
query: {
|
|
244
|
+
type: String,
|
|
245
|
+
default: ''
|
|
246
|
+
},
|
|
245
247
|
/**
|
|
246
248
|
* Contains the currently selected value. Very similar to a
|
|
247
249
|
* `value` attribute on an <input>. You can listen for changes
|
|
@@ -579,7 +581,10 @@ export default {
|
|
|
579
581
|
*/
|
|
580
582
|
clearSearchOnBlur: {
|
|
581
583
|
type: Function,
|
|
582
|
-
default: function ({ clearSearchOnSelect, multiple }) {
|
|
584
|
+
default: function ({ clearSearchOnSelect, multiple, combobox }) {
|
|
585
|
+
if (combobox) {
|
|
586
|
+
return false;
|
|
587
|
+
}
|
|
583
588
|
return clearSearchOnSelect && !multiple
|
|
584
589
|
},
|
|
585
590
|
},
|
|
@@ -627,6 +632,10 @@ export default {
|
|
|
627
632
|
type: Boolean,
|
|
628
633
|
default: false,
|
|
629
634
|
},
|
|
635
|
+
combobox: {
|
|
636
|
+
type: Boolean,
|
|
637
|
+
default: false,
|
|
638
|
+
},
|
|
630
639
|
/**
|
|
631
640
|
* Keycodes that will select the current option.
|
|
632
641
|
* @type Array
|
|
@@ -708,7 +717,7 @@ export default {
|
|
|
708
717
|
*/
|
|
709
718
|
dropdownShouldOpen: {
|
|
710
719
|
type: Function,
|
|
711
|
-
default({ noDrop, open, mutableLoading }) {
|
|
720
|
+
default({ noDrop, open, mutableLoading, combobox, options }) {
|
|
712
721
|
return noDrop ? false : open;// && !mutableLoading
|
|
713
722
|
},
|
|
714
723
|
},
|
|
@@ -723,7 +732,7 @@ export default {
|
|
|
723
732
|
},
|
|
724
733
|
data() {
|
|
725
734
|
return {
|
|
726
|
-
|
|
735
|
+
searchString: '',
|
|
727
736
|
open: false,
|
|
728
737
|
isComposing: false,
|
|
729
738
|
pushedTags: [],
|
|
@@ -733,6 +742,15 @@ export default {
|
|
|
733
742
|
},
|
|
734
743
|
inject: { itemLabel: { default: null } },
|
|
735
744
|
computed: {
|
|
745
|
+
search: {
|
|
746
|
+
get() {
|
|
747
|
+
return this.query || this.searchString;
|
|
748
|
+
},
|
|
749
|
+
set(val) {
|
|
750
|
+
this.searchString = val;
|
|
751
|
+
this.$emit('update:query', val);
|
|
752
|
+
}
|
|
753
|
+
},
|
|
736
754
|
/**
|
|
737
755
|
* Determine if the component needs to
|
|
738
756
|
* track the state of values internally.
|
|
@@ -848,6 +866,7 @@ export default {
|
|
|
848
866
|
*/
|
|
849
867
|
stateClasses() {
|
|
850
868
|
return {
|
|
869
|
+
'vs--combobox': this.combobox,
|
|
851
870
|
'vs--open': this.dropdownOpen,
|
|
852
871
|
'vs--single': !this.multiple,
|
|
853
872
|
'vs--multiple': this.multiple,
|
|
@@ -874,6 +893,17 @@ export default {
|
|
|
874
893
|
dropdownOpen() {
|
|
875
894
|
return this.opened || this.dropdownShouldOpen(this);
|
|
876
895
|
},
|
|
896
|
+
/**
|
|
897
|
+
* Return the current state of the
|
|
898
|
+
* dropdown menu window
|
|
899
|
+
* @return {Boolean} True if open
|
|
900
|
+
*/
|
|
901
|
+
dropdownWindowOpen() {
|
|
902
|
+
if (this.combobox && !this.options.length) {
|
|
903
|
+
return false;
|
|
904
|
+
}
|
|
905
|
+
return this.dropdownOpen;
|
|
906
|
+
},
|
|
877
907
|
/**
|
|
878
908
|
* Return the placeholder string if it's set
|
|
879
909
|
* & there is no value selected.
|
|
@@ -959,6 +989,9 @@ export default {
|
|
|
959
989
|
if (this.isTrackingValues) {
|
|
960
990
|
this.setInternalValueFromOptions(val)
|
|
961
991
|
}
|
|
992
|
+
if (this.combobox) {
|
|
993
|
+
this.searchString = this.findOptionFromReducedValue(val) || '';
|
|
994
|
+
}
|
|
962
995
|
},
|
|
963
996
|
},
|
|
964
997
|
/**
|
|
@@ -998,7 +1031,7 @@ export default {
|
|
|
998
1031
|
this.findOptionFromReducedValue(val)
|
|
999
1032
|
)
|
|
1000
1033
|
} else {
|
|
1001
|
-
this.$data._value = this.findOptionFromReducedValue(value)
|
|
1034
|
+
this.$data._value = this.findOptionFromReducedValue(value);
|
|
1002
1035
|
}
|
|
1003
1036
|
},
|
|
1004
1037
|
/**
|
|
@@ -1057,8 +1090,8 @@ export default {
|
|
|
1057
1090
|
this.open = !this.open
|
|
1058
1091
|
this.searchEl.blur()
|
|
1059
1092
|
}
|
|
1060
|
-
if (this.clearSearchOnSelect) {
|
|
1061
|
-
this.search = ''
|
|
1093
|
+
if (this.clearSearchOnSelect && !this.combobox) {
|
|
1094
|
+
this.search = '';
|
|
1062
1095
|
}
|
|
1063
1096
|
},
|
|
1064
1097
|
/**
|