mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add types for @material group at tag v0.26.0 (#23179)
This commit is contained in:
parent
1f0e148136
commit
fc02b40ffc
64
types/material-components-web/index.d.ts
vendored
Normal file
64
types/material-components-web/index.d.ts
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
// Type definitions for Material Components Web 0.26
|
||||
// Project: https://material.io/components/
|
||||
// Definitions by: Brent Douglas <https://github.com/BrentDouglas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import autoInit from 'material__auto-init';
|
||||
import * as base from 'material__base';
|
||||
import * as checkbox from 'material__checkbox';
|
||||
import * as dialog from 'material__dialog';
|
||||
import * as drawer from 'material__drawer';
|
||||
import * as formField from 'material__form-field';
|
||||
import * as gridList from 'material__grid-list';
|
||||
import * as iconToggle from 'material__icon-toggle';
|
||||
import * as linearProgress from 'material__linear-progress';
|
||||
import * as menu from 'material__menu';
|
||||
import * as radio from 'material__radio';
|
||||
import * as ripple from 'material__ripple';
|
||||
import * as select from 'material__select';
|
||||
import * as selectionControl from 'material__selection-control';
|
||||
import * as slider from 'material__slider';
|
||||
import * as snackbar from 'material__snackbar';
|
||||
import * as tabs from 'material__tabs';
|
||||
import * as textField from 'material__textfield';
|
||||
import * as toolbar from 'material__toolbar';
|
||||
|
||||
// Export all components.
|
||||
export {
|
||||
autoInit,
|
||||
base,
|
||||
checkbox,
|
||||
dialog,
|
||||
drawer,
|
||||
formField,
|
||||
gridList,
|
||||
iconToggle,
|
||||
linearProgress,
|
||||
menu,
|
||||
radio,
|
||||
ripple,
|
||||
select,
|
||||
selectionControl,
|
||||
slider,
|
||||
snackbar,
|
||||
tabs,
|
||||
textField,
|
||||
toolbar,
|
||||
};
|
||||
23
types/material-components-web/tsconfig.json
Normal file
23
types/material-components-web/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"files": [
|
||||
"index.d.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
1
types/material-components-web/tslint.json
Normal file
1
types/material-components-web/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
27
types/material__animation/index.d.ts
vendored
Normal file
27
types/material__animation/index.d.ts
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// Type definitions for Material Components Web 0.26
|
||||
// Project: https://material.io/components/
|
||||
// Definitions by: Brent Douglas <https://github.com/BrentDouglas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
export const transformStyleProperties: string[];
|
||||
|
||||
export function getCorrectEventName(windowObj: Window, eventType: string): string;
|
||||
|
||||
export function getCorrectPropertyName(windowObj: Window, eventType: string): string;
|
||||
24
types/material__animation/tsconfig.json
Normal file
24
types/material__animation/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"files": [
|
||||
"index.d.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
1
types/material__animation/tslint.json
Normal file
1
types/material__animation/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
37
types/material__auto-init/index.d.ts
vendored
Normal file
37
types/material__auto-init/index.d.ts
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
// Type definitions for Material Components Web 0.26
|
||||
// Project: https://material.io/components/
|
||||
// Definitions by: Brent Douglas <https://github.com/BrentDouglas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
export type MDCLogger = (message?: any, ...optionalParams: any[]) => void;
|
||||
|
||||
export interface MDCAutoInit {
|
||||
(root?: Document, warn?: MDCLogger): MDCAutoInit;
|
||||
register(componentName: string, Ctor: (...args: any[]) => any, warn?: MDCLogger): void;
|
||||
deregister(componentName: string): void;
|
||||
deregisterAll(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Auto-initializes all mdc components on a page.
|
||||
*/
|
||||
declare const mdcAutoInit: MDCAutoInit;
|
||||
|
||||
export default mdcAutoInit;
|
||||
24
types/material__auto-init/tsconfig.json
Normal file
24
types/material__auto-init/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"files": [
|
||||
"index.d.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
1
types/material__auto-init/tslint.json
Normal file
1
types/material__auto-init/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
63
types/material__base/component.d.ts
vendored
Normal file
63
types/material__base/component.d.ts
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 Google Inc.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
import MDCFoundation from './foundation';
|
||||
|
||||
export class MDCComponent<A, F extends MDCFoundation<A>> {
|
||||
static attachTo(root: Element): MDCComponent<any, MDCFoundation<any>>;
|
||||
|
||||
constructor(root: Element, foundation?: F, ...args: any[]);
|
||||
|
||||
// Subclasses can override this to do any additional setup work that would be considered part of a
|
||||
// "constructor". Essentially, it is a hook into the parent constructor before the foundation is
|
||||
// initialized. Any additional arguments besides root and foundation will be passed in here.
|
||||
initialize(...args: any[]): void;
|
||||
|
||||
// Subclasses must override this method to return a properly configured foundation class for the
|
||||
// component.
|
||||
getDefaultFoundation(): F;
|
||||
|
||||
// Subclasses should override this method if they need to perform work to synchronize with a host DOM
|
||||
// object. An example of this would be a form control wrapper that needs to synchronize its internal state
|
||||
// to some property or attribute of the host DOM. Please note: this is *not* the place to perform DOM
|
||||
// reads/writes that would cause layout / paint, as this is called synchronously from within the constructor.
|
||||
initialSyncWithDOM(): void;
|
||||
|
||||
// Subclasses may implement this method to release any resources / deregister any listeners they have
|
||||
// attached. An example of this might be deregistering a resize event from the window object.
|
||||
destroy(): void;
|
||||
|
||||
/**
|
||||
* Wrapper method to add an event listener to the component's root element. This is most useful when
|
||||
* listening for custom events.
|
||||
*/
|
||||
listen(evtType: string, handler: EventListenerOrEventListenerObject): void;
|
||||
|
||||
/**
|
||||
* Wrapper method to remove an event listener to the component's root element. This is most useful when
|
||||
* unlistening for custom events.
|
||||
*/
|
||||
unlisten(evtType: string, handler: EventListenerOrEventListenerObject): void;
|
||||
|
||||
/**
|
||||
* Fires a cross-browser-compatible custom event from the component root of the given type,
|
||||
* with the given data.
|
||||
*/
|
||||
emit(evtType: string, evtData: any, shouldBubble?: boolean): void;
|
||||
}
|
||||
|
||||
export default MDCComponent;
|
||||
44
types/material__base/foundation.d.ts
vendored
Normal file
44
types/material__base/foundation.d.ts
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 Google Inc.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
export interface MDCStrings {
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
export interface MDCNumbers {
|
||||
[key: string]: number;
|
||||
}
|
||||
|
||||
export class MDCFoundation<A> {
|
||||
static readonly cssClasses: MDCStrings;
|
||||
|
||||
static readonly strings: MDCStrings;
|
||||
|
||||
static readonly numbers: MDCNumbers;
|
||||
|
||||
static readonly defaultAdapter: any;
|
||||
|
||||
constructor(adapter: A);
|
||||
|
||||
// Subclasses should override this method to perform initialization routines (registering events, etc.)
|
||||
init(): void;
|
||||
|
||||
// Subclasses should override this method to perform de-initialization routines (de-registering events, etc.)
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
export default MDCFoundation;
|
||||
27
types/material__base/index.d.ts
vendored
Normal file
27
types/material__base/index.d.ts
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// Type definitions for Material Components Web 0.26
|
||||
// Project: https://material.io/components/
|
||||
// Definitions by: Brent Douglas <https://github.com/BrentDouglas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 Google Inc.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
import { MDCNumbers, MDCStrings, MDCFoundation } from './foundation';
|
||||
import MDCComponent from './component';
|
||||
|
||||
export {MDCNumbers, MDCStrings, MDCFoundation, MDCComponent};
|
||||
26
types/material__base/tsconfig.json
Normal file
26
types/material__base/tsconfig.json
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"files": [
|
||||
"component.d.ts",
|
||||
"index.d.ts",
|
||||
"foundation.d.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
1
types/material__base/tslint.json
Normal file
1
types/material__base/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
54
types/material__checkbox/adapter.d.ts
vendored
Normal file
54
types/material__checkbox/adapter.d.ts
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import { MDCSelectionControlState } from 'material__selection-control';
|
||||
|
||||
/**
|
||||
* Adapter for MDC Checkbox. 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/architecture.md
|
||||
*/
|
||||
export class MDCCheckboxAdapter {
|
||||
addClass(className: string): void;
|
||||
|
||||
removeClass(className: string): void;
|
||||
|
||||
registerAnimationEndHandler(handler: EventListener): void;
|
||||
|
||||
deregisterAnimationEndHandler(handler: EventListener): void;
|
||||
|
||||
registerChangeHandler(handler: EventListener): void;
|
||||
|
||||
deregisterChangeHandler(handler: EventListener): void;
|
||||
|
||||
getNativeControl(): MDCSelectionControlState;
|
||||
|
||||
forceLayout(): void;
|
||||
|
||||
isAttachedToDOM(): boolean;
|
||||
}
|
||||
|
||||
export default MDCCheckboxAdapter;
|
||||
42
types/material__checkbox/constants.d.ts
vendored
Normal file
42
types/material__checkbox/constants.d.ts
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
import { MDCStrings, MDCNumbers } from 'material__base';
|
||||
|
||||
export interface cssClasses extends MDCStrings {
|
||||
UPGRADED: 'mdc-checkbox--upgraded';
|
||||
CHECKED: 'mdc-checkbox--checked';
|
||||
INDETERMINATE: 'mdc-checkbox--indeterminate';
|
||||
DISABLED: 'mdc-checkbox--disabled';
|
||||
ANIM_UNCHECKED_CHECKED: 'mdc-checkbox--anim-unchecked-checked';
|
||||
ANIM_UNCHECKED_INDETERMINATE: 'mdc-checkbox--anim-unchecked-indeterminate';
|
||||
ANIM_CHECKED_UNCHECKED: 'mdc-checkbox--anim-checked-unchecked';
|
||||
ANIM_CHECKED_INDETERMINATE: 'mdc-checkbox--anim-checked-indeterminate';
|
||||
ANIM_INDETERMINATE_CHECKED: 'mdc-checkbox--anim-indeterminate-checked';
|
||||
ANIM_INDETERMINATE_UNCHECKED: 'mdc-checkbox--anim-indeterminate-unchecked';
|
||||
}
|
||||
|
||||
export interface strings extends MDCStrings {
|
||||
NATIVE_CONTROL_SELECTOR: '.mdc-checkbox__native-control';
|
||||
TRANSITION_STATE_INIT: 'init';
|
||||
TRANSITION_STATE_CHECKED: 'checked';
|
||||
TRANSITION_STATE_UNCHECKED: 'unchecked';
|
||||
TRANSITION_STATE_INDETERMINATE: 'indeterminate';
|
||||
}
|
||||
|
||||
export interface numbers extends MDCNumbers {
|
||||
ANIM_END_LATCH_MS: 100;
|
||||
}
|
||||
48
types/material__checkbox/foundation.d.ts
vendored
Normal file
48
types/material__checkbox/foundation.d.ts
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import MDCFoundation from 'material__base/foundation';
|
||||
import MDCCheckboxAdapter from './adapter';
|
||||
import { cssClasses, strings, numbers } from './constants';
|
||||
|
||||
export class MDCCheckboxFoundation extends MDCFoundation<MDCCheckboxAdapter> {
|
||||
static readonly cssClasses: cssClasses;
|
||||
|
||||
static readonly strings: strings;
|
||||
|
||||
static readonly numbers: numbers;
|
||||
|
||||
static readonly defaultAdapter: MDCCheckboxAdapter;
|
||||
|
||||
isChecked(): boolean;
|
||||
|
||||
setChecked(checked: boolean): boolean;
|
||||
|
||||
isIndeterminate(): boolean;
|
||||
|
||||
setIndeterminate(indeterminate: boolean): void;
|
||||
|
||||
isDisabled(): boolean;
|
||||
|
||||
setDisabled(disabled: boolean): void;
|
||||
|
||||
getValue(): string;
|
||||
|
||||
setValue(value: string): void;
|
||||
}
|
||||
|
||||
export default MDCCheckboxFoundation;
|
||||
48
types/material__checkbox/index.d.ts
vendored
Normal file
48
types/material__checkbox/index.d.ts
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
// Type definitions for Material Components Web 0.26
|
||||
// Project: https://material.io/components/
|
||||
// Definitions by: Brent Douglas <https://github.com/BrentDouglas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import MDCComponent from 'material__base/component';
|
||||
import MDCCheckboxAdapter from './adapter';
|
||||
import { MDCSelectionControl } from 'material__selection-control';
|
||||
import MDCCheckboxFoundation from './foundation';
|
||||
import { MDCRipple } from 'material__ripple';
|
||||
|
||||
export {MDCCheckboxAdapter, MDCCheckboxFoundation};
|
||||
|
||||
export class MDCCheckbox extends MDCComponent<MDCCheckboxAdapter, MDCCheckboxFoundation> implements MDCSelectionControl {
|
||||
static attachTo(root: Element): MDCCheckbox;
|
||||
|
||||
getDefaultFoundation(): MDCCheckboxFoundation;
|
||||
|
||||
readonly ripple: MDCRipple;
|
||||
|
||||
checked: boolean;
|
||||
|
||||
indeterminate: boolean;
|
||||
|
||||
disabled: boolean;
|
||||
|
||||
value: string;
|
||||
|
||||
destroy(): void;
|
||||
}
|
||||
27
types/material__checkbox/tsconfig.json
Normal file
27
types/material__checkbox/tsconfig.json
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"files": [
|
||||
"constants.d.ts",
|
||||
"adapter.d.ts",
|
||||
"index.d.ts",
|
||||
"foundation.d.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
1
types/material__checkbox/tslint.json
Normal file
1
types/material__checkbox/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
55
types/material__dialog/adapter.d.ts
vendored
Normal file
55
types/material__dialog/adapter.d.ts
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
/**
|
||||
* Copyright 2017 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.
|
||||
*/
|
||||
|
||||
export interface MSDDialogAdapter {
|
||||
addClass(className: string): void;
|
||||
|
||||
removeClass(className: string): void;
|
||||
|
||||
addBodyClass(className: string): void;
|
||||
|
||||
removeBodyClass(className: string): void;
|
||||
|
||||
eventTargetHasClass(target: EventTarget, className: string): boolean;
|
||||
|
||||
registerInteractionHandler(evt: string, handler: EventListener): void;
|
||||
|
||||
deregisterInteractionHandler(evt: string, handler: EventListener): void;
|
||||
|
||||
registerSurfaceInteractionHandler(evt: string, handler: EventListener): void;
|
||||
|
||||
deregisterSurfaceInteractionHandler(evt: string, handler: EventListener): void;
|
||||
|
||||
registerDocumentKeydownHandler(handler: EventListener): void;
|
||||
|
||||
deregisterDocumentKeydownHandler(handler: EventListener): void;
|
||||
|
||||
registerTransitionEndHandler(handler: EventListener): void;
|
||||
|
||||
deregisterTransitionEndHandler(handler: EventListener): void;
|
||||
|
||||
notifyAccept(): void;
|
||||
|
||||
notifyCancel(): void;
|
||||
|
||||
trapFocusOnSurface(): void;
|
||||
|
||||
untrapFocusOnSurface(): void;
|
||||
|
||||
isDialog(el: Element): boolean;
|
||||
|
||||
layoutFooterRipples(): void;
|
||||
}
|
||||
35
types/material__dialog/constants.d.ts
vendored
Normal file
35
types/material__dialog/constants.d.ts
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import { MDCStrings } from 'material__base';
|
||||
|
||||
export interface cssClasses extends MDCStrings {
|
||||
ROOT: 'mdc-dialog';
|
||||
OPEN: 'mdc-dialog--open';
|
||||
ANIMATING: 'mdc-dialog--animating';
|
||||
BACKDROP: 'mdc-dialog__backdrop';
|
||||
SCROLL_LOCK: 'mdc-dialog-scroll-lock';
|
||||
ACCEPT_BTN: 'mdc-dialog__footer__button--accept';
|
||||
CANCEL_BTN: 'mdc-dialog__footer__button--cancel';
|
||||
}
|
||||
|
||||
export interface strings extends MDCStrings {
|
||||
OPEN_DIALOG_SELECTOR: '.mdc-dialog--open';
|
||||
DIALOG_SURFACE_SELECTOR: '.mdc-dialog__surface';
|
||||
ACCEPT_SELECTOR: '.mdc-dialog__footer__button--accept';
|
||||
ACCEPT_EVENT: 'MDCDialog:accept';
|
||||
CANCEL_EVENT: 'MDCDialog:cancel';
|
||||
}
|
||||
39
types/material__dialog/foundation.d.ts
vendored
Normal file
39
types/material__dialog/foundation.d.ts
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
/**
|
||||
* Copyright 2017 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.
|
||||
*/
|
||||
|
||||
import { MDCFoundation } from 'material__base';
|
||||
import { cssClasses, strings } from './constants';
|
||||
import { MSDDialogAdapter } from './adapter';
|
||||
|
||||
export class MDCDialogFoundation extends MDCFoundation<MSDDialogAdapter> {
|
||||
static readonly cssClasses: cssClasses;
|
||||
|
||||
static readonly strings: strings;
|
||||
|
||||
static readonly defaultAdapter: MSDDialogAdapter;
|
||||
|
||||
open(): void;
|
||||
|
||||
close(): void;
|
||||
|
||||
isOpen(): boolean;
|
||||
|
||||
accept(shouldNotify: boolean): void;
|
||||
|
||||
cancel(shouldNotify: boolean): void;
|
||||
}
|
||||
|
||||
export default MDCDialogFoundation;
|
||||
46
types/material__dialog/index.d.ts
vendored
Normal file
46
types/material__dialog/index.d.ts
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
// Type definitions for Material Components Web 0.26
|
||||
// Project: https://material.io/components/
|
||||
// Definitions by: Brent Douglas <https://github.com/BrentDouglas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/**
|
||||
* Copyright 2017 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.
|
||||
*/
|
||||
|
||||
import { MDCComponent } from 'material__base';
|
||||
import { MDCRipple } from 'material__ripple';
|
||||
|
||||
import MDCDialogFoundation from './foundation';
|
||||
import { MSDDialogAdapter } from './adapter';
|
||||
import * as util from './util';
|
||||
|
||||
export {MSDDialogAdapter, MDCDialogFoundation, util};
|
||||
|
||||
export class MDCDialog extends MDCComponent<MSDDialogAdapter, MDCDialogFoundation> {
|
||||
static attachTo(root: Element): MDCDialog;
|
||||
|
||||
readonly open: boolean;
|
||||
|
||||
initialize(): void;
|
||||
|
||||
destroy(): void;
|
||||
|
||||
show(): void;
|
||||
|
||||
close(): void;
|
||||
|
||||
getDefaultFoundation(): MDCDialogFoundation;
|
||||
}
|
||||
28
types/material__dialog/tsconfig.json
Normal file
28
types/material__dialog/tsconfig.json
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"files": [
|
||||
"constants.d.ts",
|
||||
"adapter.d.ts",
|
||||
"util.d.ts",
|
||||
"index.d.ts",
|
||||
"foundation.d.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
1
types/material__dialog/tslint.json
Normal file
1
types/material__dialog/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
19
types/material__dialog/util.d.ts
vendored
Normal file
19
types/material__dialog/util.d.ts
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
export type MDCFocusTrapFactory = (a: Element, b: {initialFocus: Element, clickOutsideDeactivates: boolean}) => any;
|
||||
|
||||
export function createFocusTrapInstance(surfaceEl: Element, acceptButtonEl: Element, focusTrapFactory?: MDCFocusTrapFactory): any;
|
||||
27
types/material__drawer/index.d.ts
vendored
Normal file
27
types/material__drawer/index.d.ts
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// Type definitions for Material Components Web 0.26
|
||||
// Project: https://material.io/components/
|
||||
// Definitions by: Brent Douglas <https://github.com/BrentDouglas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import * as util from './util';
|
||||
export {MDCSlidableDrawerAdapter} from './slidable';
|
||||
export {MDCTemporaryDrawer, MDCTemporaryDrawerFoundation} from './temporary';
|
||||
export {MDCPersistentDrawer, MDCPersistentDrawerFoundation} from './persistent';
|
||||
export {util};
|
||||
30
types/material__drawer/persistent/constants.d.ts
vendored
Normal file
30
types/material__drawer/persistent/constants.d.ts
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import { MDCStrings } from 'material__base';
|
||||
|
||||
export interface cssClasses extends MDCStrings {
|
||||
ROOT: 'mdc-persistent-drawer';
|
||||
OPEN: 'mdc-persistent-drawer--open';
|
||||
ANIMATING: 'mdc-persistent-drawer--animating';
|
||||
}
|
||||
|
||||
export interface strings extends MDCStrings {
|
||||
DRAWER_SELECTOR: '.mdc-persistent-drawer__drawer';
|
||||
FOCUSABLE_ELEMENTS: 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex], [contenteditable]';
|
||||
OPEN_EVENT: 'MDCPersistentDrawer:open';
|
||||
CLOSE_EVENT: 'MDCPersistentDrawer:close';
|
||||
}
|
||||
28
types/material__drawer/persistent/foundation.d.ts
vendored
Normal file
28
types/material__drawer/persistent/foundation.d.ts
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import { MDCSlidableDrawerAdapter, MDCSlidableDrawerFoundation } from '../slidable';
|
||||
import { cssClasses, strings } from './constants';
|
||||
|
||||
export class MDCPersistentDrawerFoundation extends MDCSlidableDrawerFoundation {
|
||||
static readonly cssClasses: cssClasses;
|
||||
|
||||
static readonly strings: strings;
|
||||
|
||||
static readonly defaultAdapter: MDCSlidableDrawerAdapter;
|
||||
}
|
||||
|
||||
export default MDCPersistentDrawerFoundation;
|
||||
33
types/material__drawer/persistent/index.d.ts
vendored
Normal file
33
types/material__drawer/persistent/index.d.ts
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import { MDCComponent } from 'material__base';
|
||||
import { MDCPersistentDrawerFoundation } from './foundation';
|
||||
import { MDCSlidableDrawerAdapter } from '../slidable';
|
||||
import * as util from '../util';
|
||||
|
||||
export {MDCSlidableDrawerAdapter, MDCPersistentDrawerFoundation, util};
|
||||
|
||||
export class MDCPersistentDrawer extends MDCComponent<MDCSlidableDrawerAdapter, MDCPersistentDrawerFoundation> {
|
||||
static attachTo(root: Element): MDCPersistentDrawer;
|
||||
|
||||
open: boolean;
|
||||
|
||||
// Return the drawer element inside the component.
|
||||
readonly drawer: Element | null;
|
||||
|
||||
getDefaultFoundation(): MDCPersistentDrawerFoundation;
|
||||
}
|
||||
59
types/material__drawer/slidable/adapter.d.ts
vendored
Normal file
59
types/material__drawer/slidable/adapter.d.ts
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
export interface MDCSlidableDrawerAdapter {
|
||||
addClass(className: string): void;
|
||||
|
||||
removeClass(className: string): void;
|
||||
|
||||
hasClass(className: string): void;
|
||||
|
||||
hasNecessaryDom(): boolean;
|
||||
|
||||
registerInteractionHandler(evt: string, handler: EventListener): void;
|
||||
|
||||
deregisterInteractionHandler(evt: string, handler: EventListener): void;
|
||||
|
||||
registerDrawerInteractionHandler(evt: string, handler: EventListener): void;
|
||||
|
||||
deregisterDrawerInteractionHandler(evt: string, handler: EventListener): void;
|
||||
|
||||
registerTransitionEndHandler(handler: EventListener): void;
|
||||
|
||||
deregisterTransitionEndHandler(handler: EventListener): void;
|
||||
|
||||
registerDocumentKeydownHandler(handler: EventListener): void;
|
||||
|
||||
deregisterDocumentKeydownHandler(handler: EventListener): void;
|
||||
|
||||
setTranslateX(value: number | null): void;
|
||||
|
||||
getFocusableElements(): NodeList;
|
||||
|
||||
saveElementTabState(el: Element): void;
|
||||
|
||||
restoreElementTabState(el: Element): void;
|
||||
|
||||
makeElementUntabbable(el: Element): void;
|
||||
|
||||
notifyOpen(): void;
|
||||
|
||||
notifyClose(): void;
|
||||
|
||||
isRtl(): boolean;
|
||||
|
||||
getDrawerWidth(): number;
|
||||
}
|
||||
17
types/material__drawer/slidable/constants.d.ts
vendored
Normal file
17
types/material__drawer/slidable/constants.d.ts
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
export const FOCUSABLE_ELEMENTS: string;
|
||||
30
types/material__drawer/slidable/foundation.d.ts
vendored
Normal file
30
types/material__drawer/slidable/foundation.d.ts
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import { MDCFoundation } from 'material__base';
|
||||
import { MDCSlidableDrawerAdapter } from './adapter';
|
||||
|
||||
export class MDCSlidableDrawerFoundation extends MDCFoundation<MDCSlidableDrawerAdapter> {
|
||||
static readonly defaultAdapter: MDCSlidableDrawerAdapter;
|
||||
|
||||
constructor(adapter: MDCSlidableDrawerAdapter, rootCssClass: string, animatingCssClass: string, openCssClass: string);
|
||||
|
||||
open(): void;
|
||||
|
||||
close(): void;
|
||||
|
||||
isOpen(): boolean;
|
||||
}
|
||||
19
types/material__drawer/slidable/index.d.ts
vendored
Normal file
19
types/material__drawer/slidable/index.d.ts
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
export {FOCUSABLE_ELEMENTS} from './constants';
|
||||
export {MDCSlidableDrawerFoundation} from './foundation';
|
||||
export {MDCSlidableDrawerAdapter} from './adapter';
|
||||
32
types/material__drawer/temporary/constants.d.ts
vendored
Normal file
32
types/material__drawer/temporary/constants.d.ts
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import { MDCStrings } from 'material__base';
|
||||
|
||||
export interface cssClasses extends MDCStrings {
|
||||
ROOT: 'mdc-temporary-drawer';
|
||||
OPEN: 'mdc-temporary-drawer--open';
|
||||
ANIMATING: 'mdc-temporary-drawer--animating';
|
||||
SCROLL_LOCK: 'mdc-drawer-scroll-lock';
|
||||
}
|
||||
|
||||
export interface strings extends MDCStrings {
|
||||
DRAWER_SELECTOR: '.mdc-temporary-drawer__drawer';
|
||||
OPACITY_VAR_NAME: '--mdc-temporary-drawer-opacity';
|
||||
FOCUSABLE_ELEMENTS: 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex], [contenteditable]';
|
||||
OPEN_EVENT: 'MDCTemporaryDrawer:open';
|
||||
CLOSE_EVENT: 'MDCTemporaryDrawer:close';
|
||||
}
|
||||
32
types/material__drawer/temporary/foundation.d.ts
vendored
Normal file
32
types/material__drawer/temporary/foundation.d.ts
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import { MDCSlidableDrawerFoundation, MDCSlidableDrawerAdapter } from '../slidable';
|
||||
import { cssClasses, strings } from './constants';
|
||||
|
||||
export class MDCTemporaryDrawerFoundation extends MDCSlidableDrawerFoundation {
|
||||
static readonly cssClasses: cssClasses;
|
||||
|
||||
static readonly strings: strings;
|
||||
|
||||
static readonly defaultAdapter: MDCSlidableDrawerAdapter;
|
||||
|
||||
open(): void;
|
||||
|
||||
close(): void;
|
||||
}
|
||||
|
||||
export default MDCTemporaryDrawerFoundation;
|
||||
33
types/material__drawer/temporary/index.d.ts
vendored
Normal file
33
types/material__drawer/temporary/index.d.ts
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import { MDCComponent } from 'material__base';
|
||||
import MDCTemporaryDrawerFoundation from './foundation';
|
||||
import { MDCSlidableDrawerAdapter } from '../slidable';
|
||||
import * as util from '../util';
|
||||
|
||||
export {MDCSlidableDrawerAdapter, MDCTemporaryDrawerFoundation, util};
|
||||
|
||||
export class MDCTemporaryDrawer extends MDCComponent<MDCSlidableDrawerAdapter, MDCTemporaryDrawerFoundation> {
|
||||
static attachTo(root: Element): MDCTemporaryDrawer;
|
||||
|
||||
open: boolean;
|
||||
|
||||
/* Return the drawer element inside the component. */
|
||||
readonly drawer: Element | null;
|
||||
|
||||
getDefaultFoundation(): MDCTemporaryDrawerFoundation;
|
||||
}
|
||||
35
types/material__drawer/tsconfig.json
Normal file
35
types/material__drawer/tsconfig.json
Normal file
@ -0,0 +1,35 @@
|
||||
{
|
||||
"files": [
|
||||
"persistent/constants.d.ts",
|
||||
"persistent/index.d.ts",
|
||||
"persistent/foundation.d.ts",
|
||||
"slidable/constants.d.ts",
|
||||
"slidable/adapter.d.ts",
|
||||
"slidable/index.d.ts",
|
||||
"slidable/foundation.d.ts",
|
||||
"temporary/constants.d.ts",
|
||||
"temporary/index.d.ts",
|
||||
"temporary/foundation.d.ts",
|
||||
"util.d.ts",
|
||||
"index.d.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
1
types/material__drawer/tslint.json
Normal file
1
types/material__drawer/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
33
types/material__drawer/util.d.ts
vendored
Normal file
33
types/material__drawer/util.d.ts
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
// Remap touch events to pointer events, if the browser doesn't support touch events.
|
||||
export function remapEvent(eventName: string, globalObj?: Window): string;
|
||||
|
||||
// Choose the correct transform property to use on the current browser.
|
||||
export function getTransformPropertyName(globalObj?: Window, forceRefresh?: boolean): string;
|
||||
|
||||
// Determine whether the current browser supports CSS properties.
|
||||
export function supportsCssCustomProperties(globalObj?: Window): boolean;
|
||||
|
||||
// Determine whether the current browser supports passive event listeners, and if so, use them.
|
||||
export function applyPassive(globalObj?: Window, forceRefresh?: boolean): boolean;
|
||||
|
||||
// Save the tab state for an element.
|
||||
export function saveElementTabState(el: Element): void;
|
||||
|
||||
// Restore the tab state for an element, if it was saved.
|
||||
export function restoreElementTabState(el: Element): void;
|
||||
43
types/material__form-field/adapter.d.ts
vendored
Normal file
43
types/material__form-field/adapter.d.ts
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Adapter for MDC Form Field. Provides an interface for managing
|
||||
* - event handlers
|
||||
* - ripple activation
|
||||
*
|
||||
* 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/architecture.md
|
||||
*
|
||||
* @record
|
||||
*/
|
||||
export class MDCFormFieldAdapter {
|
||||
registerInteractionHandler(type: string, handler: EventListener): void;
|
||||
|
||||
deregisterInteractionHandler(type: string, handler: EventListener): void;
|
||||
|
||||
activateInputRipple(): void;
|
||||
|
||||
deactivateInputRipple(): void;
|
||||
}
|
||||
|
||||
export default MDCFormFieldAdapter;
|
||||
26
types/material__form-field/constants.d.ts
vendored
Normal file
26
types/material__form-field/constants.d.ts
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 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.
|
||||
*/
|
||||
|
||||
import { MDCStrings } from 'material__base';
|
||||
|
||||
export interface cssClasses extends MDCStrings {
|
||||
ROOT: 'mdc-form-field';
|
||||
}
|
||||
|
||||
export interface strings extends MDCStrings {
|
||||
LABEL_SELECTOR: '.mdc-form-field > label';
|
||||
}
|
||||
30
types/material__form-field/foundation.d.ts
vendored
Normal file
30
types/material__form-field/foundation.d.ts
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 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.
|
||||
*/
|
||||
|
||||
import MDCFoundation from 'material__base/foundation';
|
||||
import MDCFormFieldAdapter from './adapter';
|
||||
import { cssClasses, strings } from './constants';
|
||||
|
||||
export class MDCFormFieldFoundation extends MDCFoundation<MDCFormFieldAdapter> {
|
||||
static readonly cssClasses: cssClasses;
|
||||
|
||||
static readonly strings: strings;
|
||||
|
||||
static readonly defaultAdapter: MDCFormFieldAdapter;
|
||||
}
|
||||
|
||||
export default MDCFormFieldFoundation;
|
||||
37
types/material__form-field/index.d.ts
vendored
Normal file
37
types/material__form-field/index.d.ts
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
// Type definitions for Material Components Web 0.26
|
||||
// Project: https://material.io/components/
|
||||
// Definitions by: Brent Douglas <https://github.com/BrentDouglas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 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.
|
||||
*/
|
||||
|
||||
import MDCComponent from 'material__base/component';
|
||||
import MDCFormFieldFoundation from './foundation';
|
||||
import MDCFormFieldAdapter from './adapter';
|
||||
import { MDCSelectionControl } from 'material__selection-control';
|
||||
|
||||
export {MDCFormFieldAdapter, MDCFormFieldFoundation};
|
||||
|
||||
export class MDCFormField extends MDCComponent<MDCFormFieldAdapter, MDCFormFieldFoundation> {
|
||||
static attachTo(root: Element): MDCFormField;
|
||||
|
||||
input: MDCSelectionControl;
|
||||
|
||||
getDefaultFoundation(): MDCFormFieldFoundation;
|
||||
}
|
||||
27
types/material__form-field/tsconfig.json
Normal file
27
types/material__form-field/tsconfig.json
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"files": [
|
||||
"constants.d.ts",
|
||||
"adapter.d.ts",
|
||||
"index.d.ts",
|
||||
"foundation.d.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
1
types/material__form-field/tslint.json
Normal file
1
types/material__form-field/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
29
types/material__grid-list/adapter.d.ts
vendored
Normal file
29
types/material__grid-list/adapter.d.ts
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
export interface MDCGridListAdapter {
|
||||
getOffsetWidth(): number;
|
||||
|
||||
getNumberOfTiles(): number;
|
||||
|
||||
getOffsetWidthForTileAtIndex(index: number): number;
|
||||
|
||||
setStyleForTilesElement(property: string, value: string): void;
|
||||
|
||||
registerResizeHandler(handler: EventListener): void;
|
||||
|
||||
deregisterResizeHandler(handler: EventListener): void;
|
||||
}
|
||||
22
types/material__grid-list/constants.d.ts
vendored
Normal file
22
types/material__grid-list/constants.d.ts
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import { MDCStrings } from 'material__base';
|
||||
|
||||
export interface strings extends MDCStrings {
|
||||
TILES_SELECTOR: '.mdc-grid-list__tiles';
|
||||
TILE_SELECTOR: '.mdc-grid-tile';
|
||||
}
|
||||
29
types/material__grid-list/foundation.d.ts
vendored
Normal file
29
types/material__grid-list/foundation.d.ts
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import { MDCFoundation } from 'material__base';
|
||||
import { strings } from './constants';
|
||||
import { MDCGridListAdapter } from './adapter';
|
||||
|
||||
export class MDCGridListFoundation extends MDCFoundation<MDCGridListAdapter> {
|
||||
static readonly strings: strings;
|
||||
|
||||
static readonly defaultAdapter: MDCGridListAdapter;
|
||||
|
||||
alignCenter(): void;
|
||||
}
|
||||
|
||||
export default MDCGridListFoundation;
|
||||
33
types/material__grid-list/index.d.ts
vendored
Normal file
33
types/material__grid-list/index.d.ts
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
// Type definitions for Material Components Web 0.26
|
||||
// Project: https://material.io/components/
|
||||
// Definitions by: Brent Douglas <https://github.com/BrentDouglas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import { MDCComponent } from 'material__base';
|
||||
import { MDCGridListAdapter } from './adapter';
|
||||
import MDCGridListFoundation from './foundation';
|
||||
|
||||
export {MDCGridListAdapter, MDCGridListFoundation};
|
||||
|
||||
export class MDCGridList extends MDCComponent<MDCGridListAdapter, MDCGridListFoundation> {
|
||||
static attachTo(root: Element): MDCGridList;
|
||||
|
||||
getDefaultFoundation(): MDCGridListFoundation;
|
||||
}
|
||||
27
types/material__grid-list/tsconfig.json
Normal file
27
types/material__grid-list/tsconfig.json
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"files": [
|
||||
"constants.d.ts",
|
||||
"adapter.d.ts",
|
||||
"index.d.ts",
|
||||
"foundation.d.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
1
types/material__grid-list/tslint.json
Normal file
1
types/material__grid-list/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
63
types/material__icon-toggle/adapter.d.ts
vendored
Normal file
63
types/material__icon-toggle/adapter.d.ts
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Adapter for MDC Icon Toggle. Provides an interface for managing
|
||||
* - classes
|
||||
* - dom
|
||||
* - inner text
|
||||
* - event handlers
|
||||
* - event dispatch
|
||||
*
|
||||
* 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/architecture.md
|
||||
*
|
||||
* @record
|
||||
*/
|
||||
|
||||
export class MDCIconToggleAdapter {
|
||||
addClass(className: string): void;
|
||||
|
||||
removeClass(className: string): void;
|
||||
|
||||
registerInteractionHandler(type: string, handler: EventListener): void;
|
||||
|
||||
deregisterInteractionHandler(type: string, handler: EventListener): void;
|
||||
|
||||
setText(text: string): void;
|
||||
|
||||
getTabIndex(): number;
|
||||
|
||||
setTabIndex(tabIndex: number): void;
|
||||
|
||||
getAttr(name: string): string;
|
||||
|
||||
setAttr(name: string, value: string): void;
|
||||
|
||||
rmAttr(name: string): void;
|
||||
|
||||
notifyChange(evtData: IconToggleEvent): void;
|
||||
}
|
||||
|
||||
export interface IconToggleEvent {
|
||||
isOn: boolean;
|
||||
}
|
||||
32
types/material__icon-toggle/constants.d.ts
vendored
Normal file
32
types/material__icon-toggle/constants.d.ts
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import { MDCStrings } from 'material__base';
|
||||
|
||||
export interface cssClasses extends MDCStrings {
|
||||
ROOT: 'mdc-icon-toggle';
|
||||
DISABLED: 'mdc-icon-toggle--disabled';
|
||||
}
|
||||
|
||||
export interface strings extends MDCStrings {
|
||||
DATA_TOGGLE_ON: 'data-toggle-on';
|
||||
DATA_TOGGLE_OFF: 'data-toggle-off';
|
||||
ARIA_PRESSED: 'aria-pressed';
|
||||
ARIA_DISABLED: 'aria-disabled';
|
||||
ARIA_LABEL: 'aria-label';
|
||||
CHANGE_EVENT: 'MDCIconToggle:change';
|
||||
}
|
||||
64
types/material__icon-toggle/foundation.d.ts
vendored
Normal file
64
types/material__icon-toggle/foundation.d.ts
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import MDCFoundation from 'material__base/foundation';
|
||||
import { MDCIconToggleAdapter, IconToggleEvent } from './adapter';
|
||||
import { cssClasses, strings } from './constants';
|
||||
|
||||
export class MDCIconToggleFoundation extends MDCFoundation<MDCIconToggleAdapter> {
|
||||
static readonly cssClasses: cssClasses;
|
||||
|
||||
static readonly strings: strings;
|
||||
|
||||
static readonly defaultAdapter: MDCIconToggleAdapter;
|
||||
|
||||
refreshToggleData(): void;
|
||||
|
||||
isOn(): boolean;
|
||||
|
||||
toggle(isOn?: boolean): void;
|
||||
|
||||
isDisabled(): boolean;
|
||||
|
||||
setDisabled(isDisabled: boolean): void;
|
||||
|
||||
isKeyboardActivated(): boolean;
|
||||
}
|
||||
|
||||
export interface KeyboardKey {
|
||||
key: string;
|
||||
keyCode: number;
|
||||
}
|
||||
|
||||
export function isSpace(keyboardKey: KeyboardKey): boolean;
|
||||
|
||||
export class IconToggleState {
|
||||
/**
|
||||
* The aria-label value of the icon toggle, or undefined if there is no aria-label.
|
||||
*/
|
||||
label: string|undefined;
|
||||
/**
|
||||
* The text for the icon toggle, or undefined if there is no text.
|
||||
*/
|
||||
content: string|undefined;
|
||||
/**
|
||||
* The CSS class to add to the icon toggle, or undefined if there is no CSS class.
|
||||
*/
|
||||
cssClass: string|undefined;
|
||||
}
|
||||
|
||||
export default MDCIconToggleFoundation;
|
||||
47
types/material__icon-toggle/index.d.ts
vendored
Normal file
47
types/material__icon-toggle/index.d.ts
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
// Type definitions for Material Components Web 0.26
|
||||
// Project: https://material.io/components/
|
||||
// Definitions by: Brent Douglas <https://github.com/BrentDouglas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import MDCComponent from 'material__base/component';
|
||||
import MDCIconToggleFoundation from './foundation';
|
||||
import { MDCIconToggleAdapter } from './adapter';
|
||||
import { MDCRipple, MDCRippleFoundation } from 'material__ripple';
|
||||
|
||||
export {MDCIconToggleAdapter, MDCIconToggleFoundation};
|
||||
|
||||
export class MDCIconToggle extends MDCComponent<MDCIconToggleAdapter, MDCIconToggleFoundation> {
|
||||
static attachTo(root: Element): MDCIconToggle;
|
||||
|
||||
destroy(): void;
|
||||
|
||||
getDefaultFoundation(): MDCIconToggleFoundation;
|
||||
|
||||
initialSyncWithDOM(): void;
|
||||
|
||||
readonly ripple: MDCRipple;
|
||||
|
||||
on: boolean;
|
||||
|
||||
disabled: boolean;
|
||||
|
||||
refreshToggleData(): void;
|
||||
}
|
||||
27
types/material__icon-toggle/tsconfig.json
Normal file
27
types/material__icon-toggle/tsconfig.json
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"files": [
|
||||
"constants.d.ts",
|
||||
"adapter.d.ts",
|
||||
"index.d.ts",
|
||||
"foundation.d.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
1
types/material__icon-toggle/tslint.json
Normal file
1
types/material__icon-toggle/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
29
types/material__linear-progress/adapter.d.ts
vendored
Normal file
29
types/material__linear-progress/adapter.d.ts
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Copyright 2017 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.
|
||||
*/
|
||||
|
||||
export interface MDCLinearProgressAdapter {
|
||||
addClass(className: string): void;
|
||||
|
||||
getPrimaryBar(): Element;
|
||||
|
||||
getBuffer(): Element;
|
||||
|
||||
hasClass(className: string): boolean;
|
||||
|
||||
removeClass(className: string): void;
|
||||
|
||||
setStyle(el: Element, styleProperty: string, value: number): void;
|
||||
}
|
||||
28
types/material__linear-progress/constants.d.ts
vendored
Normal file
28
types/material__linear-progress/constants.d.ts
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Copyright 2017 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.
|
||||
*/
|
||||
|
||||
import { MDCStrings } from 'material__base';
|
||||
|
||||
export interface cssClasses extends MDCStrings {
|
||||
CLOSED_CLASS: 'mdc-linear-progress--closed';
|
||||
INDETERMINATE_CLASS: 'mdc-linear-progress--indeterminate';
|
||||
REVERSED_CLASS: 'mdc-linear-progress--reversed';
|
||||
}
|
||||
|
||||
export interface strings extends MDCStrings {
|
||||
PRIMARY_BAR_SELECTOR: '.mdc-linear-progress__primary-bar';
|
||||
BUFFER_SELECTOR: '.mdc-linear-progress__buffer';
|
||||
}
|
||||
40
types/material__linear-progress/foundation.d.ts
vendored
Normal file
40
types/material__linear-progress/foundation.d.ts
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
/**
|
||||
* Copyright 2017 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.
|
||||
*/
|
||||
|
||||
import { MDCFoundation } from 'material__base';
|
||||
import { transformStyleProperties } from 'material__animation';
|
||||
import { MDCLinearProgressAdapter } from './adapter';
|
||||
import { cssClasses, strings } from './constants';
|
||||
|
||||
export class MDCLinearProgressFoundation extends MDCFoundation<MDCLinearProgressAdapter> {
|
||||
static readonly cssClasses: cssClasses;
|
||||
|
||||
static readonly strings: strings;
|
||||
|
||||
static readonly defaultAdapter: MDCLinearProgressAdapter;
|
||||
|
||||
setDeterminate(isDeterminate: boolean): void;
|
||||
|
||||
setProgress(value: number): void;
|
||||
|
||||
setBuffer(value: number): void;
|
||||
|
||||
setReverse(isReversed: boolean): void;
|
||||
|
||||
open(): void;
|
||||
|
||||
close(): void;
|
||||
}
|
||||
45
types/material__linear-progress/index.d.ts
vendored
Normal file
45
types/material__linear-progress/index.d.ts
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
// Type definitions for Material Components Web 0.26
|
||||
// Project: https://material.io/components/
|
||||
// Definitions by: Brent Douglas <https://github.com/BrentDouglas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/**
|
||||
* Copyright 2017 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.
|
||||
*/
|
||||
|
||||
import { MDCComponent } from 'material__base';
|
||||
import { MDCLinearProgressAdapter } from './adapter';
|
||||
import { MDCLinearProgressFoundation } from './foundation';
|
||||
|
||||
export {MDCLinearProgressAdapter, MDCLinearProgressFoundation};
|
||||
|
||||
export class MDCLinearProgress extends MDCComponent<MDCLinearProgressAdapter, MDCLinearProgressFoundation> {
|
||||
static attachTo(root: Element): MDCLinearProgress;
|
||||
|
||||
determinate: boolean;
|
||||
|
||||
progress: number;
|
||||
|
||||
buffer: number;
|
||||
|
||||
reverse: boolean;
|
||||
|
||||
open(): void;
|
||||
|
||||
close(): void;
|
||||
|
||||
getDefaultFoundation(): MDCLinearProgressFoundation;
|
||||
}
|
||||
27
types/material__linear-progress/tsconfig.json
Normal file
27
types/material__linear-progress/tsconfig.json
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"files": [
|
||||
"constants.d.ts",
|
||||
"adapter.d.ts",
|
||||
"index.d.ts",
|
||||
"foundation.d.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
1
types/material__linear-progress/tslint.json
Normal file
1
types/material__linear-progress/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
26
types/material__menu/index.d.ts
vendored
Normal file
26
types/material__menu/index.d.ts
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
// Type definitions for Material Components Web 0.26
|
||||
// Project: https://material.io/components/
|
||||
// Definitions by: Brent Douglas <https://github.com/BrentDouglas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import * as util from './util';
|
||||
import { MDCSimpleMenu, MDCSimpleMenuAdapter, MDCSimpleMenuFoundation } from './simple/index';
|
||||
export { MDCSimpleMenu, MDCSimpleMenuAdapter, MDCSimpleMenuFoundation, util };
|
||||
104
types/material__menu/simple/adapter.d.ts
vendored
Normal file
104
types/material__menu/simple/adapter.d.ts
vendored
Normal file
@ -0,0 +1,104 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Adapter for MDC Simple Menu. Provides an interface for managing
|
||||
* - classes
|
||||
* - dom
|
||||
* - focus
|
||||
* - position
|
||||
* - dimensions
|
||||
* - 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/architecture.md
|
||||
*
|
||||
* @record
|
||||
*/
|
||||
export default class MDCSimpleMenuAdapter {
|
||||
addClass(className: string): void;
|
||||
|
||||
removeClass(className: string): void;
|
||||
|
||||
hasClass(className: string): boolean;
|
||||
|
||||
hasNecessaryDom(): boolean;
|
||||
|
||||
getAttributeForEventTarget(target: EventTarget, attributeName: string): string;
|
||||
|
||||
getInnerDimensions(): {width: number, height: number};
|
||||
|
||||
hasAnchor(): boolean;
|
||||
|
||||
getAnchorDimensions(): {width: number, height: number, top: number, right: number, bottom: number, left: number};
|
||||
|
||||
getWindowDimensions(): {width: number, height: number};
|
||||
|
||||
setScale(x: number, y: number): void;
|
||||
|
||||
setInnerScale(x: number, y: number): void;
|
||||
|
||||
getNumberOfItems(): number;
|
||||
|
||||
registerInteractionHandler(type: string, handler: EventListener): void;
|
||||
|
||||
deregisterInteractionHandler(type: string, handler: EventListener): void;
|
||||
|
||||
registerBodyClickHandler(handler: EventListener): void;
|
||||
|
||||
deregisterBodyClickHandler(handler: EventListener): void;
|
||||
|
||||
getYParamsForItemAtIndex(index: number): {top: number, height: number};
|
||||
|
||||
setTransitionDelayForItemAtIndex(index: number, value: string|null): void;
|
||||
|
||||
getIndexForEventTarget(target: EventTarget): number;
|
||||
|
||||
notifySelected(evtData: {index: number}): void;
|
||||
|
||||
notifyCancel(): void;
|
||||
|
||||
saveFocus(): void;
|
||||
|
||||
restoreFocus(): void;
|
||||
|
||||
isFocused(): boolean;
|
||||
|
||||
focus(): void;
|
||||
|
||||
getFocusedItemIndex(): number;
|
||||
|
||||
focusItemAtIndex(index: number): void;
|
||||
|
||||
isRtl(): boolean;
|
||||
|
||||
setTransformOrigin(origin: string): void;
|
||||
|
||||
setPosition(position: {
|
||||
top: string|undefined,
|
||||
right: string|undefined,
|
||||
bottom: string|undefined,
|
||||
left: string|undefined
|
||||
}): void;
|
||||
|
||||
getAccurateTime(): number;
|
||||
}
|
||||
52
types/material__menu/simple/constants.d.ts
vendored
Normal file
52
types/material__menu/simple/constants.d.ts
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import { MDCStrings, MDCNumbers } from 'material__base';
|
||||
|
||||
export interface cssClasses extends MDCStrings {
|
||||
ROOT: 'mdc-simple-menu';
|
||||
OPEN: 'mdc-simple-menu--open';
|
||||
ANIMATING: 'mdc-simple-menu--animating';
|
||||
TOP_RIGHT: 'mdc-simple-menu--open-from-top-right';
|
||||
BOTTOM_LEFT: 'mdc-simple-menu--open-from-bottom-left';
|
||||
BOTTOM_RIGHT: 'mdc-simple-menu--open-from-bottom-right';
|
||||
}
|
||||
|
||||
export interface strings extends MDCStrings {
|
||||
ITEMS_SELECTOR: '.mdc-simple-menu__items';
|
||||
SELECTED_EVENT: 'MDCSimpleMenu:selected';
|
||||
CANCEL_EVENT: 'MDCSimpleMenu:cancel';
|
||||
ARIA_DISABLED_ATTR: 'aria-disabled';
|
||||
}
|
||||
|
||||
export interface numbers extends MDCNumbers {
|
||||
// Amount of time to wait before triggering a selected event on the menu. Note that this time
|
||||
// will most likely be bumped up once interactive lists are supported to allow for the ripple to
|
||||
// animate before closing the menu
|
||||
SELECTED_TRIGGER_DELAY: 50;
|
||||
// Total duration of the menu animation.
|
||||
TRANSITION_DURATION_MS: 300;
|
||||
// The menu starts its open animation with the X axis at this time value (0 - 1).
|
||||
TRANSITION_SCALE_ADJUSTMENT_X: 0.5;
|
||||
// The time value the menu waits until the animation starts on the Y axis (0 - 1).
|
||||
TRANSITION_SCALE_ADJUSTMENT_Y: 0.2;
|
||||
// The cubic bezier control points for the animation (cubic-bezier(0, 0, 0.2, 1)).
|
||||
TRANSITION_X1: 0;
|
||||
TRANSITION_Y1: 0;
|
||||
TRANSITION_X2: 0.2;
|
||||
TRANSITION_Y2: 1;
|
||||
}
|
||||
43
types/material__menu/simple/foundation.d.ts
vendored
Normal file
43
types/material__menu/simple/foundation.d.ts
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import MDCFoundation from 'material__base/foundation';
|
||||
import MDCSimpleMenuAdapter from './adapter';
|
||||
import { cssClasses, strings, numbers } from './constants';
|
||||
import { clamp, bezierProgress } from '../util';
|
||||
|
||||
export default class MDCSimpleMenuFoundation extends MDCFoundation<MDCSimpleMenuAdapter> {
|
||||
static readonly cssClasses: cssClasses;
|
||||
|
||||
static readonly strings: strings;
|
||||
|
||||
static readonly numbers: numbers;
|
||||
|
||||
static readonly defaultAdapter: MDCSimpleMenuAdapter;
|
||||
|
||||
/**
|
||||
* Open the menu.
|
||||
*/
|
||||
open(options?: {focusIndex?: number}): void;
|
||||
|
||||
/**
|
||||
* Closes the menu.
|
||||
*/
|
||||
close(evt?: Event): void;
|
||||
|
||||
isOpen(): boolean;
|
||||
}
|
||||
42
types/material__menu/simple/index.d.ts
vendored
Normal file
42
types/material__menu/simple/index.d.ts
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import MDCComponent from 'material__base/component';
|
||||
import MDCSimpleMenuFoundation from './foundation';
|
||||
import MDCSimpleMenuAdapter from './adapter';
|
||||
import { getTransformPropertyName } from '../util';
|
||||
|
||||
export {MDCSimpleMenuAdapter, MDCSimpleMenuFoundation};
|
||||
|
||||
export class MDCSimpleMenu extends MDCComponent<MDCSimpleMenuAdapter, MDCSimpleMenuFoundation> {
|
||||
static attachTo(root: Element): MDCSimpleMenu;
|
||||
|
||||
open: boolean;
|
||||
|
||||
show(options?: {focusIndex?: number}): void;
|
||||
|
||||
hide(): void;
|
||||
|
||||
/**
|
||||
* Return the items within the menu. Note that this only contains the set of elements within
|
||||
* the items container that are proper list items, and not supplemental / presentational DOM
|
||||
* elements.
|
||||
*/
|
||||
readonly items: Element[];
|
||||
|
||||
getDefaultFoundation(): MDCSimpleMenuFoundation;
|
||||
}
|
||||
29
types/material__menu/tsconfig.json
Normal file
29
types/material__menu/tsconfig.json
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"files": [
|
||||
"simple/constants.d.ts",
|
||||
"simple/adapter.d.ts",
|
||||
"simple/index.d.ts",
|
||||
"simple/foundation.d.ts",
|
||||
"util.d.ts",
|
||||
"index.d.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
1
types/material__menu/tslint.json
Normal file
1
types/material__menu/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
37
types/material__menu/util.d.ts
vendored
Normal file
37
types/material__menu/util.d.ts
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Returns the name of the correct transform property to use on the current browser.
|
||||
*/
|
||||
export function getTransformPropertyName(globalObj: Window, forceRefresh?: boolean): string|undefined;
|
||||
|
||||
/**
|
||||
* Clamps a value between the minimum and the maximum, returning the clamped value.
|
||||
*/
|
||||
export function clamp(value: number, min?: number, max?: number): number;
|
||||
|
||||
/**
|
||||
* Returns the easing value to apply at time t, for a given cubic bezier curve.
|
||||
* Control points P0 and P3 are assumed to be (0,0) and (1,1), respectively.
|
||||
* Parameters are as follows:
|
||||
* - time: The current time in the animation, scaled between 0 and 1.
|
||||
* - x1: The x value of control point P1.
|
||||
* - y1: The y value of control point P1.
|
||||
* - x2: The x value of control point P2.
|
||||
* - y2: The y value of control point P2.
|
||||
*/
|
||||
export function bezierProgress(time: number, x1: number, y1: number, x2: number, y2: number): number;
|
||||
40
types/material__radio/adapter.d.ts
vendored
Normal file
40
types/material__radio/adapter.d.ts
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import { MDCSelectionControlState } from 'material__selection-control';
|
||||
|
||||
/**
|
||||
* Adapter for MDC Radio. Provides an interface for managing
|
||||
* - classes
|
||||
* - dom
|
||||
*
|
||||
* 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/architecture.md
|
||||
*/
|
||||
export class MDCRadioAdapter {
|
||||
addClass(className: string): void;
|
||||
|
||||
removeClass(className: string): void;
|
||||
|
||||
getNativeControl(): MDCSelectionControlState;
|
||||
}
|
||||
|
||||
export default MDCRadioAdapter;
|
||||
26
types/material__radio/constants.d.ts
vendored
Normal file
26
types/material__radio/constants.d.ts
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import { MDCStrings } from 'material__base';
|
||||
|
||||
export interface strings extends MDCStrings {
|
||||
NATIVE_CONTROL_SELECTOR: '.mdc-radio__native-control';
|
||||
}
|
||||
|
||||
export interface cssClasses extends MDCStrings {
|
||||
ROOT: 'mdc-radio';
|
||||
DISABLED: 'mdc-radio--disabled';
|
||||
}
|
||||
42
types/material__radio/foundation.d.ts
vendored
Normal file
42
types/material__radio/foundation.d.ts
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import MDCFoundation from 'material__base/foundation';
|
||||
import { MDCSelectionControlState } from 'material__selection-control';
|
||||
import MDCRadioAdapter from './adapter';
|
||||
import { cssClasses, strings } from './constants';
|
||||
|
||||
export class MDCRadioFoundation extends MDCFoundation<MDCRadioAdapter> {
|
||||
static readonly cssClasses: cssClasses;
|
||||
|
||||
static readonly strings: strings;
|
||||
|
||||
static readonly defaultAdapter: MDCRadioAdapter;
|
||||
|
||||
isChecked(): boolean;
|
||||
|
||||
setChecked(checked: boolean): void;
|
||||
|
||||
isDisabled(): boolean;
|
||||
|
||||
setDisabled(disabled: boolean): void;
|
||||
|
||||
getValue(): string;
|
||||
|
||||
setValue(value?: string): void;
|
||||
}
|
||||
|
||||
export default MDCRadioFoundation;
|
||||
46
types/material__radio/index.d.ts
vendored
Normal file
46
types/material__radio/index.d.ts
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
// Type definitions for Material Components Web 0.26
|
||||
// Project: https://material.io/components/
|
||||
// Definitions by: Brent Douglas <https://github.com/BrentDouglas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import MDCComponent from 'material__base/component';
|
||||
import { MDCSelectionControl } from 'material__selection-control';
|
||||
import MDCRadioAdapter from './adapter';
|
||||
import MDCRadioFoundation from './foundation';
|
||||
import { MDCRipple, MDCRippleFoundation } from 'material__ripple';
|
||||
|
||||
export {MDCRadioAdapter, MDCRadioFoundation};
|
||||
|
||||
export class MDCRadio extends MDCComponent<MDCRadioAdapter, MDCRadioFoundation> implements MDCSelectionControl {
|
||||
static attachTo(root: Element): MDCRadio;
|
||||
|
||||
checked: boolean;
|
||||
|
||||
disabled: boolean;
|
||||
|
||||
value: string;
|
||||
|
||||
readonly ripple: MDCRipple;
|
||||
|
||||
destroy(): void;
|
||||
|
||||
getDefaultFoundation(): MDCRadioFoundation;
|
||||
}
|
||||
27
types/material__radio/tsconfig.json
Normal file
27
types/material__radio/tsconfig.json
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"files": [
|
||||
"constants.d.ts",
|
||||
"adapter.d.ts",
|
||||
"index.d.ts",
|
||||
"foundation.d.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
1
types/material__radio/tslint.json
Normal file
1
types/material__radio/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
65
types/material__ripple/adapter.d.ts
vendored
Normal file
65
types/material__ripple/adapter.d.ts
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Adapter for MDC Ripple. Provides an interface for managing
|
||||
* - classes
|
||||
* - dom
|
||||
* - CSS variables
|
||||
* - position
|
||||
* - dimensions
|
||||
* - scroll position
|
||||
* - event handlers
|
||||
* - unbounded, active and disabled states
|
||||
*
|
||||
* 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/architecture.md
|
||||
*
|
||||
* @record
|
||||
*/
|
||||
export default class MDCRippleAdapter {
|
||||
browserSupportsCssVars(): boolean;
|
||||
|
||||
isUnbounded(): boolean;
|
||||
|
||||
isSurfaceActive(): boolean;
|
||||
|
||||
isSurfaceDisabled(): boolean;
|
||||
|
||||
addClass(className: string): void;
|
||||
|
||||
removeClass(className: string): void;
|
||||
|
||||
registerInteractionHandler(evtType: string, handler: EventListener): void;
|
||||
|
||||
deregisterInteractionHandler(evtType: string, handler: EventListener): void;
|
||||
|
||||
registerResizeHandler(handler: EventListener): void;
|
||||
|
||||
deregisterResizeHandler(handler: EventListener): void;
|
||||
|
||||
updateCssVariable(varName: string, value: number|string): void;
|
||||
|
||||
computeBoundingRect(): ClientRect;
|
||||
|
||||
getWindowPageOffset(): {x: number, y: number};
|
||||
}
|
||||
46
types/material__ripple/constants.d.ts
vendored
Normal file
46
types/material__ripple/constants.d.ts
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import { MDCStrings, MDCNumbers } from 'material__base';
|
||||
|
||||
export interface cssClasses extends MDCStrings {
|
||||
// Ripple is a special case where the "root" component is really a "mixin" of sorts,
|
||||
// given that it's an 'upgrade' to an existing component. That being said it is the root
|
||||
// CSS class that all other CSS classes derive from.
|
||||
ROOT: 'mdc-ripple-upgraded';
|
||||
UNBOUNDED: 'mdc-ripple-upgraded--unbounded';
|
||||
BG_FOCUSED: 'mdc-ripple-upgraded--background-focused';
|
||||
BG_ACTIVE_FILL: 'mdc-ripple-upgraded--background-active-fill';
|
||||
FG_ACTIVATION: 'mdc-ripple-upgraded--foreground-activation';
|
||||
FG_DEACTIVATION: 'mdc-ripple-upgraded--foreground-deactivation';
|
||||
}
|
||||
|
||||
export interface strings extends MDCStrings {
|
||||
VAR_FG_SIZE: '--mdc-ripple-fg-size';
|
||||
VAR_LEFT: '--mdc-ripple-left';
|
||||
VAR_TOP: '--mdc-ripple-top';
|
||||
VAR_FG_SCALE: '--mdc-ripple-fg-scale';
|
||||
VAR_FG_TRANSLATE_START: '--mdc-ripple-fg-translate-start';
|
||||
VAR_FG_TRANSLATE_END: '--mdc-ripple-fg-translate-end';
|
||||
}
|
||||
|
||||
export interface numbers extends MDCNumbers {
|
||||
PADDING: 10;
|
||||
INITIAL_ORIGIN_SCALE: 0.6;
|
||||
DEACTIVATION_TIMEOUT_MS: 300;
|
||||
FG_DEACTIVATION_MS: 83;
|
||||
}
|
||||
69
types/material__ripple/foundation.d.ts
vendored
Normal file
69
types/material__ripple/foundation.d.ts
vendored
Normal file
@ -0,0 +1,69 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import MDCFoundation from 'material__base/foundation';
|
||||
import MDCRippleAdapter from './adapter';
|
||||
import { cssClasses, strings, numbers } from './constants';
|
||||
import { getNormalizedEventCoords } from './util';
|
||||
|
||||
export interface ActivationStateType {
|
||||
isActivated: boolean|undefined;
|
||||
hasDeactivationUXRun: boolean|undefined;
|
||||
wasActivatedByPointer: boolean|undefined;
|
||||
wasElementMadeActive: boolean|undefined;
|
||||
activationStartTime: number|undefined;
|
||||
activationEvent: Event;
|
||||
isProgrammatic: boolean|undefined;
|
||||
}
|
||||
|
||||
export interface ListenerInfoType {
|
||||
activate: string|undefined;
|
||||
deactivate: string|undefined;
|
||||
focus: string|undefined;
|
||||
blur: string|undefined;
|
||||
}
|
||||
|
||||
export interface ListenersType {
|
||||
activate(e: Event): void;
|
||||
|
||||
deactivate(e: Event): void;
|
||||
|
||||
focus(): void;
|
||||
|
||||
blur(): void;
|
||||
}
|
||||
|
||||
export interface PointType {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
export default class MDCRippleFoundation extends MDCFoundation<MDCRippleAdapter> {
|
||||
static readonly cssClasses: cssClasses;
|
||||
|
||||
static readonly strings: strings;
|
||||
|
||||
static readonly numbers: numbers;
|
||||
|
||||
static readonly defaultAdapter: MDCRippleAdapter;
|
||||
|
||||
activate(event?: Event): void;
|
||||
|
||||
deactivate(event?: Event): void;
|
||||
|
||||
layout(): void;
|
||||
}
|
||||
66
types/material__ripple/index.d.ts
vendored
Normal file
66
types/material__ripple/index.d.ts
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
// Type definitions for Material Components Web 0.26
|
||||
// Project: https://material.io/components/
|
||||
// Definitions by: Brent Douglas <https://github.com/BrentDouglas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import MDCComponent from 'material__base/component';
|
||||
import MDCRippleAdapter from './adapter';
|
||||
import MDCRippleFoundation from './foundation';
|
||||
import * as util from './util';
|
||||
|
||||
export {MDCRippleAdapter, MDCRippleFoundation, util};
|
||||
|
||||
export class MDCRipple extends MDCComponent<MDCRippleAdapter, MDCRippleFoundation> {
|
||||
static attachTo(root: Element, bound?: {isUnbounded: boolean|undefined}): MDCRipple;
|
||||
|
||||
static createAdapter(instance: RippleCapableSurface): MDCRippleAdapter;
|
||||
|
||||
unbounded: boolean;
|
||||
|
||||
activate(): void;
|
||||
|
||||
deactivate(): void;
|
||||
|
||||
layout(): void;
|
||||
|
||||
getDefaultFoundation(): MDCRippleFoundation;
|
||||
|
||||
initialSyncWithDOM(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* See Material Design spec for more details on when to use ripples.
|
||||
* https://material.io/guidelines/motion/choreography.html#choreography-creation
|
||||
* @record
|
||||
*/
|
||||
export class RippleCapableSurface {
|
||||
protected root_: Element;
|
||||
|
||||
/**
|
||||
* Whether or not the ripple bleeds out of the bounds of the element.
|
||||
*/
|
||||
unbounded: boolean|undefined;
|
||||
|
||||
/**
|
||||
* Whether or not the ripple is attached to a disabled component.
|
||||
*/
|
||||
disabled: boolean|undefined;
|
||||
}
|
||||
28
types/material__ripple/tsconfig.json
Normal file
28
types/material__ripple/tsconfig.json
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"files": [
|
||||
"constants.d.ts",
|
||||
"adapter.d.ts",
|
||||
"util.d.ts",
|
||||
"index.d.ts",
|
||||
"foundation.d.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
1
types/material__ripple/tslint.json
Normal file
1
types/material__ripple/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
27
types/material__ripple/util.d.ts
vendored
Normal file
27
types/material__ripple/util.d.ts
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
export function supportsCssVariables(windowObj: Window, forceRefresh?: boolean): boolean|undefined;
|
||||
|
||||
/**
|
||||
* Determine whether the current browser supports passive event listeners, and if so, use them.
|
||||
*/
|
||||
export function applyPassive(globalObj?: Window, forceRefresh?: boolean): boolean|{passive: boolean};
|
||||
|
||||
export function getMatchesProperty(HTMLElementPrototype: object): string[];
|
||||
|
||||
export function getNormalizedEventCoords(ev: Event, pageOffset: {x: number, y: number}, clientRect: ClientRect): {x: number, y: number};
|
||||
81
types/material__select/adapter.d.ts
vendored
Normal file
81
types/material__select/adapter.d.ts
vendored
Normal file
@ -0,0 +1,81 @@
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
export interface MDCSelectAdapter {
|
||||
addClass(className: string): void;
|
||||
|
||||
removeClass(className: string): void;
|
||||
|
||||
addBodyClass(className: string): void;
|
||||
|
||||
removeBodyClass(className: string): void;
|
||||
|
||||
setAttr(attr: string, value: string): void;
|
||||
|
||||
rmAttr(attr: string): void;
|
||||
|
||||
computeBoundingRect(): {left: number, top: number};
|
||||
|
||||
registerInteractionHandler(type: string, handler: EventListener): void;
|
||||
|
||||
deregisterInteractionHandler(type: string, handler: EventListener): void;
|
||||
|
||||
focus(): void;
|
||||
|
||||
makeTabbable(): void;
|
||||
|
||||
makeUntabbable(): void;
|
||||
|
||||
getComputedStyleValue(propertyName: string): string;
|
||||
|
||||
setStyle(propertyName: string, value: string): void;
|
||||
|
||||
create2dRenderingContext(): {font: string, measureText: (val: string) => {width: number}};
|
||||
|
||||
setMenuElStyle(propertyName: string, value: string): void;
|
||||
|
||||
setMenuElAttr(attr: string, value: string): void;
|
||||
|
||||
rmMenuElAttr(attr: string): void;
|
||||
|
||||
getMenuElOffsetHeight(): number;
|
||||
|
||||
openMenu(focusIndex: number): void;
|
||||
|
||||
isMenuOpen(): boolean;
|
||||
|
||||
setSelectedTextContent(textContent: string): void;
|
||||
|
||||
getNumberOfOptions(): number;
|
||||
|
||||
getTextForOptionAtIndex(index: number): string;
|
||||
|
||||
getValueForOptionAtIndex(index: number): string;
|
||||
|
||||
setAttrForOptionAtIndex(index: number, attr: string, value: string): void;
|
||||
|
||||
rmAttrForOptionAtIndex(index: number, attr: string): void;
|
||||
|
||||
getOffsetTopForOptionAtIndex(index: number): number;
|
||||
|
||||
registerMenuInteractionHandler(type: string, handler: EventListener): void;
|
||||
|
||||
deregisterMenuInteractionHandler(type: string, handler: EventListener): void;
|
||||
|
||||
notifyChange(): void;
|
||||
|
||||
getWindowInnerHeight(): number;
|
||||
}
|
||||
28
types/material__select/constants.d.ts
vendored
Normal file
28
types/material__select/constants.d.ts
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import { MDCStrings } from 'material__base';
|
||||
|
||||
export interface cssClasses extends MDCStrings {
|
||||
ROOT: 'mdc-select';
|
||||
OPEN: 'mdc-select--open';
|
||||
DISABLED: 'mdc-select--disabled';
|
||||
SCROLL_LOCK: 'mdc-select-scroll-lock';
|
||||
}
|
||||
|
||||
export interface strings extends MDCStrings {
|
||||
CHANGE_EVENT: 'MDCSelect:change';
|
||||
}
|
||||
40
types/material__select/foundation.d.ts
vendored
Normal file
40
types/material__select/foundation.d.ts
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import { MDCFoundation } from 'material__base';
|
||||
import { cssClasses, strings } from './constants';
|
||||
import { MDCSimpleMenuFoundation } from 'material__menu';
|
||||
import { MDCSelectAdapter } from './adapter';
|
||||
|
||||
export default class MDCSelectFoundation extends MDCFoundation<MDCSelectAdapter> {
|
||||
static readonly cssClasses: cssClasses;
|
||||
|
||||
static readonly strings: strings;
|
||||
|
||||
static readonly defaultAdapter: MDCSelectAdapter;
|
||||
|
||||
getValue(): string;
|
||||
|
||||
getSelectedIndex(): number;
|
||||
|
||||
setSelectedIndex(index: number): void;
|
||||
|
||||
isDisabled(): boolean;
|
||||
|
||||
setDisabled(disabled: boolean): void;
|
||||
|
||||
resize(): void;
|
||||
}
|
||||
53
types/material__select/index.d.ts
vendored
Normal file
53
types/material__select/index.d.ts
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
// Type definitions for Material Components Web 0.26
|
||||
// Project: https://material.io/components/
|
||||
// Definitions by: Brent Douglas <https://github.com/BrentDouglas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/**
|
||||
* Copyright 2016 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.
|
||||
*/
|
||||
|
||||
import { MDCComponent } from 'material__base';
|
||||
import { MDCSimpleMenu } from 'material__menu';
|
||||
|
||||
import { MDCSelectAdapter } from './adapter';
|
||||
import MDCSelectFoundation from './foundation';
|
||||
|
||||
export {MDCSelectAdapter, MDCSelectFoundation};
|
||||
|
||||
export class MDCSelect extends MDCComponent<MDCSelectAdapter, MDCSelectFoundation> {
|
||||
static attachTo(root: Element): MDCSelect;
|
||||
|
||||
readonly value: string;
|
||||
|
||||
readonly options: Element[];
|
||||
|
||||
readonly selectedOptions: NodeListOf<Element>;
|
||||
|
||||
selectedIndex: number;
|
||||
|
||||
disabled: boolean;
|
||||
|
||||
item(index: number): Element|null;
|
||||
|
||||
nameditem(key: string): Element|null;
|
||||
|
||||
initialize(menuFactory?: (el: Element) => MDCSimpleMenu): void;
|
||||
|
||||
getDefaultFoundation(): MDCSelectFoundation;
|
||||
|
||||
initialSyncWithDOM(): void;
|
||||
}
|
||||
27
types/material__select/tsconfig.json
Normal file
27
types/material__select/tsconfig.json
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"files": [
|
||||
"constants.d.ts",
|
||||
"adapter.d.ts",
|
||||
"index.d.ts",
|
||||
"foundation.d.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
1
types/material__select/tslint.json
Normal file
1
types/material__select/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
35
types/material__selection-control/index.d.ts
vendored
Normal file
35
types/material__selection-control/index.d.ts
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
// Type definitions for Material Components Web 0.26
|
||||
// Project: https://material.io/components/
|
||||
// Definitions by: Brent Douglas <https://github.com/BrentDouglas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2017 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.
|
||||
*/
|
||||
|
||||
import { MDCRipple } from 'material__ripple';
|
||||
|
||||
export interface MDCSelectionControlState {
|
||||
checked: boolean;
|
||||
indeterminate: boolean;
|
||||
disabled: boolean;
|
||||
value?: string;
|
||||
}
|
||||
|
||||
export class MDCSelectionControl {
|
||||
readonly ripple: MDCRipple;
|
||||
}
|
||||
24
types/material__selection-control/tsconfig.json
Normal file
24
types/material__selection-control/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"files": [
|
||||
"index.d.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
1
types/material__selection-control/tslint.json
Normal file
1
types/material__selection-control/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
67
types/material__slider/adapter.d.ts
vendored
Normal file
67
types/material__slider/adapter.d.ts
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
/**
|
||||
* Copyright 2017 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.
|
||||
*/
|
||||
|
||||
export interface MDCSliderAdapter {
|
||||
hasClass(className: string): boolean;
|
||||
|
||||
addClass(className: string): void;
|
||||
|
||||
removeClass(className: string): void;
|
||||
|
||||
getAttribute(name: string): string|null;
|
||||
|
||||
setAttribute(name: string, value: string): void;
|
||||
|
||||
removeAttribute(name: string): void;
|
||||
|
||||
computeBoundingRect(): ClientRect;
|
||||
|
||||
getTabIndex(): number;
|
||||
|
||||
registerInteractionHandler(type: string, handler: EventListener): void;
|
||||
|
||||
deregisterInteractionHandler(type: string, handler: EventListener): void;
|
||||
|
||||
registerThumbContainerInteractionHandler(type: string, handler: EventListener): void;
|
||||
|
||||
deregisterThumbContainerInteractionHandler(type: string, handler: EventListener): void;
|
||||
|
||||
registerBodyInteractionHandler(type: string, handler: EventListener): void;
|
||||
|
||||
deregisterBodyInteractionHandler(type: string, handler: EventListener): void;
|
||||
|
||||
registerResizeHandler(handler: EventListener): void;
|
||||
|
||||
deregisterResizeHandler(handler: EventListener): void;
|
||||
|
||||
notifyInput(): void;
|
||||
|
||||
notifyChange(): void;
|
||||
|
||||
setThumbContainerStyleProperty(propertyName: string, value: string): void;
|
||||
|
||||
setTrackStyleProperty(propertyName: string, value: string): void;
|
||||
|
||||
setMarkerValue(value: number): void;
|
||||
|
||||
appendTrackMarkers(numMarkers: number): void;
|
||||
|
||||
removeTrackMarkers(): void;
|
||||
|
||||
setLastTrackMarkersStyleProperty(propertyName: string, value: string): void;
|
||||
|
||||
isRTL(): boolean;
|
||||
}
|
||||
46
types/material__slider/constants.d.ts
vendored
Normal file
46
types/material__slider/constants.d.ts
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
/**
|
||||
* Copyright 2017 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.
|
||||
*/
|
||||
|
||||
import { MDCStrings, MDCNumbers } from 'material__base';
|
||||
|
||||
export interface cssClasses extends MDCStrings {
|
||||
ACTIVE: 'mdc-slider--active';
|
||||
DISABLED: 'mdc-slider--disabled';
|
||||
DISCRETE: 'mdc-slider--discrete';
|
||||
FOCUS: 'mdc-slider--focus';
|
||||
IN_TRANSIT: 'mdc-slider--in-transit';
|
||||
IS_DISCRETE: 'mdc-slider--discrete';
|
||||
HAS_TRACK_MARKER: 'mdc-slider--display-markers';
|
||||
}
|
||||
|
||||
export interface strings extends MDCStrings {
|
||||
TRACK_SELECTOR: '.mdc-slider__track';
|
||||
TRACK_MARKER_CONTAINER_SELECTOR: '.mdc-slider__track-marker-container';
|
||||
LAST_TRACK_MARKER_SELECTOR: '.mdc-slider__track-marker:last-child';
|
||||
THUMB_CONTAINER_SELECTOR: '.mdc-slider__thumb-container';
|
||||
PIN_VALUE_MARKER_SELECTOR: '.mdc-slider__pin-value-marker';
|
||||
ARIA_VALUEMIN: 'aria-valuemin';
|
||||
ARIA_VALUEMAX: 'aria-valuemax';
|
||||
ARIA_VALUENOW: 'aria-valuenow';
|
||||
ARIA_DISABLED: 'aria-disabled';
|
||||
STEP_DATA_ATTR: 'data-step';
|
||||
CHANGE_EVENT: 'MDCSlider:change';
|
||||
INPUT_EVENT: 'MDCSlider:input';
|
||||
}
|
||||
|
||||
export interface numbers extends MDCNumbers {
|
||||
PAGE_FACTOR: 4;
|
||||
}
|
||||
55
types/material__slider/foundation.d.ts
vendored
Normal file
55
types/material__slider/foundation.d.ts
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
/**
|
||||
* Copyright 2017 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.
|
||||
*/
|
||||
|
||||
import { cssClasses, strings, numbers } from './constants';
|
||||
|
||||
import { getCorrectEventName, getCorrectPropertyName } from 'material__animation';
|
||||
import MDCFoundation from 'material__base/foundation';
|
||||
import { MDCSliderAdapter } from './adapter';
|
||||
|
||||
export default class MDCSliderFoundation extends MDCFoundation<MDCSliderAdapter> {
|
||||
static readonly cssClasses: cssClasses;
|
||||
|
||||
static readonly strings: strings;
|
||||
|
||||
static readonly numbers: numbers;
|
||||
|
||||
static readonly defaultAdapter: MDCSliderAdapter;
|
||||
|
||||
setupTrackMarker(): void;
|
||||
|
||||
layout(): void;
|
||||
|
||||
getValue(): number;
|
||||
|
||||
setValue(value: number): void;
|
||||
|
||||
getMax(): number;
|
||||
|
||||
setMax(max: number): void;
|
||||
|
||||
getMin(): number;
|
||||
|
||||
setMin(min: number): void;
|
||||
|
||||
getStep(): number;
|
||||
|
||||
setStep(step: number): void;
|
||||
|
||||
isDisabled(): boolean;
|
||||
|
||||
setDisabled(disabled: boolean): void;
|
||||
}
|
||||
54
types/material__slider/index.d.ts
vendored
Normal file
54
types/material__slider/index.d.ts
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
// Type definitions for Material Components Web 0.26
|
||||
// Project: https://material.io/components/
|
||||
// Definitions by: Brent Douglas <https://github.com/BrentDouglas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/**
|
||||
* Copyright 2017 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.
|
||||
*/
|
||||
|
||||
import MDCComponent from 'material__base/component';
|
||||
|
||||
import MDCSliderFoundation from './foundation';
|
||||
import { MDCSliderAdapter } from './adapter';
|
||||
|
||||
export {MDCSliderAdapter, MDCSliderFoundation};
|
||||
|
||||
export class MDCSlider extends MDCComponent<MDCSliderAdapter, MDCSliderFoundation> {
|
||||
static attachTo(root: Element): MDCSlider;
|
||||
|
||||
value: number;
|
||||
|
||||
min: number;
|
||||
|
||||
max: number;
|
||||
|
||||
step: number;
|
||||
|
||||
disabled: boolean;
|
||||
|
||||
initialize(): void;
|
||||
|
||||
getDefaultFoundation(): MDCSliderFoundation;
|
||||
|
||||
initialSyncWithDOM(): void;
|
||||
|
||||
layout(): void;
|
||||
|
||||
stepUp(amount?: number): void;
|
||||
|
||||
stepDown(amount?: number): void;
|
||||
}
|
||||
27
types/material__slider/tsconfig.json
Normal file
27
types/material__slider/tsconfig.json
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"files": [
|
||||
"constants.d.ts",
|
||||
"adapter.d.ts",
|
||||
"index.d.ts",
|
||||
"foundation.d.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user