mirror of
https://github.com/material-components/material-web.git
synced 2026-01-09 07:21:09 +08:00
update components to mdc 0.40
This commit is contained in:
parent
fa91c7fcc5
commit
f8c2c15802
@ -15,8 +15,8 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import {BaseElement} from './base-element.js';
|
||||
export * from './base-element.js';
|
||||
import {BaseElement} from './base-element';
|
||||
export * from './base-element';
|
||||
|
||||
export abstract class FormElement extends BaseElement {
|
||||
/**
|
||||
|
||||
@ -14,7 +14,7 @@ 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.
|
||||
*/
|
||||
import {PropertyValues} from '@polymer/lit-element/lib/updating-element.js';
|
||||
import {PropertyValues} from '@polymer/lit-element/lib/updating-element';
|
||||
|
||||
export interface Observer {
|
||||
(value: any, old: any): void;
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"author": "",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@material/button": "^0.39.3",
|
||||
"@material/button": "^0.40.0",
|
||||
"@material/mwc-base": "^0.2.0",
|
||||
"@material/mwc-icon": "^0.2.0",
|
||||
"@material/mwc-ripple": "^0.2.0",
|
||||
|
||||
@ -14,11 +14,11 @@ 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.
|
||||
*/
|
||||
import {LitElement, html, property, customElement} from '@polymer/lit-element/lit-element.js';
|
||||
import {classMap} from 'lit-html/directives/classMap.js';
|
||||
import {LitElement, html, property, customElement} from '@polymer/lit-element';
|
||||
import {classMap} from 'lit-html/directives/classMap';
|
||||
import {style} from './mwc-button-css';
|
||||
import {ripple} from '@material/mwc-ripple/ripple-directive.js';
|
||||
import '@material/mwc-icon/mwc-icon-font.js';
|
||||
import {ripple} from '@material/mwc-ripple/ripple-directive';
|
||||
import '@material/mwc-icon/mwc-icon-font';
|
||||
|
||||
@customElement('mwc-button' as any)
|
||||
export class Button extends LitElement {
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"author": "",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@material/checkbox": "^0.39.3",
|
||||
"@material/checkbox": "^0.40.0",
|
||||
"@material/mwc-base": "^0.2.0",
|
||||
"@polymer/lit-element": "^0.6.1"
|
||||
},
|
||||
|
||||
@ -14,7 +14,7 @@ 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.
|
||||
*/
|
||||
import {html, FormElement, customElement, property, query, Foundation, Adapter, observer} from '@material/mwc-base/form-element';
|
||||
import {html, FormElement, customElement, property, query, Foundation, Adapter} from '@material/mwc-base/form-element';
|
||||
import {style} from './mwc-checkbox-css';
|
||||
import MDCCheckboxFoundation from '@material/checkbox/foundation';
|
||||
|
||||
@ -47,18 +47,12 @@ export class Checkbox extends FormElement {
|
||||
formElement!: HTMLInputElement;
|
||||
|
||||
@property({type: Boolean})
|
||||
@observer(function(this: Checkbox, value: boolean) {
|
||||
this.mdcFoundation.setChecked(value);
|
||||
})
|
||||
checked = false;
|
||||
|
||||
@property({type: Boolean})
|
||||
indeterminate = false;
|
||||
|
||||
@property({type: Boolean})
|
||||
@observer(function(this: Checkbox, value: boolean) {
|
||||
this.mdcFoundation.setDisabled(value);
|
||||
})
|
||||
disabled = false;
|
||||
|
||||
@property({type: String})
|
||||
@ -111,9 +105,9 @@ export class Checkbox extends FormElement {
|
||||
}
|
||||
|
||||
private _changeHandler = () => {
|
||||
this.mdcFoundation.handleChange();
|
||||
this.checked = this.formElement.checked;
|
||||
this.indeterminate = this.formElement.indeterminate;
|
||||
this.mdcFoundation.handleChange();
|
||||
}
|
||||
|
||||
private _animationEndHandler = () => {
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@material/mwc-base": "^0.2",
|
||||
"@material/drawer": "^0.39.3",
|
||||
"@material/drawer": "^0.40.0",
|
||||
"@polymer/lit-element": "^0.6.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@ -15,10 +15,10 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
import {BaseElement, html, property, observer, query, customElement, Adapter, Foundation, PropertyValues} from '@material/mwc-base/base-element';
|
||||
import {classMap} from 'lit-html/directives/classMap.js';
|
||||
import MDCModalDrawerFoundation from '@material/drawer/modal/foundation.js';
|
||||
import MDCDismissibleDrawerFoundation from '@material/drawer/dismissible/foundation.js';
|
||||
import {strings} from '@material/drawer/constants.js';
|
||||
import {classMap} from 'lit-html/directives/classMap';
|
||||
import MDCModalDrawerFoundation from '@material/drawer/modal/foundation';
|
||||
import MDCDismissibleDrawerFoundation from '@material/drawer/dismissible/foundation';
|
||||
import {strings} from '@material/drawer/constants';
|
||||
import {style} from './mwc-drawer-css';
|
||||
|
||||
// TODO(dfreedm): Remove when typescript implements this interface (3.1)
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"author": "",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@material/fab": "^0.35.0",
|
||||
"@material/fab": "^0.40.0",
|
||||
"@material/mwc-base": "^0.2.0",
|
||||
"@material/mwc-icon": "^0.2.0",
|
||||
"@material/mwc-ripple": "^0.2.0",
|
||||
|
||||
@ -14,11 +14,11 @@ 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.
|
||||
*/
|
||||
import {LitElement, html, property, customElement} from '@polymer/lit-element/lit-element.js';
|
||||
import {classMap} from 'lit-html/directives/classMap.js';
|
||||
import {LitElement, html, property, customElement} from '@polymer/lit-element/lit-element';
|
||||
import {classMap} from 'lit-html/directives/classMap';
|
||||
import {style} from './mwc-fab-css';
|
||||
import {ripple} from '@material/mwc-ripple/ripple-directive.js';
|
||||
import '@material/mwc-icon/mwc-icon-font.js';
|
||||
import {ripple} from '@material/mwc-ripple/ripple-directive';
|
||||
import '@material/mwc-icon/mwc-icon-font';
|
||||
|
||||
@customElement('mwc-fab' as any)
|
||||
export class Fab extends LitElement {
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
"dependencies": {
|
||||
"@material/mwc-base": "^0.2.0",
|
||||
"@material/mwc-ripple": "^0.2.0",
|
||||
"@material/radio": "^0.39.3",
|
||||
"@material/radio": "^0.40.0",
|
||||
"@polymer/lit-element": "^0.6.1"
|
||||
},
|
||||
"devDependencies": {},
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@material/mwc-base": "^0.2.0",
|
||||
"@material/ripple": "^0.39.3",
|
||||
"@material/ripple": "^0.40.0",
|
||||
"@polymer/lit-element": "^0.6.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@ -14,9 +14,9 @@ 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.
|
||||
*/
|
||||
import {LitElement, html, property, customElement} from '@polymer/lit-element/lit-element.js';
|
||||
import {classMap} from 'lit-html/directives/classMap.js';
|
||||
import {ripple, RippleOptions} from './ripple-directive.js';
|
||||
import {LitElement, html, property, customElement} from '@polymer/lit-element';
|
||||
import {classMap} from 'lit-html/directives/classMap';
|
||||
import {ripple, RippleOptions} from './ripple-directive';
|
||||
import {style} from './mwc-ripple-css';
|
||||
|
||||
@customElement('mwc-ripple' as any)
|
||||
|
||||
@ -14,11 +14,11 @@ 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.
|
||||
*/
|
||||
import {directive, PropertyPart, noChange, NodePart, templateFactory} from 'lit-html/lit-html.js';
|
||||
import {Adapter, Foundation} from '@material/mwc-base/base-element';;
|
||||
import MDCRippleFoundation from '@material/ripple/foundation.js';
|
||||
import {style} from '@material/mwc-ripple/mwc-ripple-global-css.js';
|
||||
import * as util from '@material/ripple/util.js';
|
||||
import {directive, PropertyPart, noChange, NodePart, templateFactory} from 'lit-html';
|
||||
import {Adapter, Foundation} from '@material/mwc-base/base-element';
|
||||
import MDCRippleFoundation from '@material/ripple/foundation';
|
||||
import {style} from './mwc-ripple-global-css';
|
||||
import * as util from '@material/ripple/util';
|
||||
|
||||
const MATCHES = util.getMatchesProperty(HTMLElement.prototype);
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@material/mwc-base": "^0.2.0",
|
||||
"@material/switch": "^0.39.3",
|
||||
"@material/switch": "^0.40.0",
|
||||
"@polymer/lit-element": "^0.6.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
"@material/mwc-base": "^0.2.0",
|
||||
"@material/mwc-tab-scroller": "^0.2.0",
|
||||
"@material/mwc-tab": "^0.2.0",
|
||||
"@material/tab-bar": "^0.39.3",
|
||||
"@material/tab-bar": "^0.40.0",
|
||||
"@polymer/lit-element": "^0.6.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@ -15,14 +15,14 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
import {BaseElement, html, property, observer, query, customElement, Adapter, Foundation} from '@material/mwc-base/base-element';
|
||||
import {Tab} from '@material/mwc-tab/mwc-tab.js';
|
||||
import {TabScroller} from '@material/mwc-tab-scroller/mwc-tab-scroller.js';
|
||||
import {Tab} from '@material/mwc-tab/mwc-tab';
|
||||
import {TabScroller} from '@material/mwc-tab-scroller';
|
||||
|
||||
// Make TypeScript not remove the imports.
|
||||
import '@material/mwc-tab/mwc-tab.js';
|
||||
import '@material/mwc-tab-scroller/mwc-tab-scroller.js';
|
||||
import '@material/mwc-tab';
|
||||
import '@material/mwc-tab-scroller';
|
||||
|
||||
import MDCTabBarFoundation from '@material/tab-bar/foundation.js';
|
||||
import MDCTabBarFoundation from '@material/tab-bar/foundation';
|
||||
import {style} from './mwc-tab-bar-css';
|
||||
|
||||
declare global {
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@material/mwc-base": "^0.2.0",
|
||||
"@material/tab-indicator": "^0.39.3",
|
||||
"@material/tab-indicator": "^0.40.0",
|
||||
"@polymer/lit-element": "^0.6.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@ -15,9 +15,9 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
import {BaseElement, html, property, query, customElement, Adapter, Foundation, PropertyValues} from '@material/mwc-base/base-element';
|
||||
import {classMap} from 'lit-html/directives/classMap.js';
|
||||
import MDCSlidingTabIndicatorFoundation from '@material/tab-indicator/sliding-foundation.js';
|
||||
import MDCFadingTabIndicatorFoundation from '@material/tab-indicator/fading-foundation.js';
|
||||
import {classMap} from 'lit-html/directives/classMap';
|
||||
import MDCSlidingTabIndicatorFoundation from '@material/tab-indicator/sliding-foundation';
|
||||
import MDCFadingTabIndicatorFoundation from '@material/tab-indicator/fading-foundation';
|
||||
import {style} from './mwc-tab-indicator-css';
|
||||
|
||||
declare global {
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@material/mwc-base": "^0.2",
|
||||
"@material/tab-scroller": "^0.39.3",
|
||||
"@material/tab-scroller": "^0.40.0",
|
||||
"@polymer/lit-element": "^0.6.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@ -15,9 +15,9 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
import {BaseElement, html, query, customElement, Adapter, Foundation} from '@material/mwc-base/base-element';
|
||||
import MDCTabScrollerFoundation from '@material/tab-scroller/foundation.js';
|
||||
import * as util from '@material/tab-scroller/util.js';
|
||||
import {style} from './mwc-tab-scroller-css.js';
|
||||
import MDCTabScrollerFoundation from '@material/tab-scroller/foundation';
|
||||
import * as util from '@material/tab-scroller/util';
|
||||
import {style} from './mwc-tab-scroller-css';
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
"@material/mwc-ripple": "^0.2.0",
|
||||
"@material/mwc-icon": "^0.2.0",
|
||||
"@material/mwc-tab-indicator": "^0.2.0",
|
||||
"@material/tab": "^0.39.3",
|
||||
"@material/tab": "^0.40.0",
|
||||
"@polymer/lit-element": "^0.6.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@ -15,14 +15,14 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
import {BaseElement, html, property, query, customElement, Adapter, Foundation} from '@material/mwc-base/base-element';
|
||||
import {TabIndicator} from '@material/mwc-tab-indicator/mwc-tab-indicator.js';
|
||||
import {TabIndicator} from '@material/mwc-tab-indicator';
|
||||
|
||||
// Make TypeScript not remove the import.
|
||||
import '@material/mwc-tab-indicator/mwc-tab-indicator.js';
|
||||
import '@material/mwc-tab-indicator';
|
||||
|
||||
import {classMap} from 'lit-html/directives/classMap.js';
|
||||
import {ripple} from '@material/mwc-ripple/ripple-directive.js';
|
||||
import MDCTabFoundation from '@material/tab/foundation.js';
|
||||
import {classMap} from 'lit-html/directives/classMap';
|
||||
import {ripple} from '@material/mwc-ripple/ripple-directive';
|
||||
import MDCTabFoundation from '@material/tab/foundation';
|
||||
import {style} from './mwc-tab-css';
|
||||
|
||||
declare global {
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@material/mwc-base": "^0.2",
|
||||
"@material/top-app-bar": "^0.39.3",
|
||||
"@material/top-app-bar": "^0.40.0",
|
||||
"@polymer/lit-element": "^0.6.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@ -15,11 +15,11 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
import {BaseElement, html, property, query, customElement, Adapter, Foundation, PropertyValues} from '@material/mwc-base/base-element';
|
||||
import {classMap} from 'lit-html/directives/classMap.js';
|
||||
import MDCTopAppBarFoundation from '@material/top-app-bar/standard/foundation.js';
|
||||
import MDCShortTopAppBarFoundation from '@material/top-app-bar/short/foundation.js';
|
||||
import MDCFixedTopAppBarFoundation from '@material/top-app-bar/fixed/foundation.js';
|
||||
import {strings} from '@material/top-app-bar/constants.js';
|
||||
import {classMap} from 'lit-html/directives/classMap';
|
||||
import MDCTopAppBarFoundation from '@material/top-app-bar/standard/foundation';
|
||||
import MDCShortTopAppBarFoundation from '@material/top-app-bar/short/foundation';
|
||||
import MDCFixedTopAppBarFoundation from '@material/top-app-bar/fixed/foundation';
|
||||
import {strings} from '@material/top-app-bar/constants';
|
||||
import {style} from './mwc-top-app-bar-css';
|
||||
|
||||
declare global {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user