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 */ 020 021package gwt.material.design.client.js; 022 023import com.google.gwt.core.client.JsDate; 024import com.google.gwt.dom.client.Element; 025import gwt.material.design.jquery.client.api.Functions; 026import gwt.material.design.jquery.client.api.JQueryElement; 027import jsinterop.annotations.JsMethod; 028import jsinterop.annotations.JsPackage; 029import jsinterop.annotations.JsProperty; 030import jsinterop.annotations.JsType; 031 032/** 033 * JSInterop utils for Materialize component 034 * 035 * @author kevzlou7979 036 */ 037@JsType(isNative = true, namespace = JsPackage.GLOBAL) 038public class JsMaterialElement extends JQueryElement { 039 040 @JsMethod(name = "$", namespace = JsPackage.GLOBAL) 041 public static native JsMaterialElement $(JQueryElement element); 042 043 @JsMethod(name = "$", namespace = JsPackage.GLOBAL) 044 public static native JsMaterialElement $(Element element); 045 046 @JsMethod(name = "$", namespace = JsPackage.GLOBAL) 047 public static native JsMaterialElement $(String selector); 048 049 /** 050 * Collapsible Component 051 */ 052 @JsMethod 053 public native JQueryElement collapsible(boolean accordion); 054 055 /** 056 * Tabs Component 057 */ 058 @JsMethod 059 public native JQueryElement tabs(); 060 061 @JsMethod 062 public native JQueryElement tabs(String method, String id); 063 064 /** 065 * Dropdown Component 066 */ 067 @JsMethod 068 public native JQueryElement dropdown(JsDropdownOptions options); 069 070 @JsMethod 071 public native JQueryElement dropdown(String actions); 072 073 /** 074 * FAB - Floating Action Component 075 */ 076 @JsMethod 077 public native JQueryElement openFAB(); 078 079 @JsMethod 080 public native JQueryElement closeFAB(); 081 082 /** 083 * Modal component 084 */ 085 @JsMethod 086 public native JQueryElement openModal(JsModalOptions options); 087 088 @JsMethod 089 public native JQueryElement closeModal(JsModalOptions options); 090 091 /** 092 * Parallax Component 093 */ 094 @JsMethod 095 public native JQueryElement parallax(); 096 097 /** 098 * Tooltip Component 099 */ 100 @JsMethod 101 public native JQueryElement tooltip(String command); 102 103 @JsMethod 104 public native JQueryElement tooltip(JsTooltipOptions options); 105 106 /** 107 * Slider Component 108 */ 109 @JsMethod 110 public native JQueryElement slider(JsSliderOptions options); 111 112 @JsMethod 113 public native JQueryElement slider(String action); 114 115 /** 116 * Scrollspy Component 117 */ 118 @JsMethod 119 public native JQueryElement scrollSpy(); 120 121 /** 122 * Image Component 123 */ 124 @JsMethod 125 public native JQueryElement materialbox(); 126 127 /** 128 * Listbox Component 129 */ 130 @JsMethod 131 public native JQueryElement material_select(); 132 133 @JsMethod 134 public native JQueryElement material_select(Functions.Func callback); 135 136 @JsMethod 137 public native JQueryElement material_select(String action); 138 139 /** 140 * Pushpin Component 141 */ 142 @JsMethod 143 public native JQueryElement pushpin(JsPushpinOptions options); 144 145 /** 146 * Sidenav Component 147 */ 148 @JsMethod 149 public native JQueryElement sideNav(JsSideNavOptions options); 150 151 @JsMethod 152 public native JQueryElement sideNav(String action); 153 154 /** 155 * Date Picker Component 156 */ 157 @JsMethod 158 public native JsMaterialElement pickadate(String picker); 159 160 @JsMethod 161 public native JsMaterialElement pickadate(JsDatePickerOptions property); 162 163 @JsMethod 164 public native JsMaterialElement set(String key, Object value); 165 166 @JsMethod 167 public native JsMaterialElement on(String action, Functions.Func1<Thing> thing); 168 169 @JsMethod 170 public native JsMaterialElement set(String key, Object value, Functions.Func function); 171 172 @JsMethod 173 public native JsMaterialElement get(String key); 174 175 @JsProperty(name = "$root") 176 public JsMaterialElement root; 177 178 @JsProperty 179 public JsDate obj; 180 181 @JsMethod 182 public native JsMaterialElement stop(); 183 184 @JsMethod 185 public native JsMaterialElement start(); 186 187 @JsMethod 188 public native void clear(); 189 190 @JsMethod 191 public native JsMaterialElement off(JsDatePickerOptions options); 192 193 @JsMethod 194 public native JsMaterialElement off(String action); 195 196 @JsMethod 197 public native JsMaterialElement on(JsDatePickerOptions options); 198 199 @JsMethod 200 public native JsMaterialElement render(boolean value); 201 202 @JsMethod 203 public native void open(); 204 205 @JsMethod 206 public native void close(); 207 208 /** 209 * Dismissable CollectionItem Component 210 */ 211 @JsMethod(namespace = JsPackage.GLOBAL) 212 public static native void initDismissableCollection(); 213 214 /** 215 * Navbar Component 216 */ 217 @JsMethod(namespace = JsPackage.GLOBAL) 218 public static native void initShrink(Element element, int duration); 219 220 /** 221 * Animation Component 222 */ 223 @JsMethod(namespace = JsPackage.GLOBAL) 224 public static native void closeGrid(Object selector); 225 226 @JsMethod(namespace = JsPackage.GLOBAL) 227 public static native void showGrid(Object selector); 228 229 @JsMethod(namespace = "Materialize") 230 public static native double fadeInImage(Object selector); 231 232 @JsMethod(namespace = "Materialize") 233 public static native double showStaggeredList(Object selector); 234 235 @JsMethod(namespace = "Waves") 236 public static native void displayEffect(); 237 238 /** 239 * Toast Component 240 */ 241 @JsMethod(namespace = "Materialize") 242 public static native double toast(String message, int duration, String classname, Functions.Func callback); 243 244 /** 245 * Character Component 246 */ 247 @JsMethod 248 public native JsMaterialElement characterCounter(); 249}