Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit 89c454a

Browse files
committed
Merge remote-tracking branch 'origin/feat/typescript' into feat/chips-ts
2 parents e5fcb78 + 3279cc9 commit 89c454a

File tree

82 files changed

+152
-140
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+152
-140
lines changed

docs/closure-compiler.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ This section should contain most - if not all - of what you need to get up and r
4949
// BAD
5050
import {MDCFoundation} from '@material/base';
5151
// GOOD
52-
import MDCFoundation from '@material/base/foundation';
52+
import {MDCFoundation} from '@material/base/foundation';
5353
```
5454

5555
This is an unfortunate side-effect of how [closure's module naming mechanism works](https://github.com/google/closure-compiler/issues/2257).
@@ -109,7 +109,7 @@ Foundations must extend `MDCFoundation` parameterized by their respective adapte
109109
```ts
110110
// foundation.ts
111111

112-
import MDCFoundation from '@material/base/foundation';
112+
import {MDCFoundation} from '@material/base/foundation';
113113
import MDCComponentAdapter from './adapter';
114114

115115
class MDCComponentFoundation extends MDCFoundation<MDCComponentAdapter> {
@@ -131,7 +131,7 @@ Components must extend `MDCComponent` parameterized by their respective foundati
131131
```ts
132132
// index.ts
133133

134-
import MDCComponent from '@material/base/component';
134+
import {MDCComponent} from '@material/base/component';
135135
import MDCComponentFoundation from './foundation';
136136

137137
class MDCAwesomeComponent extends MDCComponent<MDCComponentFoundation> {

packages/mdc-base/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ MDCFoundation provides the basic mechanisms for implementing foundation classes.
6262
- Provide `init()` and `destroy()` lifecycle methods
6363

6464
```javascript
65-
import MDCFoundation from '@material/base/foundation';
65+
import {MDCFoundation} from '@material/base/foundation';
6666

6767
export default class MyFoundation extends MDCFoundation {
6868
static get cssClasses() {

packages/mdc-base/component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@
2121
* THE SOFTWARE.
2222
*/
2323

24-
import MDCFoundation from './foundation';
24+
import {MDCFoundation} from './foundation';
2525
import {CustomEventListener, EventType, SpecificEventListener} from './types';
2626

2727
class MDCComponent<FoundationType extends MDCFoundation> {
28-
2928
static attachTo(root: Element): MDCComponent<MDCFoundation<{}>> {
3029
// Subclasses which extend MDCBase should provide an attachTo() method that takes a root element and
3130
// returns an instantiated component with its root set to that element. Also note that in the cases of

packages/mdc-base/index.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
* THE SOFTWARE.
2222
*/
2323

24-
import MDCComponent from './component';
25-
import MDCFoundation from './foundation';
26-
import {CustomEventListener, EventType, SpecificEventListener} from './types';
27-
28-
export {MDCFoundation, MDCComponent, CustomEventListener, EventType, SpecificEventListener};
24+
export * from './component';
25+
export * from './foundation';
26+
export * from './types';

packages/mdc-checkbox/foundation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
* THE SOFTWARE.
2222
*/
2323

24-
import MDCFoundation from '@material/base/foundation';
25-
import MDCCheckboxAdapter from './adapter';
24+
import {MDCFoundation} from '@material/base/foundation';
25+
import {MDCCheckboxAdapter} from './adapter';
2626
import {cssClasses, numbers, strings} from './constants';
2727

2828
class MDCCheckboxFoundation extends MDCFoundation<MDCCheckboxAdapter> {

packages/mdc-checkbox/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,16 @@
2222
*/
2323

2424
import {getCorrectEventName} from '@material/animation/index';
25-
import MDCComponent from '@material/base/component';
25+
import {MDCComponent} from '@material/base/component';
2626
import {EventType, SpecificEventListener} from '@material/base/index';
2727
import {MDCRipple, MDCRippleFoundation, RippleCapableSurface, util} from '@material/ripple/index';
2828
import {MDCSelectionControl} from '@material/selection-control/index';
29-
30-
import MDCCheckboxFoundation from './foundation';
29+
import {MDCCheckboxFoundation} from './foundation';
3130

3231
const {getMatchesProperty} = util;
3332
const CB_PROTO_PROPS = ['checked', 'indeterminate'];
3433

3534
class MDCCheckbox extends MDCComponent<MDCCheckboxFoundation> implements MDCSelectionControl, RippleCapableSurface {
36-
3735
static attachTo(root: Element) {
3836
return new MDCCheckbox(root);
3937
}
@@ -183,4 +181,6 @@ function validDescriptor(inputPropDesc: PropertyDescriptor | undefined): inputPr
183181
return !!inputPropDesc && typeof inputPropDesc.set === 'function';
184182
}
185183

186-
export {MDCCheckboxFoundation, MDCCheckbox};
184+
export {MDCCheckbox as default, MDCCheckbox};
185+
export * from './adapter';
186+
export * from './foundation';

packages/mdc-drawer/dismissible/foundation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323

2424
import MDCDrawerAdapter from '../adapter';
25-
import MDCFoundation from '@material/base/foundation';
25+
import {MDCFoundation} from '@material/base/foundation';
2626
import {cssClasses, strings} from '../constants';
2727

2828
/**

packages/mdc-drawer/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2121
* THE SOFTWARE.
2222
*/
23-
import MDCComponent from '@material/base/component';
23+
import {MDCComponent} from '@material/base/component';
2424
import MDCDismissibleDrawerFoundation from './dismissible/foundation';
2525
import MDCModalDrawerFoundation from './modal/foundation';
2626
import MDCDrawerAdapter from './adapter';
2727
import {MDCList} from '@material/list/index';
28-
import MDCListFoundation from '@material/list/foundation';
28+
import {MDCListFoundation} from '@material/list/foundation';
2929
import {strings} from './constants';
3030
import * as util from './util';
3131
import createFocusTrap from 'focus-trap';

packages/mdc-floating-label/foundation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* THE SOFTWARE.
2222
*/
2323

24-
import MDCFoundation from '@material/base/foundation';
24+
import {MDCFoundation} from '@material/base/foundation';
2525
import MDCFloatingLabelAdapter from './adapter';
2626
import {cssClasses} from './constants';
2727

packages/mdc-floating-label/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* THE SOFTWARE.
2222
*/
2323

24-
import MDCComponent from '@material/base/component';
24+
import {MDCComponent} from '@material/base/component';
2525
import MDCFloatingLabelAdapter from './adapter';
2626
import MDCFloatingLabelFoundation from './foundation';
2727

packages/mdc-form-field/foundation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* THE SOFTWARE.
2222
*/
2323

24-
import MDCFoundation from '@material/base/foundation';
24+
import {MDCFoundation} from '@material/base/foundation';
2525
import {MDCFormFieldAdapter} from './adapter';
2626
import {cssClasses, strings} from './constants';
2727

packages/mdc-form-field/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* THE SOFTWARE.
2222
*/
2323

24-
import MDCComponent from '@material/base/component';
24+
import {MDCComponent} from '@material/base/component';
2525
import {MDCSelectionControl} from '@material/selection-control/index';
2626
import {MDCFormFieldFoundation} from './foundation';
2727

@@ -63,4 +63,6 @@ class MDCFormField extends MDCComponent<MDCFormFieldFoundation> {
6363
}
6464
}
6565

66-
export {MDCFormField, MDCFormFieldFoundation};
66+
export {MDCFormField as default, MDCFormField};
67+
export * from './adapter';
68+
export * from './foundation';

packages/mdc-grid-list/foundation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* THE SOFTWARE.
2222
*/
2323

24-
import MDCFoundation from '@material/base/foundation';
24+
import {MDCFoundation} from '@material/base/foundation';
2525
import {strings} from './constants';
2626

2727
export default class MDCGridListFoundation extends MDCFoundation {

packages/mdc-grid-list/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* THE SOFTWARE.
2222
*/
2323

24-
import MDCComponent from '@material/base/component';
24+
import {MDCComponent} from '@material/base/component';
2525

2626
import MDCGridListFoundation from './foundation';
2727

packages/mdc-icon-button/foundation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* THE SOFTWARE.
2222
*/
2323

24-
import MDCFoundation from '@material/base/foundation';
24+
import {MDCFoundation} from '@material/base/foundation';
2525
import {MDCIconButtonToggleAdapter} from './adapter';
2626
import {cssClasses, strings} from './constants';
2727

packages/mdc-icon-button/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
* THE SOFTWARE.
2222
*/
2323

24-
import MDCComponent from '@material/base/component';
24+
import {MDCComponent} from '@material/base/component';
2525
import {SpecificEventListener} from '@material/base/index';
2626
import {MDCRipple} from '@material/ripple/index';
27-
import MDCIconButtonToggleFoundation from './foundation';
27+
import {MDCIconButtonToggleFoundation} from './foundation';
2828

2929
class MDCIconButtonToggle extends MDCComponent<MDCIconButtonToggleFoundation> {
3030
static attachTo(root: HTMLElement) {
@@ -76,4 +76,7 @@ class MDCIconButtonToggle extends MDCComponent<MDCIconButtonToggleFoundation> {
7676
}
7777
}
7878

79-
export {MDCIconButtonToggle, MDCIconButtonToggleFoundation};
79+
export {MDCIconButtonToggle as default, MDCIconButtonToggle};
80+
export * from './adapter';
81+
export * from './foundation';
82+
export * from './types';

packages/mdc-icon-toggle/foundation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* THE SOFTWARE.
2222
*/
2323

24-
import MDCFoundation from '@material/base/foundation';
24+
import {MDCFoundation} from '@material/base/foundation';
2525
/* eslint-disable no-unused-vars */
2626
import {MDCIconToggleAdapter, IconToggleEvent} from './adapter';
2727
import {cssClasses, strings} from './constants';

packages/mdc-icon-toggle/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* THE SOFTWARE.
2222
*/
2323

24-
import MDCComponent from '@material/base/component';
24+
import {MDCComponent} from '@material/base/component';
2525
import MDCIconToggleFoundation from './foundation';
2626
import {MDCRipple, MDCRippleFoundation} from '@material/ripple/index';
2727

packages/mdc-line-ripple/foundation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* THE SOFTWARE.
2222
*/
2323

24-
import MDCFoundation from '@material/base/foundation';
24+
import {MDCFoundation} from '@material/base/foundation';
2525
import MDCLineRippleAdapter from './adapter';
2626
import {cssClasses} from './constants';
2727

packages/mdc-line-ripple/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* THE SOFTWARE.
2222
*/
2323

24-
import MDCComponent from '@material/base/component';
24+
import {MDCComponent} from '@material/base/component';
2525

2626
import MDCLineRippleAdapter from './adapter';
2727
import MDCLineRippleFoundation from './foundation';

packages/mdc-linear-progress/foundation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323

2424
import {getCorrectPropertyName} from '@material/animation/index';
25-
import MDCFoundation from '@material/base/foundation';
25+
import {MDCFoundation} from '@material/base/foundation';
2626
import {MDCLinearProgressAdapter} from './adapter';
2727
import {cssClasses, strings} from './constants';
2828

packages/mdc-linear-progress/index.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,10 @@
2121
* THE SOFTWARE.
2222
*/
2323

24-
import MDCComponent from '@material/base/component';
25-
import MDCLinearProgressFoundation from './foundation';
24+
import {MDCComponent} from '@material/base/component';
25+
import {MDCLinearProgressFoundation} from './foundation';
2626

27-
export {MDCLinearProgressFoundation};
28-
29-
export class MDCLinearProgress extends MDCComponent<MDCLinearProgressFoundation> {
27+
class MDCLinearProgress extends MDCComponent<MDCLinearProgressFoundation> {
3028
static attachTo(root: Element) {
3129
return new MDCLinearProgress(root);
3230
}
@@ -66,3 +64,7 @@ export class MDCLinearProgress extends MDCComponent<MDCLinearProgressFoundation>
6664
});
6765
}
6866
}
67+
68+
export {MDCLinearProgress as default, MDCLinearProgress};
69+
export * from './adapter';
70+
export * from './foundation';

packages/mdc-list/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {SpecificEventListener} from '@material/base/index';
2626
import * as ponyfill from '@material/dom/ponyfill';
2727
import {cssClasses, strings} from './constants';
2828
import {MDCListFoundation} from './foundation';
29-
import {ListActionEvent, ListActionEventDetail, ListActionEventListener, ListIndex} from './types';
29+
import {ListActionEventDetail, ListIndex} from './types';
3030

3131
class MDCList extends MDCComponent<MDCListFoundation> {
3232
set vertical(value: boolean) {
@@ -255,4 +255,7 @@ class MDCList extends MDCComponent<MDCListFoundation> {
255255
}
256256
}
257257

258-
export {MDCList, MDCListFoundation, ListActionEvent, ListActionEventDetail, ListActionEventListener};
258+
export {MDCList as default, MDCList};
259+
export * from './adapter';
260+
export * from './foundation';
261+
export * from './types';

packages/mdc-menu-surface/foundation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* THE SOFTWARE.
2222
*/
2323

24-
import MDCFoundation from '@material/base/foundation';
24+
import {MDCFoundation} from '@material/base/foundation';
2525
import {MDCMenuSurfaceAdapter} from './adapter';
2626
import {Corner, CornerBit, cssClasses, numbers, strings} from './constants';
2727
import {MenuDimensions, MenuDistance, MenuPoint} from './types';

packages/mdc-menu-surface/index.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
* THE SOFTWARE.
2222
*/
2323

24-
import MDCComponent from '@material/base/component';
24+
import {MDCComponent} from '@material/base/component';
2525
import {SpecificEventListener} from '@material/base/index';
26-
import {Corner, CornerBit, cssClasses, strings} from './constants';
26+
import {Corner, cssClasses, strings} from './constants';
2727
import {MDCMenuSurfaceFoundation} from './foundation';
28-
import {MenuDimensions, MenuDistance, MenuPoint} from './types';
28+
import {MenuDistance} from './types';
2929
import * as util from './util';
3030

3131
type RegisterFunction = () => void;
@@ -204,4 +204,8 @@ class MDCMenuSurface extends MDCComponent<MDCMenuSurfaceFoundation> {
204204
}
205205
}
206206

207-
export {MDCMenuSurfaceFoundation, MDCMenuSurface, MenuDimensions, MenuDistance, MenuPoint, Corner, CornerBit, util};
207+
export {MDCMenuSurface as default, MDCMenuSurface, util};
208+
export {Corner, CornerBit} from './constants';
209+
export * from './adapter';
210+
export * from './foundation';
211+
export * from './types';

packages/mdc-notched-outline/foundation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* THE SOFTWARE.
2222
*/
2323

24-
import MDCFoundation from '@material/base/foundation';
24+
import {MDCFoundation} from '@material/base/foundation';
2525
import MDCNotchedOutlineAdapter from './adapter';
2626
import {cssClasses, strings, numbers} from './constants';
2727

packages/mdc-notched-outline/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* THE SOFTWARE.
2222
*/
2323

24-
import MDCComponent from '@material/base/component';
24+
import {MDCComponent} from '@material/base/component';
2525

2626
import MDCNotchedOutlineAdapter from './adapter';
2727
import MDCNotchedOutlineFoundation from './foundation';

packages/mdc-radio/foundation.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,11 @@
2121
* THE SOFTWARE.
2222
*/
2323

24-
import MDCFoundation from '@material/base/foundation';
25-
24+
import {MDCFoundation} from '@material/base/foundation';
2625
import {MDCRadioAdapter} from './adapter';
2726
import {cssClasses, strings} from './constants';
2827

2928
class MDCRadioFoundation extends MDCFoundation<MDCRadioAdapter> {
30-
3129
static get cssClasses() {
3230
return cssClasses;
3331
}

packages/mdc-radio/index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,15 @@
2121
* THE SOFTWARE.
2222
*/
2323

24-
import MDCComponent from '@material/base/component';
24+
import {MDCComponent} from '@material/base/component';
2525
import {EventType, SpecificEventListener} from '@material/base/index';
2626
import {RippleCapableSurface} from '@material/ripple/index';
2727
import {MDCRipple, MDCRippleFoundation} from '@material/ripple/index';
2828
import {MDCSelectionControl} from '@material/selection-control/index';
2929

30-
import MDCRadioFoundation from './foundation';
30+
import {MDCRadioFoundation} from './foundation';
3131

3232
class MDCRadio extends MDCComponent<MDCRadioFoundation> implements RippleCapableSurface, MDCSelectionControl {
33-
3433
static attachTo(root: Element) {
3534
return new MDCRadio(root);
3635
}
@@ -110,4 +109,6 @@ class MDCRadio extends MDCComponent<MDCRadioFoundation> implements RippleCapable
110109
}
111110
}
112111

113-
export {MDCRadio, MDCRadioFoundation};
112+
export {MDCRadio as default, MDCRadio};
113+
export * from './adapter';
114+
export * from './foundation';

0 commit comments

Comments
 (0)