-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(cherry picked from commit 43b3ac1)
- Loading branch information
Matt Goo
authored and
Kenneth G. Franqueiro
committed
Aug 13, 2018
1 parent
5459dab
commit 3b20de8
Showing
6 changed files
with
263 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
/** | ||
* @license | ||
* Copyright 2018 Google Inc. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/* eslint no-unused-vars: [2, {"args": "none"}] */ | ||
|
||
/** | ||
* Adapter for MDC Select. Provides an interface for managing | ||
* - classes | ||
* - dom | ||
* - event handlers | ||
* | ||
* Additionally, provides type information for the adapter to the Closure | ||
* compiler. | ||
* | ||
* Implement this adapter for your framework of choice to delegate updates to | ||
* the component in your framework of choice. See architecture documentation | ||
* for more details. | ||
* https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md | ||
* | ||
* @record | ||
*/ | ||
|
||
class MDCSelectAdapter { | ||
/** | ||
* Adds class to root element. | ||
* @param {string} className | ||
*/ | ||
addClass(className) {} | ||
|
||
/** | ||
* Removes a class from the root element. | ||
* @param {string} className | ||
*/ | ||
removeClass(className) {} | ||
|
||
/** | ||
* Returns true if the root element contains the given class name. | ||
* @param {string} className | ||
* @return {boolean} | ||
*/ | ||
hasClass(className) {} | ||
|
||
/** | ||
* Activates the bottom line, showing a focused state. | ||
*/ | ||
activateBottomLine() {} | ||
|
||
/** | ||
* Deactivates the bottom line. | ||
*/ | ||
deactivateBottomLine() {} | ||
|
||
/** | ||
* Returns the selected value of the select element. | ||
* @return {string} | ||
*/ | ||
getValue() {} | ||
|
||
/** | ||
* Returns true if the direction of the root element is set to RTL. | ||
* @return {boolean} | ||
*/ | ||
isRtl() {} | ||
|
||
/** | ||
* Returns true if label element exists, false if it doesn't. | ||
* @return {boolean} | ||
*/ | ||
hasLabel() {} | ||
|
||
/** | ||
* Floats label determined based off of the shouldFloat argument. | ||
* @param {boolean} shouldFloat | ||
*/ | ||
floatLabel(shouldFloat) {} | ||
|
||
/** | ||
* Returns width of label in pixels, if the label exists. | ||
* @return {number} | ||
*/ | ||
getLabelWidth() {} | ||
|
||
/** | ||
* Returns true if outline element exists, false if it doesn't. | ||
* @return {boolean} | ||
*/ | ||
hasOutline() {} | ||
|
||
/** | ||
* Updates SVG Path and outline element based on the | ||
* label element width and RTL context, if the outline exists. | ||
* @param {number} labelWidth | ||
* @param {boolean=} isRtl | ||
*/ | ||
notchOutline(labelWidth, isRtl) {} | ||
|
||
/** | ||
* Closes notch in outline element, if the outline exists. | ||
*/ | ||
closeOutline() {} | ||
} | ||
|
||
export default MDCSelectAdapter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.