Skip to content

Commit 0d810df

Browse files
committed
Vehicle Selection finalization
1 parent df3cdcb commit 0d810df

File tree

6 files changed

+878
-5
lines changed

6 files changed

+878
-5
lines changed

src/main/java/gwt/material/design/addins/client/combobox/MaterialComboBox.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public class MaterialComboBox<T> extends AbstractValueWidget<List<T>> implements
104104
private Label label = new Label();
105105
private MaterialLabel errorLabel = new MaterialLabel();
106106
protected MaterialWidget listbox = new MaterialWidget(Document.get().createSelectElement());
107-
private KeyFactory<T, String> keyFactory = Object::toString;
107+
private KeyFactory<T, String> keyFactory = new AllowBlankKeyFactory<>();
108108
private JsComboBoxOptions options = JsComboBoxOptions.create();
109109

110110
private StatusTextMixin<AbstractValueWidget, MaterialLabel> statusTextMixin;

src/main/java/gwt/material/design/addins/client/countup/MaterialCountUp.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ public Double getValue() {
124124
return getEndValue();
125125
}
126126

127+
@Override
128+
public void setValue(Double value) {
129+
setValue(value, false);
130+
}
131+
127132
@Override
128133
public void setValue(Double value, boolean fireEvents) {
129134
setValue(value, fireEvents, true);

src/main/java/gwt/material/design/addins/client/inputmask/MaterialDateInputMask.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,18 @@ public Date getValue() {
3939
return dateInputParser.parseDate(format);
4040
}
4141

42+
@Override
43+
public void setMask(String mask) {
44+
this.format = mask;
45+
parseFormatToMask(mask);
46+
}
47+
4248
protected void parseFormatToMask(String format) {
4349
String dateFormatMask = format.toLowerCase()
4450
.replace("m", "0")
4551
.replace("d", "0")
4652
.replace("y", "0");
47-
setMask(dateFormatMask);
53+
super.setMask(dateFormatMask);
4854
}
4955

5056
public String getFormat() {

src/main/java/gwt/material/design/addins/client/inputmask/base/DateInputParser.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ public Date parseDate(String format) {
4343
protected boolean isValid(String format) {
4444
if (valuebox.getText() != null && !valuebox.getText().isEmpty()
4545
&& valuebox.getMask() != null && format != null) {
46+
format = format.toLowerCase();
4647
String dateString = valuebox.getText();
47-
String month = dateString.substring(format.indexOf("M"), format.indexOf("M/") + 1);
48-
String day = dateString.substring(format.indexOf("d"), format.indexOf("d/") + 1);
48+
String month = dateString.substring(format.indexOf("m"), format.indexOf("m") + 2);
49+
String day = dateString.substring(format.indexOf("d"), format.indexOf("d") + 2);
4950
String year = dateString.substring(format.indexOf("y"), format.lastIndexOf("y") + 1);
5051

5152
boolean validLeapYear = validateLeapYear(day, month, Integer.parseInt(year));

src/main/resources/gwt/material/design/addins/client/combobox/resources/css/select2.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@
8888
display: block
8989
}
9090

91+
.select2-results__option {
92+
padding: 1rem;
93+
min-height: 52px;
94+
}
95+
9196
.select2-results__options {
9297
list-style: none;
9398
margin: 0;

0 commit comments

Comments
 (0)