001/* 002 * #%L 003 * GwtMaterial 004 * %% 005 * Copyright (C) 2015 - 2017 GwtMaterialDesign 006 * %% 007 * Licensed under the Apache License, Version 2.0 (the "License"); 008 * you may not use this file except in compliance with the License. 009 * You may obtain a copy of the License at 010 * 011 * http://www.apache.org/licenses/LICENSE-2.0 012 * 013 * Unless required by applicable law or agreed to in writing, software 014 * distributed under the License is distributed on an "AS IS" BASIS, 015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 016 * See the License for the specific language governing permissions and 017 * limitations under the License. 018 * #L% 019 */ 020package gwt.material.design.addins.client.combobox.js; 021 022import gwt.material.design.jquery.client.api.JQueryElement; 023import jsinterop.annotations.JsOverlay; 024import jsinterop.annotations.JsPackage; 025import jsinterop.annotations.JsProperty; 026import jsinterop.annotations.JsType; 027 028import static gwt.material.design.addins.client.combobox.js.JsComboBox.$; 029 030/** 031 * Options for combobox component 032 * 033 * @author kevzlou7979 034 */ 035@JsType(isNative = true, name = "Object", namespace = JsPackage.GLOBAL) 036public class JsComboBoxOptions { 037 038 private JsComboBoxOptions() {} 039 040 @JsOverlay 041 public static final JsComboBoxOptions create() { 042 JsComboBoxOptions options = new JsComboBoxOptions(); 043 options.dropdownParent = $("body"); 044 options.closeOnSelect = true; 045 return options; 046 } 047 048 @JsProperty 049 public String placeholder; 050 051 @JsProperty 052 public JQueryElement dropdownParent; 053 054 @JsProperty 055 public boolean allowClear; 056 057 @JsProperty 058 public int maximumSelectionLength; 059 060 @JsProperty 061 public String minimumResultsForSearch; 062 063 @JsProperty 064 public boolean closeOnSelect; 065 066 @JsProperty 067 public boolean tags; 068 069 @JsProperty 070 public LanguageOptions language; 071}